1 22 package org.jboss.test.jmx.test; 23 24 import javax.management.ObjectName ; 25 26 import junit.framework.Test; 27 28 import org.jboss.system.ServiceMBean; 29 import org.jboss.test.JBossTestCase; 30 import org.jboss.test.jmx.proxy.TargetMBean; 31 32 38 public class RemoteMBeanProxyUnitTestCase extends JBossTestCase 39 { 40 public RemoteMBeanProxyUnitTestCase(String name) 41 { 42 super(name); 43 } 44 45 public static Test suite() 46 throws Exception 47 { 48 return getDeploySetup(RemoteMBeanProxyUnitTestCase.class, "jmxproxy.sar"); 49 } 50 51 57 public void testRemoteMBeanProxy() throws Exception 58 { 59 ObjectName name = new ObjectName ("jboss.test:name=ProxyTests"); 60 Object proxy = getServer().getAttribute(name, "Proxy"); 61 assertNotNull(proxy); 62 assertTrue(proxy instanceof TargetMBean); 63 TargetMBean target = (TargetMBean) proxy; 64 assertEquals(ServiceMBean.STARTED, target.getState()); 65 } 66 } 67 | Popular Tags |