TransportConfiguration live1 = generateTC();
bg.addConnector(live1);
DiscoveryGroup dg = new DiscoveryGroupImpl(RandomUtil.randomString(),
RandomUtil.randomString(),
null,
groupAddress,
groupPort,
timeout);
MyListener listener1 = new MyListener();
MyListener listener2 = new MyListener();
MyListener listener3 = new MyListener();
dg.registerListener(listener1);
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);
Assert.assertTrue(listener3.called);
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);
Assert.assertFalse(listener2.called);
Assert.assertFalse(listener3.called);
bg.stop();
dg.stop();
}