Package org.objectweb.celtix.bus.management.jmx

Source Code of org.objectweb.celtix.bus.management.jmx.MBServerConnectorTest

package org.objectweb.celtix.bus.management.jmx;



import javax.management.MBeanServer;
import javax.management.MBeanServerFactory;

import junit.framework.TestCase;



public class MBServerConnectorTest extends  TestCase {
    public void testMBServerConnector() {
        MBServerConnectorFactory mcf;   
        MBeanServer mbs;       
        mbs = MBeanServerFactory.createMBeanServer("test");           
        mcf = MBServerConnectorFactory.getInstance();
        mcf.setMBeanServer(mbs);
        mcf.setThreaded(true);
        mcf.setDaemon(true);
        mcf.setServiceUrl("service:jmx:rmi:///jndi/rmi://localhost:9913/jmxrmi");
        try {
            mcf.createConnector();
            Thread.sleep(1000);          
            mcf.destroy();
        } catch (Exception ex) {
            ex.printStackTrace();
            assertFalse("Some Exception happen to MBServerConnectorTest", true);
        }
    }

}
TOP

Related Classes of org.objectweb.celtix.bus.management.jmx.MBServerConnectorTest

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.