@Test public void testInitDNodeList() throws Throwable { SploutConfiguration config = SploutConfiguration.getTestConfig(); QNodeHandler handler = new QNodeHandler(); try { HazelcastInstance hz = Hazelcast.newHazelcastInstance(HazelcastConfigBuilder.build(config)); CoordinationStructures coord = new CoordinationStructures(hz); SploutConfiguration dNodeConfig = SploutConfiguration.getTestConfig(); dNodeConfig.setProperty(DNodeProperties.PORT, 1000); coord.getDNodes().put("/localhost:1000", new DNodeInfo(dNodeConfig)); dNodeConfig = SploutConfiguration.getTestConfig(); dNodeConfig.setProperty(DNodeProperties.PORT, 1001); coord.getDNodes().put("/localhost:1001", new DNodeInfo(dNodeConfig)); try { handler.init(config); } catch (Exception e) { // since the handler will try to connect to "localhost:1000" we skip the Exception and // continue // the things we want to assert should be present anyway. } Assert.assertEquals( handler.getContext().getCoordinationStructures().getDNodes().values().size(), 2); } finally { handler.close(); Hazelcast.shutdownAll(); } }