KickJava   Java API By Example, From Geeks To Geeks.

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


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: PublicationTest.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.TestCase;
24 import junit.framework.TestSuite;
25 import junit.textui.TestRunner;
26
27 import org.apache.lenya.cms.PublicationHelper;
28 import org.apache.lenya.cms.publication.file.FilePublicationTest;
29
30 /**
31  * To change the template for this generated type comment go to
32  * Window>Preferences>Java>Code Generation>Code and Comments
33  */

34 public class PublicationTest extends TestCase {
35     /**
36      * Constructor.
37      * @param test The test to execute.
38      */

39     public PublicationTest(String JavaDoc test) {
40         super(test);
41     }
42
43     /**
44      * The main method.
45      * @param args The command-line arguments.
46      */

47     public static void main(String JavaDoc[] args) {
48         PublicationHelper.extractPublicationArguments(args);
49         TestRunner.run(getSuite());
50     }
51
52     protected static final Class JavaDoc[] classes =
53         { FilePublicationTest.class, DefaultDocumentTest.class, DefaultDocumentBuilderTest.class };
54
55     /**
56      * Creates a test suite.
57      * @return a test suite.
58      */

59     public static Test getSuite() {
60         TestSuite suite = new TestSuite();
61
62         for (int i = 0; i < classes.length; i++) {
63             suite.addTestSuite(classes[i]);
64         }
65
66         return suite;
67     }
68
69     /** @see junit.framework.TestCase#setUp() */
70     protected void setUp() throws Exception JavaDoc {
71         if (PublicationHelper.getPublication() == null) {
72             String JavaDoc[] args = { "D:\\Development\\build\\tomcat-4.1.24\\webapps\\lenya", "test" };
73             PublicationHelper.extractPublicationArguments(args);
74         }
75     }
76
77 }
78
Popular Tags