use of com.hazelcast.core.HazelcastInstance in project hazelcast by hazelcast.
the class InternalPartitionServiceLiteMemberTest method test_memberGroupSize_withSingleLiteMember.
/**
* MEMBER GROUP SIZE
**/
@Test
public void test_memberGroupSize_withSingleLiteMember() {
final TestHazelcastInstanceFactory factory = createHazelcastInstanceFactory(1);
final HazelcastInstance lite = factory.newHazelcastInstance(liteMemberConfig);
assertMemberGroupsSizeEventually(lite, 0);
}
use of com.hazelcast.core.HazelcastInstance in project hazelcast by hazelcast.
the class InternalPartitionServiceLiteMemberTest method test_liteMemberCanShutdownSafely_whenDataMemberExistsInCluster.
@Test(timeout = 120000)
public void test_liteMemberCanShutdownSafely_whenDataMemberExistsInCluster() {
final TestHazelcastInstanceFactory factory = createHazelcastInstanceFactory(2);
final HazelcastInstance lite = factory.newHazelcastInstance(liteMemberConfig);
final HazelcastInstance other = factory.newHazelcastInstance();
warmUpPartitions(lite, other);
lite.getLifecycleService().shutdown();
}
use of com.hazelcast.core.HazelcastInstance in project hazelcast by hazelcast.
the class InternalPartitionServiceLiteMemberTest method test_partitionsAreAssigned_afterDataMemberJoins.
@Test
public void test_partitionsAreAssigned_afterDataMemberJoins() {
final TestHazelcastInstanceFactory factory = createHazelcastInstanceFactory(2);
final HazelcastInstance liteInstance = factory.newHazelcastInstance(liteMemberConfig);
final InternalPartitionServiceImpl partitionService = getInternalPartitionServiceImpl(liteInstance);
partitionService.firstArrangement();
final HazelcastInstance dataInstance = factory.newHazelcastInstance();
warmUpPartitions(liteInstance, dataInstance);
for (int i = 0; i < partitionService.getPartitionCount(); i++) {
assertEquals(getNode(dataInstance).getThisAddress(), partitionService.getPartition(i).getOwnerOrNull());
}
}
use of com.hazelcast.core.HazelcastInstance in project hazelcast by hazelcast.
the class InternalPartitionServiceLiteMemberTest method test_liteMemberCanShutdownSafely_withClusterSize1.
/**
* GRACEFUL SHUTDOWN
**/
@Test(timeout = 120000)
public void test_liteMemberCanShutdownSafely_withClusterSize1() {
final TestHazelcastInstanceFactory factory = createHazelcastInstanceFactory(2);
final HazelcastInstance lite = factory.newHazelcastInstance(liteMemberConfig);
lite.getLifecycleService().shutdown();
}
use of com.hazelcast.core.HazelcastInstance in project hazelcast by hazelcast.
the class InternalPartitionServiceLiteMemberTest method test_getPartition_afterDataMemberLeavesTheCluster.
@Test
public void test_getPartition_afterDataMemberLeavesTheCluster() {
final TestHazelcastInstanceFactory factory = createHazelcastInstanceFactory(3);
final HazelcastInstance master = factory.newHazelcastInstance();
final HazelcastInstance dataInstance = factory.newHazelcastInstance();
final HazelcastInstance lite = factory.newHazelcastInstance(liteMemberConfig);
warmUpPartitions(lite);
dataInstance.getLifecycleService().shutdown();
for (HazelcastInstance instance : asList(master, lite)) {
final InternalPartitionServiceImpl partitionService = getInternalPartitionServiceImpl(instance);
assertTrueEventually(new AssertTask() {
@Override
public void run() throws Exception {
for (int i = 0; i < partitionService.getPartitionCount(); i++) {
assertEquals(getNode(master).getThisAddress(), partitionService.getPartition(i).getOwnerOrNull());
}
}
});
}
}
Aggregations