KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > cli > jmx > test > JUnitTestsMain


1 /*
2  * The contents of this file are subject to the terms
3  * of the Common Development and Distribution License
4  * (the License). You may not use this file except in
5  * compliance with the License.
6  *
7  * You can obtain a copy of the license at
8  * https://glassfish.dev.java.net/public/CDDLv1.0.html or
9  * glassfish/bootstrap/legal/CDDLv1.0.txt.
10  * See the License for the specific language governing
11  * permissions and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL
14  * Header Notice in each file and include the License file
15  * at glassfish/bootstrap/legal/CDDLv1.0.txt.
16  * If applicable, add the following below the CDDL Header,
17  * with the fields enclosed by brackets [] replaced by
18  * you own identifying information:
19  * "Portions Copyrighted [year] [name of copyright owner]"
20  *
21  * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
22  */

23  
24 /*
25  * $Header: /cvs/glassfish/admin-cli/cli-api/src/java/com/sun/cli/jmx/test/JUnitTestsMain.java,v 1.3 2005/12/25 03:45:52 tcfujii Exp $
26  * $Revision: 1.3 $
27  * $Date: 2005/12/25 03:45:52 $
28  */

29  
30 package com.sun.cli.jmx.test;
31
32 import java.util.Iterator JavaDoc;
33 import java.util.Arrays JavaDoc;
34
35 import junit.extensions.ActiveTestSuite;
36
37 import com.sun.cli.jmx.cmd.ArgHelperTest;
38 import com.sun.cli.jmx.cmd.ArgHelperOptionsInfoTest;
39 import com.sun.cli.util.TokenizerTest;
40 import com.sun.cli.jmx.support.ArgParserTest;
41 import com.sun.cli.jmx.support.AliasMgrTest;
42 import com.sun.cli.jmx.support.CLISupportMBeanImplTest;
43 import com.sun.cli.jmx.util.ObjectNameQueryImplTest;
44
45 public class JUnitTestsMain
46 {
47     
48     final static Class JavaDoc [] TEST_CLASSES =
49     {
50         ObjectNameQueryImplTest.class,
51         TokenizerTest.class,
52         ArgHelperOptionsInfoTest.class,
53         ArgHelperTest.class,
54         ArgParserTest.class,
55         AliasMgrTest.class,
56         CLISupportMBeanImplTest.class,
57     };
58     
59         static void
60     testClass( Class JavaDoc theClass )
61     {
62         System.out.println( "*** testing " + theClass.getName() + " ***");
63         // use 'ActiveTestSuite' to thread the tests
64
final ActiveTestSuite suite = new ActiveTestSuite( theClass );
65         junit.textui.TestRunner.run( suite );
66     }
67     
68         public static void
69     main( String JavaDoc [] args )
70     {
71         final Iterator JavaDoc iter = Arrays.asList( TEST_CLASSES ).iterator();
72         
73         while ( iter.hasNext() )
74         {
75             final Class JavaDoc theClass = (Class JavaDoc)iter.next();
76             
77             testClass( theClass );
78         }
79     }
80 }
81
82
83
Popular Tags