synchronized (this) { try { discoveryGroup.stop(); } catch (Exception e) { ActiveMQClientLogger.LOGGER.failedToStopDiscovery(e);
synchronized (this) { try { discoveryGroup.stop(); } catch (Exception e) { ActiveMQClientLogger.LOGGER.failedToStopDiscovery(e);
synchronized (this) { try { discoveryGroup.stop(); } catch (Exception e) { ActiveMQClientLogger.LOGGER.failedToStopDiscovery(e);
synchronized (this) { try { discoveryGroup.stop(); } catch (Exception e) { ActiveMQClientLogger.LOGGER.failedToStopDiscovery(e);
synchronized (this) { try { discoveryGroup.stop(); } catch (Exception e) { ActiveMQClientLogger.LOGGER.failedToStopDiscovery(e);
synchronized (this) { try { discoveryGroup.stop(); } catch (Exception e) { ActiveMQClientLogger.LOGGER.failedToStopDiscovery(e);
synchronized (this) { try { discoveryGroup.stop(); } catch (Exception e) { ActiveMQClientLogger.LOGGER.failedToStopDiscovery(e);
@Test public void testDiscoveryGroupNotifications() throws Exception { SimpleNotificationService notifService = new SimpleNotificationService(); SimpleNotificationService.Listener notifListener = new SimpleNotificationService.Listener(); notifService.addNotificationListener(notifListener); final InetAddress groupAddress = InetAddress.getByName(address1); final int groupPort = getUDPDiscoveryPort(); final int timeout = 500; dg = newDiscoveryGroup(RandomUtil.randomString(), RandomUtil.randomString(), null, groupAddress, groupPort, timeout, notifService); Assert.assertEquals(0, notifListener.getNotifications().size()); dg.start(); Assert.assertEquals(1, notifListener.getNotifications().size()); Notification notif = notifListener.getNotifications().get(0); Assert.assertEquals(CoreNotificationType.DISCOVERY_GROUP_STARTED, notif.getType()); Assert.assertEquals(dg.getName(), notif.getProperties().getSimpleStringProperty(new SimpleString("name")).toString()); dg.stop(); Assert.assertEquals(2, notifListener.getNotifications().size()); notif = notifListener.getNotifications().get(1); Assert.assertEquals(CoreNotificationType.DISCOVERY_GROUP_STOPPED, notif.getType()); Assert.assertEquals(dg.getName(), notif.getProperties().getSimpleStringProperty(new SimpleString("name")).toString()); }
@Test public void testSimpleBroadcastWithStopStartDiscoveryGroup() throws Exception { final InetAddress groupAddress = InetAddress.getByName(address1); final int groupPort = getUDPDiscoveryPort(); final int timeout = 500; final String nodeID = RandomUtil.randomString(); bg = newBroadcast(nodeID, RandomUtil.randomString(), null, -1, groupAddress, groupPort); bg.start(); TransportConfiguration live1 = generateTC(); bg.addConnector(live1); dg = newDiscoveryGroup(RandomUtil.randomString(), RandomUtil.randomString(), null, groupAddress, groupPort, timeout); dg.start(); verifyBroadcast(bg, dg); List<DiscoveryEntry> entries = dg.getDiscoveryEntries(); assertEqualsDiscoveryEntries(Arrays.asList(live1), entries); bg.stop(); dg.stop(); dg.start(); bg.start(); verifyBroadcast(bg, dg); entries = dg.getDiscoveryEntries(); assertEqualsDiscoveryEntries(Arrays.asList(live1), entries); }