mx4j/src/test/test/javax/management/remote JMXConnectorInvocationTestCase.java,1.4,1.5 JMXConnectorServerTestCase.java,1.8,1.9 JMXConnectorTestCase.java,1.17,1.18 JMXNotificationsTestCase.java,1.6,1.7

Simone Bordet <[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-serv32430/src/test/test/javax/management/remote

Modified Files:
	JMXConnectorInvocationTestCase.java 
	JMXConnectorServerTestCase.java JMXConnectorTestCase.java 
	JMXNotificationsTestCase.java 
Log Message:
+ Added sleeps to allow HTTP tests to start successfully
+ Cosmetics

Index: JMXConnectorInvocationTestCase.java
===================================================================
RCS file: /cvsroot/mx4j/mx4j/src/test/test/javax/management/remote/JMXConnectorInvocationTestCase.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** JMXConnectorInvocationTestCase.java	22 Jul 2004 17:19:51 -0000	1.4
--- JMXConnectorInvocationTestCase.java	10 Aug 2004 09:28:45 -0000	1.5
***************
*** 47,53 ****
     private JMXConnectorServer connectorServer;
  
!    public JMXConnectorInvocationTestCase(String s)
     {
!       super(s);
     }
  
--- 47,53 ----
     private JMXConnectorServer connectorServer;
  
!    public JMXConnectorInvocationTestCase(String name)
     {
!       super(name);
     }
  
***************
*** 61,64 ****
--- 61,65 ----
        connectorServer = JMXConnectorServerFactory.newJMXConnectorServer(url, getEnvironment(), server);
        connectorServer.start();
+       sleep(5000);
        JMXConnector connector = JMXConnectorFactory.connect(connectorServer.getAddress(), getEnvironment());
        return connector.getMBeanServerConnection();
***************
*** 357,375 ****
           }
        });
-       JMXConnectorServer cntorServer = JMXConnectorServerFactory.newJMXConnectorServer(url, serverEnv, newMBeanServer());
-       cntorServer.start();
  
!       Map clientEnv = getEnvironment();
!       clientEnv.put(JMXConnector.CREDENTIALS, new String[0]);
  
!       JMXConnector cntor = JMXConnectorFactory.connect(cntorServer.getAddress(), clientEnv);
!       MBeanServerConnection mbsc = cntor.getMBeanServerConnection();
  
!       ObjectName name = ObjectName.getInstance("", "test", "invocation");
!       ObjectInstance instance = mbsc.createMBean(Support.class.getName(), name, null);
!       assertNotNull(instance);
  
!       Boolean result = (Boolean)mbsc.invoke(name, "authenticated", new Object[]{principalName}, new String[]{String.class.getName()});
!       assertTrue(result.booleanValue());
     }
  
--- 358,385 ----
           }
        });
  
!       JMXConnectorServer cntorServer = null;
!       try
!       {
!          cntorServer = JMXConnectorServerFactory.newJMXConnectorServer(url, serverEnv, newMBeanServer());
!          cntorServer.start();
  
!          Map clientEnv = getEnvironment();
!          clientEnv.put(JMXConnector.CREDENTIALS, new String[0]);
  
!          JMXConnector cntor = JMXConnectorFactory.connect(cntorServer.getAddress(), clientEnv);
!          MBeanServerConnection mbsc = cntor.getMBeanServerConnection();
  
!          ObjectName name = ObjectName.getInstance("", "test", "invocation");
!          ObjectInstance instance = mbsc.createMBean(Support.class.getName(), name, null);
!          assertNotNull(instance);
! 
!          Boolean result = (Boolean)mbsc.invoke(name, "authenticated", new Object[]{principalName}, new String[]{String.class.getName()});
!          assertTrue(result.booleanValue());
!       }
!       finally
!       {
!          if (cntorServer != null) cntorServer.stop();
!       }
     }
  
***************
*** 387,409 ****
           }
        });
!       JMXConnectorServer cntorServer = JMXConnectorServerFactory.newJMXConnectorServer(url, serverEnv, newMBeanServer());
!       cntorServer.start();
  
!       Map clientEnv = getEnvironment();
!       clientEnv.put(JMXConnector.CREDENTIALS, new String[0]);
  
