mx4j/src/test/test/javax/management/remote JMXConnectorServerTestCase.java,1.7,1.8

[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-serv1594/test/test/javax/management/remote

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

Index: JMXConnectorServerTestCase.java
===================================================================
RCS file: /cvsroot/mx4j/mx4j/src/test/test/javax/management/remote/JMXConnectorServerTestCase.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** JMXConnectorServerTestCase.java	26 Oct 2003 03:04:24 -0000	1.7
--- JMXConnectorServerTestCase.java	1 Mar 2004 18:22:25 -0000	1.8
***************
*** 9,34 ****
  package test.javax.management.remote;
  
! import java.util.Map;
! import java.lang.reflect.Proxy;
  import java.lang.reflect.InvocationHandler;
  import java.lang.reflect.Method;
! import java.io.IOException;
  import java.net.MalformedURLException;
  
  import javax.management.remote.JMXConnectorServer;
  import javax.management.remote.JMXConnectorServerFactory;
  import javax.management.remote.JMXServiceURL;
  import javax.management.remote.MBeanServerForwarder;
- import javax.management.remote.JMXConnectorFactory;
- import javax.management.remote.JMXConnectionNotification;
- import javax.management.remote.JMXConnector;
- import javax.management.NotificationListener;
- import javax.management.Notification;
- import javax.management.MBeanServer;
- import javax.management.MBeanServerConnection;
- import javax.management.ObjectName;
  
  import test.MX4JTestCase;
- import test.MutableObject;
  
  /**
--- 9,28 ----
  package test.javax.management.remote;
  
! import java.io.IOException;
  import java.lang.reflect.InvocationHandler;
  import java.lang.reflect.Method;
! import java.lang.reflect.Proxy;
  import java.net.MalformedURLException;
+ import java.util.Map;
  
+ import javax.management.MBeanServer;
+ import javax.management.remote.JMXConnector;
+ import javax.management.remote.JMXConnectorFactory;
  import javax.management.remote.JMXConnectorServer;
  import javax.management.remote.JMXConnectorServerFactory;
  import javax.management.remote.JMXServiceURL;
  import javax.management.remote.MBeanServerForwarder;
  
  import test.MX4JTestCase;
  
  /**
***************
*** 233,235 ****
--- 227,248 ----
        }
     }
+ 
+    public void testStartWithProviderClassLoader() throws Exception
+    {
+       JMXConnectorServer cntorServer = 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();
+       }
+       finally
+       {
+          if (cntorServer != null) cntorServer.stop();
+       }
+    }
  }



-------------------------------------------------------
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.