use of com.hazelcast.partition.PartitionService in project hazelcast by hazelcast.
the class ClientMigrationListenerTest method testRemoveMigrationListener_whenNonExistingRegistrationId.
@Test
public void testRemoveMigrationListener_whenNonExistingRegistrationId() {
hazelcastFactory.newHazelcastInstance();
HazelcastInstance client = hazelcastFactory.newHazelcastClient();
PartitionService partitionService = client.getPartitionService();
boolean result = partitionService.removeMigrationListener(UuidUtil.newUnsecureUUID());
assertFalse(result);
}
use of com.hazelcast.partition.PartitionService in project hazelcast by hazelcast.
the class ClientMigrationListenerTest method testRemoveMigrationListener_whenNullListener.
@Test(expected = NullPointerException.class)
public void testRemoveMigrationListener_whenNullListener() {
hazelcastFactory.newHazelcastInstance();
HazelcastInstance client = hazelcastFactory.newHazelcastClient();
PartitionService partitionService = client.getPartitionService();
partitionService.removeMigrationListener(null);
}
use of com.hazelcast.partition.PartitionService in project hazelcast by hazelcast.
the class ClientMigrationListenerTest method testAddMigrationListener_whenListenerRegisteredTwice.
@Test
public void testAddMigrationListener_whenListenerRegisteredTwice() {
hazelcastFactory.newHazelcastInstance();
HazelcastInstance client = hazelcastFactory.newHazelcastClient();
PartitionService partitionService = client.getPartitionService();
MigrationListener listener = mock(MigrationListener.class);
UUID id1 = partitionService.addMigrationListener(listener);
UUID id2 = partitionService.addMigrationListener(listener);
assertNotEquals(id1, id2);
}
use of com.hazelcast.partition.PartitionService in project hazelcast by hazelcast.
the class PartitionServiceProxyTest method testGetPartition.
@Test
public void testGetPartition() {
String key = "Key";
PartitionService clientPartitionService = client.getPartitionService();
Partition clientPartition = clientPartitionService.getPartition(key);
PartitionService serverPartitionService = server.getPartitionService();
Partition serverPartition = serverPartitionService.getPartition(key);
assertEquals(clientPartition.getPartitionId(), serverPartition.getPartitionId());
}
use of com.hazelcast.partition.PartitionService in project hazelcast by hazelcast.
the class PartitionServiceProxyTest method testGetPartitions.
@Test
public void testGetPartitions() {
PartitionService clientPartitionService = client.getPartitionService();
Set<Partition> clientPartitions = clientPartitionService.getPartitions();
PartitionService serverPartitionService = server.getPartitionService();
Set<Partition> serverPartitions = serverPartitionService.getPartitions();
assertEquals(clientPartitions.size(), serverPartitions.size());
}
Aggregations