Search in sources :

Example 21 with EndpointQualifier

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);
}
Also used : IdentityHashMap(java.util.IdentityHashMap) EndpointQualifier(com.hazelcast.instance.EndpointQualifier) ParallelJVMTest(com.hazelcast.test.annotation.ParallelJVMTest) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test)

Example 22 with EndpointQualifier

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;
}
Also used : EndpointQualifier(com.hazelcast.instance.EndpointQualifier)

Aggregations

EndpointQualifier (com.hazelcast.instance.EndpointQualifier)22 Address (com.hazelcast.cluster.Address)9 ParallelJVMTest (com.hazelcast.test.annotation.ParallelJVMTest)9 QuickTest (com.hazelcast.test.annotation.QuickTest)9 Test (org.junit.Test)9 EndpointConfig (com.hazelcast.config.EndpointConfig)5 HashMap (java.util.HashMap)5 UUID (java.util.UUID)5 MemberImpl (com.hazelcast.cluster.impl.MemberImpl)3 ProtocolType (com.hazelcast.instance.ProtocolType)3 MemberInfo (com.hazelcast.internal.cluster.MemberInfo)3 ClientEndPointDTO (com.hazelcast.internal.management.dto.ClientEndPointDTO)3 Map (java.util.Map)3 AdvancedNetworkConfig (com.hazelcast.config.AdvancedNetworkConfig)2 ServerSocketEndpointConfig (com.hazelcast.config.ServerSocketEndpointConfig)2 ClusterHotRestartStatusDTO (com.hazelcast.internal.management.dto.ClusterHotRestartStatusDTO)2 MemberVersion (com.hazelcast.version.MemberVersion)2 Version (com.hazelcast.version.Version)2 InetSocketAddress (java.net.InetSocketAddress)2 ConcurrentHashMap (java.util.concurrent.ConcurrentHashMap)2