mx4j/src/test/test/javax/management/remote JMXConnectorTestCase.java,1.15,1.16

[email protected]
Newsgroups gmane.comp.java.mx4j.cvs
Message-ID <[email protected]>
Update of /cvsroot/mx4j/mx4j/src/test/test/javax/management/remote
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1713/test/test/javax/management/remote

Modified Files:
	JMXConnectorTestCase.java 
Log Message:
Adding a test for bug #907629: loading a resolver with the same mechanism of the provider

Index: JMXConnectorTestCase.java
===================================================================
RCS file: /cvsroot/mx4j/mx4j/src/test/test/javax/management/remote/JMXConnectorTestCase.java,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -d -r1.15 -r1.16
*** JMXConnectorTestCase.java	25 Feb 2004 17:00:25 -0000	1.15
--- JMXConnectorTestCase.java	1 Mar 2004 18:22:55 -0000	1.16
***************
*** 344,347 ****
--- 344,372 ----
     }
  
+    public void testConnectWithProviderClassLoader() throws Exception
+    {
+       JMXConnectorServer cntorServer = null;
+       JMXConnector cntor = null;
+       try
+       {
+          JMXServiceURL url = createJMXConnectorServerAddress();
+          MBeanServer server = newMBeanServer();
+          Map serverEnv = getEnvironment();
+          serverEnv.put(JMXConnectorServerFactory.PROTOCOL_PROVIDER_CLASS_LOADER, getClass().getClassLoader());
+          Thread.currentThread().setContextClassLoader(getClass().getClassLoader().getParent());
+          cntorServer = JMXConnectorServerFactory.newJMXConnectorServer(url, serverEnv, server);
+          cntorServer.start();
+ 
+          cntor = JMXConnectorFactory.connect(cntorServer.getAddress(), getEnvironment());
+          MBeanServerConnection mbsc = cntor.getMBeanServerConnection();
+ 
+       }
+       finally
+       {
+          if (cntor != null) cntor.close();
+          if (cntorServer != null) cntorServer.stop();
+       }
+    }
+ 
     public interface EmitterMBean
     {



-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.