1 22 package org.jboss.test.jmx.test; 23 24 import java.net.URL ; 25 26 import javax.management.ObjectName ; 27 28 import junit.framework.Test; 29 30 import org.jboss.mx.util.ObjectNameFactory; 31 import org.jboss.system.ServiceMBean; 32 33 40 public class SimpleURLDeploymentScannerUnitTestCase extends AbstractURLDeploymentScannerTest 41 { 42 ObjectName test = ObjectNameFactory.create("test:name=DefaultPkgService"); 43 String module = "defaultpkg.sar"; 44 45 public void testSomething() throws Exception 46 { 47 hotDeploy(module); 48 try 49 { 50 assertEquals(new Integer (ServiceMBean.STARTED), getServer().getAttribute(test, "State")); 51 } 52 finally 53 { 54 hotUndeploy(module); 55 } 56 assertFalse(getServer().isRegistered(test)); 57 } 58 59 62 public void testSuspendResumeDeployment() throws Exception 63 { 64 URL deployment = getTargetURL(module); 66 suspendDeployment(deployment); 67 68 try 69 { 70 hotDeploy(module); 72 assertFalse(getServer().isRegistered(test)); 73 74 resumeDeployment(deployment, false); 77 super.sleep(2000); 78 assertEquals(new Integer (ServiceMBean.STARTED), getServer().getAttribute(test, "State")); 79 80 suspendDeployment(deployment); 82 hotUndeploy(module); 83 assertEquals(new Integer (ServiceMBean.STARTED), getServer().getAttribute(test, "State")); 84 85 resumeDeployment(deployment, false); 88 super.sleep(2000); 89 assertFalse(getServer().isRegistered(test)); 90 } 91 catch (Exception ignore) 92 { 93 hotUndeploy(module); 94 } 95 } 96 97 public static Test suite() throws Exception 98 { 99 return getTestSuite(SimpleURLDeploymentScannerUnitTestCase.class); 100 } 101 102 public SimpleURLDeploymentScannerUnitTestCase(String name) 103 { 104 super(name); 105 } 106 } 107 | Popular Tags |