use of com.hazelcast.instance.EndpointQualifier in project hazelcast by hazelcast.
the class AdvancedNetworkConfigTest method test_setEndpointConfigs_throwsException_whenServerSocketCardinalityBroken.
@Test
public void test_setEndpointConfigs_throwsException_whenServerSocketCardinalityBroken() throws Exception {
IdentityHashMap<EndpointQualifier, EndpointConfig> offendingEndpointConfigs = new IdentityHashMap<EndpointQualifier, EndpointConfig>();
EndpointQualifier one = createReflectively(ProtocolType.MEMBER, "1");
EndpointQualifier two = createReflectively(ProtocolType.MEMBER, "2");
offendingEndpointConfigs.put(one, new ServerSocketEndpointConfig());
offendingEndpointConfigs.put(two, new ServerSocketEndpointConfig());
AdvancedNetworkConfig config = new AdvancedNetworkConfig();
expected.expect(InvalidConfigurationException.class);
config.setEndpointConfigs(offendingEndpointConfigs);
}
use of com.hazelcast.instance.EndpointQualifier in project hazelcast by hazelcast.
the class AdvancedNetworkConfigTest method createReflectively.
// bypass EndpointQualifier checks
private EndpointQualifier createReflectively(ProtocolType protocolType, String name) throws Exception {
EndpointQualifier endpointQualifier = new EndpointQualifier();
ReflectionUtils.setFieldValueReflectively(endpointQualifier, "type", protocolType);
ReflectionUtils.setFieldValueReflectively(endpointQualifier, "identifier", name);
return endpointQualifier;
}
Aggregations