!       JMXConnector cntor = JMXConnectorFactory.connect(cntorServer.getAddress(), clientEnv);
!       Set principals = new HashSet();
!       String delegatedName = "delegatedPrincipal";
!       principals.add(new JMXPrincipal(delegatedName));
!       Subject delegate = new Subject(true, principals, Collections.EMPTY_SET, Collections.EMPTY_SET);
!       MBeanServerConnection mbsc = cntor.getMBeanServerConnection(delegate);
  
!       ObjectName name = ObjectName.getInstance("", "test", "invocation");
!       ObjectInstance instance = mbsc.createMBean(Support.class.getName(), name, null);
!       assertNotNull(instance);
  
!       Boolean result = (Boolean)mbsc.invoke(name, "delegated", new Object[]{delegatedName}, new String[]{String.class.getName()});
!       assertTrue(result.booleanValue());
     }
  
--- 397,427 ----
           }
        });
!       JMXConnectorServer cntorServer = null;
!       try
!       {
!          cntorServer = JMXConnectorServerFactory.newJMXConnectorServer(url, serverEnv, newMBeanServer());
!          cntorServer.start();
  
!          Map clientEnv = getEnvironment();
!          clientEnv.put(JMXConnector.CREDENTIALS, new String[0]);
  
!          JMXConnector cntor = JMXConnectorFactory.connect(cntorServer.getAddress(), clientEnv);
!          Set principals = new HashSet();
!          String delegatedName = "delegatedPrincipal";
!          principals.add(new JMXPrincipal(delegatedName));
!          Subject delegate = new Subject(true, principals, Collections.EMPTY_SET, Collections.EMPTY_SET);
!          MBeanServerConnection mbsc = cntor.getMBeanServerConnection(delegate);
  
!          ObjectName name = ObjectName.getInstance("", "test", "invocation");
!          ObjectInstance instance = mbsc.createMBean(Support.class.getName(), name, null);
!          assertNotNull(instance);
  
!          Boolean result = (Boolean)mbsc.invoke(name, "delegated", new Object[]{delegatedName}, new String[]{String.class.getName()});
!          assertTrue(result.booleanValue());
!       }
!       finally
!       {
!          if (cntorServer != null) cntorServer.stop();
!       }
     }
  

Index: JMXNotificationsTestCase.java
===================================================================
RCS file: /cvsroot/mx4j/mx4j/src/test/test/javax/management/remote/JMXNotificationsTestCase.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** JMXNotificationsTestCase.java	25 Dec 2003 22:38:06 -0000	1.6
--- JMXNotificationsTestCase.java	10 Aug 2004 09:28:45 -0000	1.7
***************
*** 12,16 ****
  import java.net.MalformedURLException;
  import java.util.Map;
- 
  import javax.management.MBeanServer;
  import javax.management.MBeanServerConnection;
--- 12,15 ----
***************
*** 31,42 ****
  import javax.management.remote.JMXServiceURL;
  
  import test.MX4JTestCase;
  import test.MutableBoolean;
  import test.MutableInteger;
  import test.MutableObject;
