01: package org.objectweb.celtix.bus.management.jmx;
02:
03: import javax.management.MBeanServer;
04: import javax.management.MBeanServerFactory;
05:
06: import junit.framework.TestCase;
07:
08: public class MBServerConnectorTest extends TestCase {
09: public void testMBServerConnector() {
10: MBServerConnectorFactory mcf;
11: MBeanServer mbs;
12: mbs = MBeanServerFactory.createMBeanServer("test");
13: mcf = MBServerConnectorFactory.getInstance();
14: mcf.setMBeanServer(mbs);
15: mcf.setThreaded(true);
16: mcf.setDaemon(true);
17: mcf
18: .setServiceUrl("service:jmx:rmi:///jndi/rmi://localhost:9913/jmxrmi");
19: try {
20: mcf.createConnector();
21: Thread.sleep(1000);
22: mcf.destroy();
23: } catch (Exception ex) {
24: ex.printStackTrace();
25: assertFalse(
26: "Some Exception happen to MBServerConnectorTest",
27: true);
28: }
29: }
30:
31: }
|