KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > test > compliance > core > serviceurl > JMXConnectorFactoryTest


1 /***************************************
2  * *
3  * JBoss: The OpenSource J2EE WebOS *
4  * *
5  * Distributable under LGPL license. *
6  * See terms of license at gnu.org. *
7  * *
8  ***************************************/

9 package test.compliance.core.serviceurl;
10
11 import java.io.IOException JavaDoc;
12 import javax.management.remote.JMXConnector JavaDoc;
13 import javax.management.remote.JMXConnectorFactory JavaDoc;
14 import javax.management.remote.JMXServiceURL JavaDoc;
15
16 import junit.framework.TestCase;
17
18 /**
19  * @author <a HREF="mailto:tom@jboss.org">Tom Elrod</a>
20  */

21 public class JMXConnectorFactoryTest extends TestCase
22 {
23    private final String JavaDoc protocol = "rmi";
24
25
26    public JMXConnectorFactoryTest(String JavaDoc name)
27    {
28       super(name);
29    }
30
31
32    public void testConnect()
33    {
34       String JavaDoc serviceURL = "service:jmx:" + protocol + "://localhost:5900";
35       try
36       {
37          JMXServiceURL JavaDoc jmxServiceURL = new JMXServiceURL JavaDoc(serviceURL);
38          JMXConnector JavaDoc connector = JMXConnectorFactory.connect(jmxServiceURL);
39          assertNotNull(connector);
40       }
41       catch(IOException JavaDoc e)
42       {
43          assertTrue(e.getMessage(), false);
44       }
45    }
46
47    //TODO: -TME Need to add more complicated unit tests. The only one now just checks for creating connector.
48
}
Popular Tags