- import mx4j.remote.MX4JRemoteConstants;
  
  /**
-  *
   * @author <a href="mailto:[email protected]">Simone Bordet</a>
   * @version $Revision$
--- 30,40 ----
  import javax.management.remote.JMXServiceURL;
  
+ import mx4j.remote.MX4JRemoteConstants;
  import test.MX4JTestCase;
  import test.MutableBoolean;
  import test.MutableInteger;
  import test.MutableObject;
  
  /**
   * @author <a href="mailto:[email protected]">Simone Bordet</a>
   * @version $Revision$
***************
*** 44,50 ****
  public abstract class JMXNotificationsTestCase extends MX4JTestCase
  {
!    public JMXNotificationsTestCase(String s)
     {
!       super(s);
     }
  
--- 42,53 ----
  public abstract class JMXNotificationsTestCase extends MX4JTestCase
  {
!    public JMXNotificationsTestCase(String name)
     {
!       super(name);
!    }
! 
!    protected void tearDown() throws Exception
!    {
!       sleep(5000);
     }
  
***************
*** 61,64 ****
--- 64,68 ----
           cntorServer = JMXConnectorServerFactory.newJMXConnectorServer(url, getEnvironment(), newMBeanServer());
           cntorServer.start();
+          sleep(5000);
  
           final MutableObject holder = new MutableObject(null);
***************
*** 77,80 ****
--- 81,89 ----
           assertEquals(notification.getType(), JMXConnectionNotification.OPENED);
        }
+       catch (Exception x)
+       {
+          x.printStackTrace();
+          throw x;
+       }
        finally
        {
***************
*** 91,94 ****
--- 100,104 ----
           cntorServer = JMXConnectorServerFactory.newJMXConnectorServer(url, getEnvironment(), newMBeanServer());
           cntorServer.start();
+          sleep(5000);
  
           final MutableObject holder = new MutableObject(null);
***************
*** 108,111 ****
--- 118,126 ----
           assertEquals(notification.getType(), JMXConnectionNotification.CLOSED);
        }
+       catch (Exception x)
+       {
+          x.printStackTrace();
+          throw x;
+       }
        finally
        {
***************
*** 124,127 ****
--- 139,143 ----
           cntorServer = JMXConnectorServerFactory.newJMXConnectorServer(url, getEnvironment(), server);
           cntorServer.start();
+          sleep(5000);
  
           final MutableObject holder = new MutableObject(null);
***************
*** 140,143 ****
--- 156,164 ----
           assertEquals(notification.getType(), JMXConnectionNotification.OPENED);
        }
+       catch (Exception x)
+       {
+          x.printStackTrace();
+          throw x;
+       }
        finally
        {
***************
*** 157,160 ****
--- 178,182 ----
           cntorServer = JMXConnectorServerFactory.newJMXConnectorServer(url, getEnvironment(), server);
           cntorServer.start();
+          sleep(5000);
  
           final MutableObject holder = new MutableObject(null);
***************
*** 174,177 ****
--- 196,204 ----
           assertEquals(notification.getType(), JMXConnectionNotification.CLOSED);
        }
+       catch (Exception x)
+       {
+          x.printStackTrace();
+          throw x;
+       }
        finally
        {
***************
*** 186,218 ****
        MBeanServer server = newMBeanServer();
        JMXConnectorServer cntorServer = JMXConnectorServerFactory.newJMXConnectorServer(url, getEnvironment(), server);
        cntorServer.start();
  
        final MutableObject holder = new MutableObject(null);
-       JMXConnector cntor = JMXConnectorFactory.newJMXConnector(cntorServer.getAddress(), getEnvironment());
-       cntor.addConnectionNotificationListener(new NotificationListener()
-       {
-          public void handleNotification(Notification notification, Object handback)
-          {
-             holder.set(notification);
-          }
-       }, null, null);
- 
-       Map clientEnv = getEnvironment();
        long period = 1000;
        int retries = 3;
!       clientEnv.put(MX4JRemoteConstants.CONNECTION_HEARTBEAT_PERIOD, new Long(period));
!       clientEnv.put(MX4JRemoteConstants.CONNECTION_HEARTBEAT_RETRIES, new Integer(retries));
!       cntor.connect(clientEnv);
  
!       JMXConnectionNotification notification = (JMXConnectionNotification)holder.get();
!       assertEquals(notification.getType(), JMXConnectionNotification.OPENED);
!       holder.set(null);
  
!       cntorServer.stop();
  
        // Wait for the heartbeat to send the failed notification
        sleep((retries * 3) * period);
  
!       notification = (JMXConnectionNotification)holder.get();
        assertNotNull(notification);
        assertEquals(notification.getType(), JMXConnectionNotification.FAILED);
--- 213,258 ----
        MBeanServer server = newMBeanServer();
        JMXConnectorServer cntorServer = JMXConnectorServerFactory.newJMXConnectorServer(url, getEnvironment(), server);
+ 
        cntorServer.start();
+       sleep(5000);
  
        final MutableObject holder = new MutableObject(null);
        long period = 1000;
        int retries = 3;
!       try
!       {
!          JMXConnector cntor = JMXConnectorFactory.newJMXConnector(cntorServer.getAddress(), getEnvironment());
!          cntor.addConnectionNotificationListener(new NotificationListener()
!          {
!             public void handleNotification(Notification notification, Object handback)
!             {
!                holder.set(notification);
!             }
!          }, null, null);
  
!          Map clientEnv = getEnvironment();
!          clientEnv.put(MX4JRemoteConstants.CONNECTION_HEARTBEAT_PERIOD, new Long(period));
!          clientEnv.put(MX4JRemoteConstants.CONNECTION_HEARTBEAT_RETRIES, new Integer(retries));
!          cntor.connect(clientEnv);
  
!          JMXConnectionNotification notification = (JMXConnectionNotification)holder.get();
!          assertEquals(notification.getType(), JMXConnectionNotification.OPENED);
!          holder.set(null);
!       }
!       catch (Exception x)
!       {
!          x.printStackTrace();
!          throw x;
!       }
!       finally
!       {
!          cntorServer.stop();
!          sleep(5000);
!       }
  
        // Wait for the heartbeat to send the failed notification
        sleep((retries * 3) * period);
  
!       JMXConnectionNotification notification = (JMXConnectionNotification)holder.get();
        assertNotNull(notification);
        assertEquals(notification.getType(), JMXConnectionNotification.FAILED);
***************
*** 230,233 ****
--- 270,274 ----
           cntorServer = JMXConnectorServerFactory.newJMXConnectorServer(url, getEnvironment(), server);
           cntorServer.start();
+          sleep(5000);
  
           cntor = JMXConnectorFactory.connect(cntorServer.getAddress(), getEnvironment());
***************
*** 269,272 ****
--- 310,318 ----
           holder.set(null);
        }
+       catch (Exception x)
+       {
+          x.printStackTrace();
+          throw x;
+       }
        finally
        {
***************
*** 294,297 ****
--- 340,344 ----
           server.registerMBean(cntorServer, cntorName);
           cntorServer.start();
+          sleep(5000);
  
           cntor = JMXConnectorFactory.connect(cntorServer.getAddress(), getEnvironment());
***************
*** 331,334 ****
--- 378,386 ----
           assertEquals(((Notification)connectionNotification.get()).getType(), JMXConnectionNotification.NOTIFS_LOST);
        }
+       catch (Exception x)
+       {
+          x.printStackTrace();
+          throw x;
+       }
        finally
        {
***************
*** 361,364 ****
--- 413,417 ----
           cntorServer = JMXConnectorServerFactory.newJMXConnectorServer(url, getEnvironment(), server);
           cntorServer.start();
+          sleep(5000);
  
           cntor = JMXConnectorFactory.connect(cntorServer.getAddress(), getEnvironment());
***************
*** 461,464 ****
--- 514,522 ----
           assertNull(handbackHolder.get());
        }
+       catch (Exception x)
+       {
+          x.printStackTrace();
+          throw x;
+       }
        finally
        {
***************
*** 488,491 ****
--- 546,550 ----
           cntorServer = JMXConnectorServerFactory.newJMXConnectorServer(url, getEnvironment(), server);
           cntorServer.start();
+          sleep(5000);
  
           cntor = JMXConnectorFactory.connect(cntorServer.getAddress(), getEnvironment());
***************
*** 543,546 ****
--- 602,610 ----
           assertNull(handbackHolder.get());
        }
+       catch (Exception x)
+       {
+          x.printStackTrace();
+          throw x;
+       }
        finally
        {
***************
*** 570,573 ****
--- 634,638 ----
           cntorServer = JMXConnectorServerFactory.newJMXConnectorServer(url, getEnvironment(), server);
           cntorServer.start();
+          sleep(5000);
  
           cntor = JMXConnectorFactory.connect(cntorServer.getAddress(), getEnvironment());
***************
*** 606,609 ****
--- 671,679 ----
           assertNull(handbackHolder.get());
        }
+       catch (Exception x)
+       {
+          x.printStackTrace();
+          throw x;
+       }
        finally
        {
***************
*** 646,649 ****
--- 716,720 ----
           cntorServer = JMXConnectorServerFactory.newJMXConnectorServer(url, getEnvironment(), server);
           cntorServer.start();
+          sleep(5000);
  
           cntor = JMXConnectorFactory.connect(cntorServer.getAddress(), getEnvironment());
***************
*** 711,714 ****
--- 782,790 ----
           assertEquals(counter2.get(), 0);
        }
+       catch (Exception x)
+       {
+          x.printStackTrace();
+          throw x;
+       }
        finally
        {
***************
*** 743,746 ****
--- 819,823 ----
           cntorServer = JMXConnectorServerFactory.newJMXConnectorServer(url, getEnvironment(), server);
           cntorServer.start();
+          sleep(5000);
  
           cntor = JMXConnectorFactory.connect(cntorServer.getAddress(), getEnvironment());
***************
*** 769,772 ****
--- 846,854 ----
           assertEquals(counter.get(), 1);
        }
+       catch (Exception x)
+       {
+          x.printStackTrace();
+          throw x;
+       }
        finally
        {

Index: JMXConnectorServerTestCase.java
===================================================================
RCS file: /cvsroot/mx4j/mx4j/src/test/test/javax/management/remote/JMXConnectorServerTestCase.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** JMXConnectorServerTestCase.java	1 Mar 2004 18:22:25 -0000	1.8
--- JMXConnectorServerTestCase.java	10 Aug 2004 09:28:45 -0000	1.9
***************
*** 15,19 ****
  import java.net.MalformedURLException;
  import java.util.Map;
- 
  import javax.management.MBeanServer;
  import javax.management.remote.JMXConnector;
--- 15,18 ----
***************
*** 32,38 ****
  public abstract class JMXConnectorServerTestCase extends MX4JTestCase
  {
!    public JMXConnectorServerTestCase(String s)
     {
!       super(s);
     }
  
--- 31,37 ----
  public abstract class JMXConnectorServerTestCase extends MX4JTestCase
  {
!    public JMXConnectorServerTestCase(String name)
     {
!       super(name);
     }
  
***************
*** 78,82 ****
        JMXServiceURL url = createJMXConnectorServerAddress();
        JMXConnectorServer server = JMXConnectorServerFactory.newJMXConnectorServer(url, getEnvironment(), null);
!       MBeanServerForwarder forwarder = (MBeanServerForwarder)Proxy.newProxyInstance(getClass().getClassLoader(), new Class[] {MBeanServerForwarder.class}, new InvocationHandler()
        {
           public Object invoke(Object proxy, Method method, Object[] args)
--- 77,81 ----
        JMXServiceURL url = createJMXConnectorServerAddress();
        JMXConnectorServer server = JMXConnectorServerFactory.newJMXConnectorServer(url, getEnvironment(), null);
!       MBeanServerForwarder forwarder = (MBeanServerForwarder)Proxy.newProxyInstance(getClass().getClassLoader(), new Class[]{MBeanServerForwarder.class}, new InvocationHandler()
        {
           public Object invoke(Object proxy, Method method, Object[] args)
***************
*** 101,105 ****
        JMXServiceURL url = createJMXConnectorServerAddress();
        JMXConnectorServer server = JMXConnectorServerFactory.newJMXConnectorServer(url, getEnvironment(), newMBeanServer());
!       MBeanServerForwarder forwarder = (MBeanServerForwarder)Proxy.newProxyInstance(getClass().getClassLoader(), new Class[] {MBeanServerForwarder.class}, new InvocationHandler()
        {
           public Object invoke(Object proxy, Method method, Object[] args)
--- 100,104 ----
        JMXServiceURL url = createJMXConnectorServerAddress();
        JMXConnectorServer server = JMXConnectorServerFactory.newJMXConnectorServer(url, getEnvironment(), newMBeanServer());
!       MBeanServerForwarder forwarder = (MBeanServerForwarder)Proxy.newProxyInstance(getClass().getClassLoader(), new Class[]{MBeanServerForwarder.class}, new InvocationHandler()
        {
           public Object invoke(Object proxy, Method method, Object[] args)
***************
*** 198,202 ****
        {
           JMXServiceURL url1 = createJMXConnectorServerAddress();
!          JMXServiceURL url2 = new JMXServiceURL(url1.getProtocol(), url1.getHost(), (url1.getPort() > 0)?(url1.getPort() + 1):0, url1.getURLPath());
  
           MBeanServer server = newMBeanServer();
--- 197,201 ----
        {
           JMXServiceURL url1 = createJMXConnectorServerAddress();
!          JMXServiceURL url2 = new JMXServiceURL(url1.getProtocol(), url1.getHost(), (url1.getPort() > 0) ? (url1.getPort() + 1) : 0, url1.getURLPath());
  
           MBeanServer server = newMBeanServer();

Index: JMXConnectorTestCase.java
===================================================================
RCS file: /cvsroot/mx4j/mx4j/src/test/test/javax/management/remote/JMXConnectorTestCase.java,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -d -r1.17 -r1.18
*** JMXConnectorTestCase.java	2 Mar 2004 09:09:46 -0000	1.17
--- JMXConnectorTestCase.java	10 Aug 2004 09:28:45 -0000	1.18
***************
*** 15,32 ****
  import java.io.ObjectOutputStream;
  import java.net.MalformedURLException;
- import java.util.HashMap;
- import java.util.Map;
  import java.util.ArrayList;
  import java.util.List;
! 
  import javax.management.MBeanServer;
  import javax.management.MBeanServerConnection;
! import javax.management.ObjectName;
  import javax.management.NotificationEmitter;
- import javax.management.NotificationListener;
  import javax.management.NotificationFilter;
! import javax.management.ListenerNotFoundException;
! import javax.management.MBeanNotificationInfo;
! import javax.management.Notification;
  import javax.management.remote.JMXAuthenticator;
  import javax.management.remote.JMXConnector;
--- 15,31 ----
  import java.io.ObjectOutputStream;
  import java.net.MalformedURLException;
  import java.util.ArrayList;
+ import java.util.HashMap;
  import java.util.List;
! import java.util.Map;
! import javax.management.ListenerNotFoundException;
! import javax.management.MBeanNotificationInfo;
  import javax.management.MBeanServer;
  import javax.management.MBeanServerConnection;
! import javax.management.Notification;
  import javax.management.NotificationEmitter;
  import javax.management.NotificationFilter;
! import javax.management.NotificationListener;
! import javax.management.ObjectName;
  import javax.management.remote.JMXAuthenticator;
  import javax.management.remote.JMXConnector;
***************
*** 41,45 ****
  
  /**
-  *
   * @author <a href="mailto:[email protected]">Simone Bordet</a>
   * @version $Revision$
--- 40,43 ----
***************
*** 47,58 ****
  public abstract class JMXConnectorTestCase extends MX4JTestCase
  {
!    public JMXConnectorTestCase(String s)
     {
!       super(s);
     }
  
     protected void tearDown() throws Exception
     {
!       sleep(2000);
     }
  
--- 45,56 ----
  public abstract class JMXConnectorTestCase extends MX4JTestCase
  {
!    public JMXConnectorTestCase(String name)
     {
!       super(name);
     }
  
     protected void tearDown() throws Exception
     {
!       sleep(5000);
     }
  
***************
*** 86,89 ****
--- 84,88 ----
           cntorServer = JMXConnectorServerFactory.newJMXConnectorServer(url, getEnvironment(), newMBeanServer());
           cntorServer.start();
+          sleep(5000);
  
           cntor = JMXConnectorFactory.connect(cntorServer.getAddress(), getEnvironment());
***************
*** 116,119 ****
--- 115,119 ----
           cntorServer = JMXConnectorServerFactory.newJMXConnectorServer(url, getEnvironment(), newMBeanServer());
           cntorServer.start();
+          sleep(5000);
  
           cntor = JMXConnectorFactory.connect(cntorServer.getAddress(), getEnvironment());
***************
*** 155,158 ****
--- 155,159 ----
           cntorServer = JMXConnectorServerFactory.newJMXConnectorServer(url, serverEnv, server);
           cntorServer.start();
+          sleep(5000);
  
           // Try to provide wrong password
***************
*** 188,191 ****
--- 189,193 ----
        JMXConnectorServer cntorServer = JMXConnectorServerFactory.newJMXConnectorServer(url, getEnvironment(), newMBeanServer());
        cntorServer.start();
+       sleep(5000);
  
        JMXConnector cntor = JMXConnectorFactory.connect(cntorServer.getAddress(), getEnvironment());
***************
*** 209,212 ****
--- 211,215 ----
        JMXConnectorServer cntorServer = JMXConnectorServerFactory.newJMXConnectorServer(url, getEnvironment(), newMBeanServer());
        cntorServer.start();
+       sleep(5000);
  
        JMXConnector cntor = JMXConnectorFactory.connect(cntorServer.getAddress(), getEnvironment());
***************
*** 235,238 ****
--- 238,242 ----
           cntorServer = JMXConnectorServerFactory.newJMXConnectorServer(url, getEnvironment(), newMBeanServer());
           cntorServer.start();
+          sleep(5000);
  
           cntor = JMXConnectorFactory.newJMXConnector(cntorServer.getAddress(), getEnvironment());
***************
*** 311,314 ****
--- 315,319 ----
           cntorServer = JMXConnectorServerFactory.newJMXConnectorServer(url, getEnvironment(), server);
           cntorServer.start();
+          sleep(5000);
  
           Emitter emitter = new Emitter();
***************
*** 359,362 ****
--- 364,368 ----
           cntorServer.start();
           Thread.currentThread().setContextClassLoader(old);
+          sleep(5000);
  
           cntor = JMXConnectorFactory.connect(cntorServer.getAddress(), getEnvironment());



-------------------------------------------------------
SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media
100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33
Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift.
http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285
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.