KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > celtix > bus > management > jmx > MBServerConnectorTest


1 package org.objectweb.celtix.bus.management.jmx;
2
3
4
5 import javax.management.MBeanServer JavaDoc;
6 import javax.management.MBeanServerFactory JavaDoc;
7
8 import junit.framework.TestCase;
9
10
11
12 public class MBServerConnectorTest extends TestCase {
13     public void testMBServerConnector() {
14         MBServerConnectorFactory mcf;
15         MBeanServer JavaDoc mbs;
16         mbs = MBeanServerFactory.createMBeanServer("test");
17         mcf = MBServerConnectorFactory.getInstance();
18         mcf.setMBeanServer(mbs);
19         mcf.setThreaded(true);
20         mcf.setDaemon(true);
21         mcf.setServiceUrl("service:jmx:rmi:///jndi/rmi://localhost:9913/jmxrmi");
22         try {
23             mcf.createConnector();
24             Thread.sleep(1000);
25             mcf.destroy();
26         } catch (Exception JavaDoc ex) {
27             ex.printStackTrace();
28             assertFalse("Some Exception happen to MBServerConnectorTest", true);
29         }
30     }
31
32 }
33
Popular Tags