1 22 package test.performance.serialize; 23 24 import javax.management.MBeanServer ; 25 import javax.management.MBeanServerFactory ; 26 import javax.management.ObjectInstance ; 27 import javax.management.ObjectName ; 28 29 import junit.framework.Test; 30 import junit.framework.TestSuite; 31 import test.performance.serialize.support.Standard; 32 33 38 public class ObjectInstanceTestSuite 39 extends TestSuite 40 { 41 43 45 public static void main(String [] args) 46 { 47 junit.textui.TestRunner.run(suite()); 48 } 49 50 53 public static Test suite() 54 { 55 TestSuite suite = new TestSuite("All Object Instance tests"); 56 57 MBeanServer server = null; 58 59 try 60 { 61 server = MBeanServerFactory.createMBeanServer(); 62 ObjectName name = new ObjectName ("a:a=a"); 63 ObjectInstance instance = server.registerMBean(new Standard(), name); 64 suite.addTest(new SerializeTEST("testIt", instance, "ObjectInstance")); 66 } 67 catch (Exception e) 68 { 69 throw new Error (e.toString()); 70 } 71 finally 72 { 73 MBeanServerFactory.releaseMBeanServer(server); 74 } 75 76 return suite; 77 } 78 } 79 | Popular Tags |