1 22 package org.jboss.test.jbossmx.implementation.util; 23 24 import javax.management.MBeanServer ; 25 import javax.management.MBeanServerFactory ; 26 import javax.management.ObjectName ; 27 28 import org.jboss.mx.util.MBeanProxyExt; 29 import org.jboss.test.jbossmx.implementation.TestCase; 30 import org.jboss.test.jbossmx.implementation.util.support.Trivial; 31 import org.jboss.test.jbossmx.implementation.util.support.TrivialMBean; 32 33 37 public class MBeanProxyExtTestCase 38 extends TestCase 39 { 40 public MBeanProxyExtTestCase(String s) 41 { 42 super(s); 43 } 44 45 public void testObjectEqualsOnProxy() 46 throws Exception 47 { 48 MBeanServer server = MBeanServerFactory.createMBeanServer(); 49 ObjectName oname = new ObjectName ("test:name=trivial"); 50 51 server.registerMBean(new Trivial(), oname); 52 53 TrivialMBean mbean = (TrivialMBean)MBeanProxyExt.create( 54 TrivialMBean.class, oname, server 55 ); 56 57 assertTrue(mbean.equals(mbean)); 58 } 59 } 60 | Popular Tags |