1 22 package org.jboss.test.jmx.test; 23 24 25 import javax.management.ObjectName ; 26 import junit.framework.*; 27 import org.jboss.test.JBossTestCase; 28 29 30 31 40 41 public class JarInSarJSR77UnitTestCase extends JBossTestCase 42 { 43 public JarInSarJSR77UnitTestCase(String name) 44 { 45 super(name); 46 } 47 48 58 public void testFakeParentCreatedAndRemoved() throws Exception 59 { 60 String testUrl = "jarinsar.sar"; 61 getLog().debug("testUrl is : " + testUrl); 62 ObjectName fakeApp = new ObjectName ("jboss.management.local:J2EEServer=Local,name=jarinsar.sar,j2eeType=J2EEApplication"); 63 ObjectName ejbModule = new ObjectName ("jboss.management.local:name=jarinsar.jar,J2EEServer=Local,J2EEApplication=jarinsar.sar,j2eeType=EJBModule"); 64 ObjectName bean = new ObjectName ("jboss.management.local:J2EEServer=Local,name=TestDataSource,J2EEApplication=jarinsar.sar,EJBModule=jarinsar.jar,j2eeType=StatelessSessionBean"); 65 66 deploy(testUrl); 68 try 69 { 70 assertTrue("fakeApp jsr-77 mbean is missing", getServer().isRegistered(fakeApp)); 71 assertTrue("ejbModule jsr-77 mbean is missing", getServer().isRegistered(ejbModule)); 72 assertTrue("bean jsr-77 mbean is missing", getServer().isRegistered(bean)); 73 } 74 finally 75 { 76 undeploy(testUrl); 77 assertTrue("fakeApp jsr-77 mbean is still present", !getServer().isRegistered(fakeApp)); 78 assertTrue("ejbModule jsr-77 mbean is still present", !getServer().isRegistered(ejbModule)); 79 assertTrue("bean jsr-77 mbean is still present", !getServer().isRegistered(bean)); 80 81 } 83 } 84 85 86 87 } | Popular Tags |