KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > test > jmx > compliance > ComplianceSUITE


1 /*
2 * JBoss, Home of Professional Open Source
3 * Copyright 2005, JBoss Inc., and individual contributors as indicated
4 * by the @authors tag. See the copyright.txt in the distribution for a
5 * full listing of individual contributors.
6 *
7 * This is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU Lesser General Public License as
9 * published by the Free Software Foundation; either version 2.1 of
10 * the License, or (at your option) any later version.
11 *
12 * This software is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this software; if not, write to the Free
19 * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20 * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
21 */

22 package org.jboss.test.jmx.compliance;
23
24 import junit.framework.Test;
25 import junit.framework.TestSuite;
26
27 /**
28  * Everything under test.compliance is a set of unit tests
29  * which should pass as much as possible against the JMX RI
30  *
31  * Additions to this package are welcome/encouraged - adding a
32  * test that fails is a great way to communicate a bug ;-)
33  *
34  * Anyone contributing to the JBoss JMX impl should seriously
35  * consider providing a testcase prior to making code changes
36  * in the impl itself - ala XP.
37  *
38  * The only restriction is that if the tests don't succeed against
39  * the RI, the test error message should indicate that the test
40  * will fail on the RI (preferred way) or at least comment the testcase
41  * stating expected failures. Either way, you should comment the code
42  * justifying why the test is valid despite failing against the RI.
43  *
44  * @author <a HREF="mailto:trevor@protocool.com">Trevor Squires</a>.
45  */

46
47 public class ComplianceSUITE extends TestSuite
48 {
49    public static void main(String JavaDoc[] args)
50    {
51       try
52       {
53          // Support for RI tracing, use -Dcom.sun.jmx.trace.level=x where x is one of 0, 1 or 2
54
Class JavaDoc trace = Thread.currentThread().getContextClassLoader().loadClass("com.sun.jmx.trace.TraceImplementation");
55          java.lang.reflect.Method JavaDoc init = trace.getMethod("init", new Class JavaDoc[] { Integer.TYPE });
56          init.invoke(null, new Object JavaDoc[] { new Integer JavaDoc(System.getProperty("com.sun.jmx.trace.level")) });
57       }
58       catch (Exception JavaDoc ignored)
59       {
60       }
61
62       junit.textui.TestRunner.run(suite());
63    }
64
65    public static Test suite()
66    {
67       TestSuite suite = new TestSuite("All Compliance Tests");
68
69       suite.addTest(org.jboss.test.jmx.compliance.objectname.ObjectNameSUITE.suite());
70       suite.addTest(org.jboss.test.jmx.compliance.standard.StandardSUITE.suite());
71       suite.addTest(org.jboss.test.jmx.compliance.registration.RegistrationSUITE.suite());
72       suite.addTest(org.jboss.test.jmx.compliance.server.ServerSUITE.suite());
73       suite.addTest(org.jboss.test.jmx.compliance.modelmbean.ModelMBeanSUITE.suite());
74       suite.addTest(org.jboss.test.jmx.compliance.notcompliant.NCMBeanSUITE.suite());
75       suite.addTest(org.jboss.test.jmx.compliance.loading.LoadingSUITE.suite());
76       suite.addTest(org.jboss.test.jmx.compliance.varia.VariaSUITE.suite());
77       suite.addTest(org.jboss.test.jmx.compliance.query.QuerySUITE.suite());
78       suite.addTest(org.jboss.test.jmx.compliance.metadata.MetaDataSUITE.suite());
79       suite.addTest(org.jboss.test.jmx.compliance.relation.RelationSUITE.suite());
80       suite.addTest(org.jboss.test.jmx.compliance.openmbean.OpenMBeanSUITE.suite());
81       suite.addTest(org.jboss.test.jmx.compliance.notification.NotificationSUITE.suite());
82       return suite;
83    }
84 }
85
Popular Tags