1 9 package test.compliance.core.serviceurl; 10 11 import java.io.IOException ; 12 import javax.management.remote.JMXConnector ; 13 import javax.management.remote.JMXConnectorFactory ; 14 import javax.management.remote.JMXServiceURL ; 15 16 import junit.framework.TestCase; 17 18 21 public class JMXConnectorFactoryTest extends TestCase 22 { 23 private final String protocol = "rmi"; 24 25 26 public JMXConnectorFactoryTest(String name) 27 { 28 super(name); 29 } 30 31 32 public void testConnect() 33 { 34 String serviceURL = "service:jmx:" + protocol + "://localhost:5900"; 35 try 36 { 37 JMXServiceURL jmxServiceURL = new JMXServiceURL (serviceURL); 38 JMXConnector connector = JMXConnectorFactory.connect(jmxServiceURL); 39 assertNotNull(connector); 40 } 41 catch(IOException e) 42 { 43 assertTrue(e.getMessage(), false); 44 } 45 } 46 47 } | Popular Tags |