KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > lenya > cms > publication > DefaultDocumentBuilderTest


1 /*
2  * Copyright 1999-2004 The Apache Software Foundation
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  */

17
18 /* $Id: DefaultDocumentBuilderTest.java 42625 2004-03-04 15:45:03Z egli $ */
19
20 package org.apache.lenya.cms.publication;
21
22 import junit.framework.Test;
23 import junit.framework.TestSuite;
24 import junit.textui.TestRunner;
25
26 import org.apache.lenya.cms.PublicationHelper;
27
28 /**
29  *
30  * To change the template for this generated type comment go to Window>Preferences>Java>Code
31  * Generation>Code and Comments
32  */

33 public class DefaultDocumentBuilderTest extends DefaultDocumentTest {
34     /**
35      * Constructor.
36      *
37      * @param test
38      * The test.
39      */

40     public DefaultDocumentBuilderTest(String JavaDoc test) {
41         super(test);
42     }
43
44     /**
45      * The main program. The parameters are set from the command line arguments.
46      *
47      * @param args
48      * The command line arguments.
49      */

50     public static void main(String JavaDoc[] args) {
51         PublicationHelper.extractPublicationArguments(args);
52         TestRunner.run(getSuite());
53     }
54
55     /**
56      * Returns the test suite.
57      *
58      * @return A test suite.
59      */

60     public static Test getSuite() {
61         return new TestSuite(DefaultDocumentBuilderTest.class);
62     }
63
64     /**
65      * @see org.apache.lenya.cms.publication.DefaultDocumentTest#getDocument(DocumentTestSet)
66      */

67     protected Document getDocument(DocumentTestSet set) throws DocumentBuildException {
68         Publication pub = PublicationHelper.getPublication();
69
70         return pub.getDocumentBuilder().buildDocument(
71             pub,
72             "/" + pub.getId() + "/" + set.getArea() + set.getUrl());
73     }
74 }
75
Popular Tags