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);
}
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);
}
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);
}
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);
}
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");
}
Aggregations