01: /*
02: * JBoss, Home of Professional Open Source.
03: * Copyright 2006, Red Hat Middleware LLC, and individual contributors
04: * as indicated by the @author tags. See the copyright.txt file in the
05: * distribution for a full listing of individual contributors.
06: *
07: * This is free software; you can redistribute it and/or modify it
08: * under the terms of the GNU Lesser General Public License as
09: * 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 test.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: public static void main(String[] args) {
49: try {
50: // Support for RI tracing, use -Dcom.sun.jmx.trace.level=x where x is one of 0, 1 or 2
51: Class trace = Thread.currentThread()
52: .getContextClassLoader().loadClass(
53: "com.sun.jmx.trace.TraceImplementation");
54: java.lang.reflect.Method init = trace.getMethod("init",
55: new Class[] { Integer.TYPE });
56: init.invoke(null, new Object[] { new Integer(System
57: .getProperty("com.sun.jmx.trace.level")) });
58: } catch (Exception ignored) {
59: }
60:
61: junit.textui.TestRunner.run(suite());
62: }
63:
64: public static Test suite() {
65: TestSuite suite = new TestSuite("All Compliance Tests");
66:
67: suite.addTest(test.compliance.objectname.ObjectNameSUITE
68: .suite());
69: suite.addTest(test.compliance.standard.StandardSUITE.suite());
70: suite.addTest(test.compliance.registration.RegistrationSUITE
71: .suite());
72: suite.addTest(test.compliance.server.ServerSUITE.suite());
73: suite.addTest(test.compliance.modelmbean.ModelMBeanSUITE
74: .suite());
75: suite
76: .addTest(test.compliance.notcompliant.NCMBeanSUITE
77: .suite());
78: suite.addTest(test.compliance.loading.LoadingSUITE.suite());
79: suite.addTest(test.compliance.varia.VariaSUITE.suite());
80: suite.addTest(test.compliance.query.QuerySUITE.suite());
81: suite.addTest(test.compliance.metadata.MetaDataSUITE.suite());
82: suite.addTest(test.compliance.relation.RelationSUITE.suite());
83: suite.addTest(test.compliance.openmbean.OpenMBeanSUITE.suite());
84: suite.addTest(test.compliance.notification.NotificationSUITE
85: .suite());
86: return suite;
87: }
88: }
|