93949596979899100101102103
groupPort, timeout); dg.start(); bg.broadcastConnectors(); boolean ok = dg.waitForBroadcast(1000); Assert.assertTrue(ok);
179180181182183184185186187188189
226227228229230231232233234235236
243244245246247248249250251252253
dg.start(); bg.start(); bg.broadcastConnectors(); ok = dg.waitForBroadcast(1000); Assert.assertTrue(ok);
284285286287288289290291292293294
DiscoveryGroup dg = new DiscoveryGroupImpl(nodeID, RandomUtil.randomString(), null, groupAddress, groupPort, timeout); dg.start(); bg.broadcastConnectors(); boolean ok = dg.waitForBroadcast(1000); Assert.assertFalse(ok);
375376377378379380381382383384385
port2, timeout); dg.start(); bg.broadcastConnectors(); boolean ok = dg.waitForBroadcast(1000); Assert.assertFalse(ok);
418419420421422423424425426427428
516517518519520521522523524525526
bg1.broadcastConnectors(); bg2.broadcastConnectors(); bg3.broadcastConnectors(); boolean ok = dg1.waitForBroadcast(timeout); Assert.assertTrue(ok); List<DiscoveryEntry> entries = dg1.getDiscoveryEntries(); assertEqualsDiscoveryEntries(Arrays.asList(live1), entries);
625626627628629630631632633634635
dg.registerListener(listener2); dg.registerListener(listener3); dg.start(); bg.broadcastConnectors(); boolean ok = dg.waitForBroadcast(1000); Assert.assertTrue(ok); Assert.assertTrue(listener1.called); Assert.assertTrue(listener2.called);
637638639640641642643644645646647
listener1.called = false; listener2.called = false; listener3.called = false; bg.broadcastConnectors(); ok = dg.waitForBroadcast(1000); Assert.assertTrue(ok); // Won't be called since connectors haven't changed Assert.assertFalse(listener1.called);