}
public void testNotifications() throws Exception
{
SimpleNotificationService.Listener notifListener = new SimpleNotificationService.Listener();
BridgeControl bridgeControl = createBridgeControl(bridgeConfig.getName(), mbeanServer);
server_0.getManagementService().addNotificationListener(notifListener);
Assert.assertEquals(0, notifListener.getNotifications().size());
bridgeControl.stop();
Assert.assertEquals(1, notifListener.getNotifications().size());
Notification notif = notifListener.getNotifications().get(0);
Assert.assertEquals(NotificationType.BRIDGE_STOPPED, notif.getType());
Assert.assertEquals(bridgeControl.getName(), notif.getProperties()
.getSimpleStringProperty(new SimpleString("name"))
.toString());
bridgeControl.start();
Assert.assertEquals(2, notifListener.getNotifications().size());
notif = notifListener.getNotifications().get(1);
Assert.assertEquals(NotificationType.BRIDGE_STARTED, notif.getType());
Assert.assertEquals(bridgeControl.getName(), notif.getProperties()
.getSimpleStringProperty(new SimpleString("name"))
.toString());
}