001    /*
002     * Copyright 1999-2002,2004 The Apache Software Foundation.
003     * 
004     * Licensed under the Apache License, Version 2.0 (the "License");
005     * you may not use this file except in compliance with the License.
006     * You may obtain a copy of the License at
007     * 
008     *      http://www.apache.org/licenses/LICENSE-2.0
009     * 
010     * Unless required by applicable law or agreed to in writing, software
011     * distributed under the License is distributed on an "AS IS" BASIS,
012     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013     * See the License for the specific language governing permissions and
014     * limitations under the License.
015     */
016    
017    package org.apache.commons.latka;
018    
019    import java.net.URL;
020    
021    /**
022     * References a Latka XML suite, stored either inside a Reader
023     * or at a file URI.
024     *
025     * @see Latka#runTests(Suite, org.apache.commons.latka.event.LatkaEventInfo)
026     *
027     * @author Morgan Delagrange
028     */
029    public class Suite {
030    
031        /** test suite URL */
032        protected URL _url = null;
033    
034        /**
035         * Create a test suite from an XML document located at the
036         * designated URL.
037         *
038         * @param url of a Latka XML suite
039         */
040        public Suite(URL url) {
041            _url = url;
042        }
043    
044        /**
045         * URL containing the test suite.
046         * 
047         * @return test suite URL
048         */
049        public URL getURL() {
050            return _url;
051        }
052    
053        /**
054         * Set the URL of the test suite.  Much like a SAX 
055         * InputSource, you may set both a Reader and a URL, 
056         * indicating that while the base XML document is 
057         * inside a Reader, the parser resolves entities 
058         * relative to the given URL.
059         * @param url the URL to set
060         */
061        public void setURL(URL url) {
062            _url = url;
063        }
064    
065    }