Search in sources :

Example 16 with JoinConfig

use of com.hazelcast.config.JoinConfig in project hazelcast by hazelcast.

the class TcpIpJoinTest method test_whenHostUnresolvable.

@Test
public void test_whenHostUnresolvable() {
    Config config = new Config();
    NetworkConfig networkConfig = config.getNetworkConfig();
    JoinConfig join = networkConfig.getJoin();
    join.getMulticastConfig().setEnabled(false);
    TcpIpConfig tcpIpConfig = join.getTcpIpConfig();
    tcpIpConfig.setEnabled(true);
    tcpIpConfig.addMember("localhost");
    tcpIpConfig.addMember("nonexistinghost");
    HazelcastInstance hz = Hazelcast.newHazelcastInstance(config);
    assertClusterSize(1, hz);
}
Also used : HazelcastInstance(com.hazelcast.core.HazelcastInstance) Config(com.hazelcast.config.Config) NetworkConfig(com.hazelcast.config.NetworkConfig) TcpIpConfig(com.hazelcast.config.TcpIpConfig) JoinConfig(com.hazelcast.config.JoinConfig) InterfacesConfig(com.hazelcast.config.InterfacesConfig) PartitionGroupConfig(com.hazelcast.config.PartitionGroupConfig) NetworkConfig(com.hazelcast.config.NetworkConfig) JoinConfig(com.hazelcast.config.JoinConfig) TcpIpConfig(com.hazelcast.config.TcpIpConfig) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test)

Example 17 with JoinConfig

use of com.hazelcast.config.JoinConfig in project hazelcast by hazelcast.

the class TcpIpJoinTest method test_whenHostAndInterfacesConfigured.

@Test
public void test_whenHostAndInterfacesConfigured() throws Exception {
    System.clearProperty("hazelcast.local.localAddress");
    final Config config = new Config();
    config.setProperty("hazelcast.socket.bind.any", "false");
    final NetworkConfig networkConfig = config.getNetworkConfig();
    networkConfig.setPort(5701).setPortAutoIncrement(true).getInterfaces().addInterface("127.0.0.1").setEnabled(true);
    final JoinConfig joinConfig = networkConfig.getJoin();
    joinConfig.getMulticastConfig().setEnabled(false);
    joinConfig.getAwsConfig().setEnabled(false);
    joinConfig.getTcpIpConfig().addMember("localhost:5701").addMember("localhost:5702").setEnabled(true);
    testJoin(config);
}
Also used : Config(com.hazelcast.config.Config) NetworkConfig(com.hazelcast.config.NetworkConfig) TcpIpConfig(com.hazelcast.config.TcpIpConfig) JoinConfig(com.hazelcast.config.JoinConfig) InterfacesConfig(com.hazelcast.config.InterfacesConfig) PartitionGroupConfig(com.hazelcast.config.PartitionGroupConfig) NetworkConfig(com.hazelcast.config.NetworkConfig) JoinConfig(com.hazelcast.config.JoinConfig) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test)

Example 18 with JoinConfig

use of com.hazelcast.config.JoinConfig in project hazelcast by hazelcast.

the class TcpIpJoinTest method test_whenExplicitPortConfigured.

@Test
public void test_whenExplicitPortConfigured() throws Exception {
    Config config = new Config();
    NetworkConfig networkConfig = config.getNetworkConfig();
    JoinConfig join = networkConfig.getJoin();
    join.getMulticastConfig().setEnabled(false);
    TcpIpConfig tcpIpConfig = join.getTcpIpConfig();
    tcpIpConfig.setEnabled(true);
    tcpIpConfig.addMember("127.0.0.1:5701");
    tcpIpConfig.addMember("127.0.0.1:5702");
    testJoin(config);
}
Also used : Config(com.hazelcast.config.Config) NetworkConfig(com.hazelcast.config.NetworkConfig) TcpIpConfig(com.hazelcast.config.TcpIpConfig) JoinConfig(com.hazelcast.config.JoinConfig) InterfacesConfig(com.hazelcast.config.InterfacesConfig) PartitionGroupConfig(com.hazelcast.config.PartitionGroupConfig) NetworkConfig(com.hazelcast.config.NetworkConfig) JoinConfig(com.hazelcast.config.JoinConfig) TcpIpConfig(com.hazelcast.config.TcpIpConfig) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test)

Example 19 with JoinConfig

use of com.hazelcast.config.JoinConfig in project hazelcast by hazelcast.

the class MemcacheTest method setup.

@Before
public void setup() throws Exception {
    config.setProperty(GroupProperty.MEMCACHE_ENABLED.getName(), "true");
    // Join is disabled intentionally. will start standalone HazelcastInstances.
    JoinConfig join = config.getNetworkConfig().getJoin();
    join.getMulticastConfig().setEnabled(false);
    join.getTcpIpConfig().setEnabled(false);
    instance = Hazelcast.newHazelcastInstance(config);
    client = getMemcacheClient(instance);
}
Also used : JoinConfig(com.hazelcast.config.JoinConfig) Before(org.junit.Before)

Example 20 with JoinConfig

use of com.hazelcast.config.JoinConfig in project hazelcast by hazelcast.

the class RestClusterTest method setup.

@Before
public void setup() {
    config.setProperty(GroupProperty.REST_ENABLED.getName(), "true");
    config.setProperty(GroupProperty.HTTP_HEALTHCHECK_ENABLED.getName(), "true");
    JoinConfig join = config.getNetworkConfig().getJoin();
    join.getMulticastConfig().setEnabled(false);
    join.getTcpIpConfig().setEnabled(true).clear().addMember("127.0.0.1");
}
Also used : JoinConfig(com.hazelcast.config.JoinConfig) Before(org.junit.Before)

Aggregations

JoinConfig (com.hazelcast.config.JoinConfig)37 Config (com.hazelcast.config.Config)28 Test (org.junit.Test)20 NetworkConfig (com.hazelcast.config.NetworkConfig)19 QuickTest (com.hazelcast.test.annotation.QuickTest)19 InterfacesConfig (com.hazelcast.config.InterfacesConfig)14 TcpIpConfig (com.hazelcast.config.TcpIpConfig)11 HazelcastInstance (com.hazelcast.core.HazelcastInstance)11 ListenerConfig (com.hazelcast.config.ListenerConfig)9 PartitionGroupConfig (com.hazelcast.config.PartitionGroupConfig)9 ClientConfig (com.hazelcast.client.config.ClientConfig)8 MulticastConfig (com.hazelcast.config.MulticastConfig)8 MemberAttributeConfig (com.hazelcast.config.MemberAttributeConfig)6 AwsConfig (com.hazelcast.config.AwsConfig)5 DiscoveryConfig (com.hazelcast.config.DiscoveryConfig)5 Member (com.hazelcast.core.Member)5 ParallelTest (com.hazelcast.test.annotation.ParallelTest)5 CountDownLatch (java.util.concurrent.CountDownLatch)5 DiscoveryStrategyConfig (com.hazelcast.config.DiscoveryStrategyConfig)4 MembershipListener (com.hazelcast.core.MembershipListener)4