Package org.jboss.test.jmx.invoker

Examples of org.jboss.test.jmx.invoker.RMIBadListener


   public void testNotificationWithBadListener() throws Exception
   {
      log.info("+++ testNotificationWithBadListener");
      RMIAdaptor server = (RMIAdaptor) getInitialContext().lookup("jmx/invoker/RMIAdaptor");
      // Add a bad listener
      RMIBadListener badListener = new RMIBadListener();
      badListener.export();
      server.addNotificationListener(getObjectName(), badListener, null, "BadListener");
      RMIListener listener = new RMIListener(10);
      listener.export();
      // Add a good listener
      server.addNotificationListener(getObjectName(), listener, null, "runTimer");
      server.invoke(getObjectName(), "startTimer", null, null);
      // Wait 25 seconds for the good listener events to complete
      synchronized( listener )
      {
         listener.wait(25000);
      }
      server.removeNotificationListener(getObjectName(), listener);
      listener.unexport();
      int count = listener.getCount();
      assertTrue("Received 10 notifications from Listener, count="+count,
         count == 10);
      count = badListener.getCount();
      assertTrue("Received >= 1 notifications from BadListener, count="+count,
         count >= 1);
      try
      {
         server.removeNotificationListener(getObjectName(), badListener);
         badListener.unexport();
      }
      catch(ListenerNotFoundException e)
      {

         log.debug("The BadListener was not found", e);
View Full Code Here

TOP

Related Classes of org.jboss.test.jmx.invoker.RMIBadListener

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.