use of com.hazelcast.core.HazelcastInstance in project hazelcast by hazelcast.
the class InternalPartitionServiceLiteMemberTest method test_partitionsNotAssigned_withLiteMember.
/**
* PARTITION ASSIGNMENT
**/
@Test
public void test_partitionsNotAssigned_withLiteMember() {
final TestHazelcastInstanceFactory factory = createHazelcastInstanceFactory(1);
final HazelcastInstance instance = factory.newHazelcastInstance(liteMemberConfig);
final InternalPartitionServiceImpl partitionService = getInternalPartitionServiceImpl(instance);
partitionService.firstArrangement();
for (int i = 0; i < partitionService.getPartitionCount(); i++) {
assertNull(partitionService.getPartition(i).getOwnerOrNull());
}
}
use of com.hazelcast.core.HazelcastInstance in project hazelcast by hazelcast.
the class InternalPartitionServiceLiteMemberTest method test_getPartitionOwner_onMasterLiteMember.
/**
* GET PARTITION OWNER
**/
@Test
public void test_getPartitionOwner_onMasterLiteMember() {
final TestHazelcastInstanceFactory factory = createHazelcastInstanceFactory(1);
final HazelcastInstance instance = factory.newHazelcastInstance(liteMemberConfig);
final InternalPartitionServiceImpl partitionService = getInternalPartitionServiceImpl(instance);
assertNull(partitionService.getPartitionOwner(0));
}
use of com.hazelcast.core.HazelcastInstance in project hazelcast by hazelcast.
the class InternalPartitionServiceLiteMemberTest method test_getPartitionOwnerOrWait_onMasterLiteMember.
@Test(expected = NoDataMemberInClusterException.class)
public void test_getPartitionOwnerOrWait_onMasterLiteMember() {
final TestHazelcastInstanceFactory factory = createHazelcastInstanceFactory(1);
final HazelcastInstance instance = factory.newHazelcastInstance(liteMemberConfig);
final InternalPartitionServiceImpl partitionService = getInternalPartitionServiceImpl(instance);
partitionService.getPartitionOwnerOrWait(0);
}
use of com.hazelcast.core.HazelcastInstance in project hazelcast by hazelcast.
the class InternalPartitionServiceLiteMemberTest method test_liteMemberCanTerminate_whenDataMemberExistsInCluster.
@Test(timeout = 120000)
public void test_liteMemberCanTerminate_whenDataMemberExistsInCluster() {
final TestHazelcastInstanceFactory factory = createHazelcastInstanceFactory(2);
final HazelcastInstance lite = factory.newHazelcastInstance(liteMemberConfig);
final HazelcastInstance other = factory.newHazelcastInstance();
warmUpPartitions(lite, other);
lite.getLifecycleService().terminate();
}
use of com.hazelcast.core.HazelcastInstance in project hazelcast by hazelcast.
the class InternalPartitionServiceLiteMemberTest method test_dataMemberCanTerminate_whenOnlyLiteMemberExistsInCluster.
@Test(timeout = 120000)
public void test_dataMemberCanTerminate_whenOnlyLiteMemberExistsInCluster() {
final TestHazelcastInstanceFactory factory = createHazelcastInstanceFactory(2);
final HazelcastInstance master = factory.newHazelcastInstance();
final HazelcastInstance lite = factory.newHazelcastInstance(liteMemberConfig);
warmUpPartitions(master, lite);
master.getLifecycleService().terminate();
}
Aggregations