use of com.hazelcast.instance.impl.Node in project hazelcast by hazelcast.
the class PhoneHomeClientsTest method testMultipleClients_withMultipleMembers_whenTheClientsAreShutdown.
@Test
@Category(SlowTest.class)
public void testMultipleClients_withMultipleMembers_whenTheClientsAreShutdown() throws IOException {
HazelcastInstance instance = factory.newHazelcastInstance(smallInstanceConfig());
Node node1 = getNode(instance);
addClientListener(node);
addClientListener(node1);
TestUtil.DummyClient client = clientFactory.newClient(getClientType(), "4.0.1");
TestUtil.DummyClient client1 = clientFactory.newClient(getClientType(), "4.1");
TestUtil.DummyConnection connection = client.connectTo(node);
TestUtil.DummyConnection connection1 = client.connectTo(node1);
TestUtil.DummyConnection connection2 = client1.connectTo(node);
TestUtil.DummyConnection connection3 = client1.connectTo(node1);
sleepAtLeastMillis(110);
connection.close();
connection1.close();
connection2.close();
connection3.close();
assertEqualsEventually(4, disconnectedClientCount);
assertParameters(node, 0, 2, 2, 2 * 110, "4.0.1", "4.1");
assertParameters(node1, 0, 2, 2, 2 * 110, "4.0.1", "4.1");
}
use of com.hazelcast.instance.impl.Node in project hazelcast by hazelcast.
the class PhoneHomeClientsTest method testSingleClient_withMultipleMembers_whenTheClientIsShutdown.
@Test
@Category(SlowTest.class)
public void testSingleClient_withMultipleMembers_whenTheClientIsShutdown() throws IOException {
HazelcastInstance instance = factory.newHazelcastInstance(smallInstanceConfig());
Node node1 = getNode(instance);
addClientListener(node);
addClientListener(node1);
TestUtil.DummyClient client = clientFactory.newClient(getClientType(), "v4.0");
TestUtil.DummyConnection connection = client.connectTo(node);
TestUtil.DummyConnection connection1 = client.connectTo(node1);
sleepAtLeastMillis(100);
connection.close();
connection1.close();
assertEqualsEventually(2, disconnectedClientCount);
assertParameters(node, 0, 1, 1, 100, "v4.0");
assertParameters(node1, 0, 1, 1, 100, "v4.0");
}
use of com.hazelcast.instance.impl.Node in project hazelcast by hazelcast.
the class PhoneHomeClientsTest method testMultipleClients_withMultipleMembers_whenTheClientsAreActive.
@Test
@Category(SlowTest.class)
public void testMultipleClients_withMultipleMembers_whenTheClientsAreActive() throws IOException {
HazelcastInstance instance = factory.newHazelcastInstance(smallInstanceConfig());
Node node1 = getNode(instance);
TestUtil.DummyClient client = clientFactory.newClient(getClientType(), "4.1");
TestUtil.DummyClient client1 = clientFactory.newClient(getClientType(), "4.1");
client.connectTo(node);
client.connectTo(node1);
client1.connectTo(node);
client1.connectTo(node1);
sleepAtLeastMillis(90);
assertParameters(node, 2, 2, 0, 2 * 90, "4.1");
assertParameters(node1, 2, 2, 0, 2 * 90, "4.1");
}
use of com.hazelcast.instance.impl.Node in project hazelcast by hazelcast.
the class PhoneHomeDifferentConfigTest method testTieredStorage.
@Test
public void testTieredStorage() {
MapConfig mapConfig = new MapConfig().setName("ts-map").setTieredStoreConfig(new TieredStoreConfig().setEnabled(true));
Config config = new Config().addMapConfig(mapConfig);
HazelcastInstance hazelcastInstance = createHazelcastInstance(config);
Node node = getNode(hazelcastInstance);
PhoneHome phoneHome = new PhoneHome(node);
Map<String, String> parameters = phoneHome.phoneHome(true);
assertThat(parameters.get(PhoneHomeMetrics.TIERED_STORAGE_ENABLED.getRequestParameterName())).isEqualTo("true");
assertThat(parameters.get(PhoneHomeMetrics.HD_MEMORY_ENABLED.getRequestParameterName())).isEqualTo("false");
}
use of com.hazelcast.instance.impl.Node in project hazelcast by hazelcast.
the class PhoneHomeDifferentConfigTest method testScheduling_whenPhoneHomeIsDisabled.
@Test
public void testScheduling_whenPhoneHomeIsDisabled() {
Config config = new Config().setProperty(ClusterProperty.PHONE_HOME_ENABLED.getName(), "false");
HazelcastInstance hz = createHazelcastInstance(config);
Node node = getNode(hz);
PhoneHome phoneHome = new PhoneHome(node);
phoneHome.check();
assertNull(phoneHome.phoneHomeFuture);
}
Aggregations