Package org.jboss.test.jmx.compliance.server.support

Examples of org.jboss.test.jmx.compliance.server.support.Broadcaster.doSomething()


      // Add the listener
      MyNotificationListener listener = new MyNotificationListener();
      server.addNotificationListener(broadcasterName, listener, null, null);

      // Test we get a notification
      broadcaster.doSomething();
      assertEquals(1, listener.result);

      // Remove the broadcaster
      server.unregisterMBean(broadcasterName);
     
View Full Code Here


      // Remove the broadcaster
      server.unregisterMBean(broadcasterName);
     
      // This notification shouldn't work
      broadcaster.doSomething();
      try
      {
         assertEquals(1, listener.result);
      }
      catch (AssertionFailedError e)
View Full Code Here

            new ObjectName("JMImplementation:type=MBeanServerDelegate"),
            listener, null, null
      );      

      // Test we get a notification from the broadcaster
      broadcaster.doSomething();
      assertEquals(1, listener.result);

      // Test we get a notification from the delegate
      server.registerMBean(new Test(), new ObjectName("Test:foo=bar"));
      assertEquals(2, listener.result);
View Full Code Here

      // Remove ourselves from the broadcaster
      server.removeNotificationListener(broadcasterName, listener);      

      // Test we get a notification from the broadcaster
      broadcaster.doSomething();
      assertEquals(0, listener.result);

      // Test we get a notification from the delegate
      server.registerMBean(new Test(), new ObjectName("Test:foo=bar"));
      assertEquals(1, listener.result);
View Full Code Here

      Broadcaster broadcaster = new Broadcaster();
      server.registerMBean(broadcaster, broadcasterName);
      server.addNotificationListener(broadcasterName, listenerName, null, "handback2");
   
      // force notification
      broadcaster.doSomething();
      assertTrue("Listener should get a notification", listener.count == 1);
      assertTrue("Source should be the broadcaster", listener.source.equals(broadcasterName));
      assertTrue("Listener should get handback2", listener.handback.equals("handback2"));
   }
   
View Full Code Here

     
      // Add the listener
      server.addNotificationListener(broadcasterName, listenerName1, null, null);

      // Test we get a notification
      broadcaster.doSomething();
      assertEquals(1, listener1.count);
      assertEquals(broadcasterName, listener1.source);

      // Remove the broadcaster
      server.unregisterMBean(broadcasterName);
View Full Code Here

      // Remove the broadcaster
      server.unregisterMBean(broadcasterName);
     
      // This notification shouldn't work
      broadcaster.doSomething();
      try
      {
         assertEquals(1, listener1.count);
      }
      catch (AssertionFailedError e)
View Full Code Here

      ObjectName delegateName =
         new ObjectName("JMImplementation:type=MBeanServerDelegate");
      server.addNotificationListener(delegateName,listenerName1, null, null);      

      // Test we get a notification from the broadcaster
      broadcaster.doSomething();
      assertEquals(1, listener1.count);
      assertEquals(broadcasterName, listener1.source);

      try
      {
View Full Code Here

      // Remove ourselves from the broadcaster
      server.removeNotificationListener(broadcasterName, listener1);      

      // Test we get a notification from the broadcaster
      broadcaster.doSomething();
      assertEquals(0, listener1.count);

      // Test we get a notification from the delegate
      server.registerMBean(new Test(), new ObjectName("Test:foo=bar"));
      assertEquals(1, listener1.count);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.