1 22 package org.jboss.test.classloader.test; 23 24 import javax.management.MBeanServerConnection ; 25 import javax.management.ObjectName ; 26 27 import junit.extensions.TestSetup; 28 import junit.framework.Test; 29 import junit.framework.TestSuite; 30 31 import org.jboss.test.JBossTestCase; 32 import org.jboss.test.JBossTestSetup; 33 34 38 public class CircularityUnitTestCase extends JBossTestCase 39 { 40 private static String JMX_NAME = "jboss.test:name=CircularityError"; 41 private ObjectName testObjectName; 42 private Object [] args = {}; 43 private String [] sig = {}; 44 MBeanServerConnection server; 45 46 public CircularityUnitTestCase(String name) throws Exception 47 { 48 super(name); 49 testObjectName = new ObjectName (JMX_NAME); 50 server = getServer(); 51 } 52 53 55 public void testDuplicateClass() throws Exception 56 { 57 server.invoke(testObjectName, "testDuplicateClass", args, sig); 58 } 59 public void testUCLOwner() throws Exception 60 { 61 server.invoke(testObjectName, "testUCLOwner", args, sig); 62 } 63 public void testMissingSuperClass() throws Exception 64 { 65 server.invoke(testObjectName, "testMissingSuperClass", args, sig); 66 } 67 public void testLoading() throws Exception 68 { 69 server.invoke(testObjectName, "testLoading", args, sig); 70 } 71 public void testPackageProtected() throws Exception 72 { 73 server.invoke(testObjectName, "testPackageProtected", args, sig); 74 } 75 public void testDeadlockCase1() throws Exception 76 { 77 server.invoke(testObjectName, "testDeadlockCase1", args, sig); 78 } 79 public void testRecursiveLoadMT() throws Exception 80 { 81 server.invoke(testObjectName, "testRecursiveLoadMT", args, sig); 82 } 83 84 87 public static Test suite() throws Exception 88 { 89 TestSuite suite = new TestSuite(); 90 suite.addTest(new TestSuite(CircularityUnitTestCase.class)); 91 92 TestSetup wrapper = new JBossTestSetup(suite) 94 { 95 protected void setUp() throws Exception 96 { 97 super.setUp(); 98 deploy("circularity.sar"); 99 } 100 protected void tearDown() throws Exception 101 { 102 undeploy("circularity.sar"); 103 super.tearDown(); 104 } 105 }; 106 return wrapper; 107 } 108 109 } 110 | Popular Tags |