KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > opencms > test > AllTests


1 /*
2  * File : $Source: /usr/local/cvs/opencms/test/org/opencms/test/AllTests.java,v $
3  * Date : $Date: 2006/03/27 14:53:05 $
4  * Version: $Revision: 1.29 $
5  *
6  * This library is part of OpenCms -
7  * the Open Source Content Mananagement System
8  *
9  * Copyright (c) 2005 Alkacon Software GmbH (http://www.alkacon.com)
10  *
11  * This library is free software; you can redistribute it and/or
12  * modify it under the terms of the GNU Lesser General Public
13  * License as published by the Free Software Foundation; either
14  * version 2.1 of the License, or (at your option) any later version.
15  *
16  * This library is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19  * Lesser General Public License for more details.
20  *
21  * For further information about Alkacon Software GmbH, please see the
22  * company website: http://www.alkacon.com
23  *
24  * For further information about OpenCms, please see the
25  * project website: http://www.opencms.org
26  *
27  * You should have received a copy of the GNU Lesser General Public
28  * License along with this library; if not, write to the Free Software
29  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
30  */

31
32 package org.opencms.test;
33
34 import org.opencms.util.CmsFileUtil;
35 import org.opencms.util.CmsStringUtil;
36
37 import junit.extensions.TestSetup;
38 import junit.framework.Test;
39 import junit.framework.TestSuite;
40
41 /**
42  * OpenCms main test suite, executes the individual test suites of all core packages.<p>
43  *
44  * @author Alexander Kandzior
45  * @version $Revision: 1.29 $
46  *
47  * @since 6.0
48  */

49 public final class AllTests {
50
51     /** Path for the test.properties file. */
52     public static final String JavaDoc TEST_PROPERTIES_PATH = CmsFileUtil.getResourcePathFromClassloader("");
53
54     /** Stopwatch for the time the test run. */
55     private static long m_startTime;
56
57     /**
58      * Hide constructor to prevent generation of class instances.<p>
59      */

60     private AllTests() {
61
62         // empty
63
}
64
65     /**
66      * One-time initialization code.<p>
67      */

68     public static void oneTimeSetUp() {
69
70         m_startTime = System.currentTimeMillis();
71         System.out.println("Starting OpenCms test run...");
72     }
73
74     /**
75      * One-time cleanup code.<p>
76      */

77     public static void oneTimeTearDown() {
78
79         long runTime = System.currentTimeMillis() - m_startTime;
80         System.out.println("... OpenCms test run finished! (Total runtime: "
81             + CmsStringUtil.formatRuntime(runTime)
82             + ")");
83     }
84
85     /**
86      * Creates the OpenCms JUnit test suite.<p>
87      *
88      * @return the OpenCms JUnit test suite
89      */

90     public static Test suite() {
91
92         TestSuite suite = new TestSuite("OpenCms complete tests");
93
94         suite.addTest(org.opencms.cache.AllTests.suite());
95         suite.addTest(org.opencms.configuration.AllTests.suite());
96         suite.addTest(org.opencms.db.AllTests.suite());
97         suite.addTest(org.opencms.file.AllTests.suite());
98         suite.addTest(org.opencms.file.types.AllTests.suite());
99         suite.addTest(org.opencms.flex.AllTests.suite());
100         suite.addTest(org.opencms.i18n.AllTests.suite());
101         suite.addTest(org.opencms.importexport.AllTests.suite());
102         suite.addTest(org.opencms.jsp.decorator.AllTests.suite());
103         suite.addTest(org.opencms.main.AllTests.suite());
104         suite.addTest(org.opencms.module.AllTests.suite());
105         suite.addTest(org.opencms.monitor.AllTests.suite());
106         suite.addTest(org.opencms.notification.AllTests.suite());
107         suite.addTest(org.opencms.scheduler.AllTests.suite());
108         suite.addTest(org.opencms.search.AllTests.suite());
109         suite.addTest(org.opencms.search.extractors.AllTests.suite());
110         suite.addTest(org.opencms.security.AllTests.suite());
111         suite.addTest(org.opencms.setup.AllTests.suite());
112         suite.addTest(org.opencms.staticexport.AllTests.suite());
113         suite.addTest(org.opencms.synchronize.AllTests.suite());
114         suite.addTest(org.opencms.util.AllTests.suite());
115         suite.addTest(org.opencms.widgets.AllTests.suite());
116         suite.addTest(org.opencms.workplace.AllTests.suite());
117         suite.addTest(org.opencms.xml.AllTests.suite());
118         suite.addTest(org.opencms.xml.content.AllTests.suite());
119         suite.addTest(org.opencms.xml.page.AllTests.suite());
120
121         TestSetup wrapper = new TestSetup(suite) {
122
123             protected void setUp() {
124
125                 oneTimeSetUp();
126             }
127
128             protected void tearDown() {
129
130                 oneTimeTearDown();
131             }
132         };
133
134         return wrapper;
135     }
136 }
Popular Tags