@Test public void testNetworkConfig() { NetworkConfig networkConfig = config.getNetworkConfig(); assertNotNull(networkConfig); assertEquals(5700, networkConfig.getPort()); assertFalse(networkConfig.isPortAutoIncrement()); final Collection<String> allowedPorts = networkConfig.getOutboundPortDefinitions(); assertEquals(2, allowedPorts.size()); Iterator portIter = allowedPorts.iterator(); assertEquals("35000-35100", portIter.next()); assertEquals("36000,36100", portIter.next()); assertFalse(networkConfig.getJoin().getMulticastConfig().isEnabled()); assertEquals(networkConfig.getJoin().getMulticastConfig().getMulticastTimeoutSeconds(), 8); assertEquals(networkConfig.getJoin().getMulticastConfig().getMulticastTimeToLive(), 16); assertFalse(networkConfig.getInterfaces().isEnabled()); assertEquals(1, networkConfig.getInterfaces().getInterfaces().size()); assertEquals("10.10.1.*", networkConfig.getInterfaces().getInterfaces().iterator().next()); TcpIpConfig tcp = networkConfig.getJoin().getTcpIpConfig(); assertNotNull(tcp); assertTrue(tcp.isEnabled()); assertTrue(networkConfig.getSymmetricEncryptionConfig().isEnabled()); final List<String> members = tcp.getMembers(); assertEquals(members.toString(), 2, members.size()); assertEquals("127.0.0.1:5700", members.get(0)); assertEquals("127.0.0.1:5701", members.get(1)); assertEquals("127.0.0.1:5700", tcp.getRequiredMember()); AwsConfig aws = networkConfig.getJoin().getAwsConfig(); assertFalse(aws.isEnabled()); assertEquals("sample-access-key", aws.getAccessKey()); assertEquals("sample-secret-key", aws.getSecretKey()); assertEquals("sample-region", aws.getRegion()); assertEquals("sample-group", aws.getSecurityGroupName()); assertEquals("sample-tag-key", aws.getTagKey()); assertEquals("sample-tag-value", aws.getTagValue()); }
@Test public void testConfigListeners() { assertNotNull(membershipListener); List<ListenerConfig> list = config.getListenerConfigs(); assertEquals(2, list.size()); for (ListenerConfig lc : list) { if (lc.getClassName() != null) { assertNull(lc.getImplementation()); assertEquals(DummyMembershipListener.class.getName(), lc.getClassName()); } else { assertNotNull(lc.getImplementation()); assertEquals(membershipListener, lc.getImplementation()); } } }