Search in sources :

Example 21 with PartitionService

use of com.hazelcast.core.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());
}
Also used : Partition(com.hazelcast.core.Partition) PartitionService(com.hazelcast.core.PartitionService) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test) ParallelTest(com.hazelcast.test.annotation.ParallelTest)

Example 22 with PartitionService

use of com.hazelcast.core.PartitionService in project hazelcast by hazelcast.

the class PartitionServiceProxyTest method testAddMigrationListener.

@Test(expected = UnsupportedOperationException.class)
public void testAddMigrationListener() throws Exception {
    PartitionService p = client.getPartitionService();
    p.addMigrationListener(new DumMigrationListener());
}
Also used : PartitionService(com.hazelcast.core.PartitionService) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test) ParallelTest(com.hazelcast.test.annotation.ParallelTest)

Aggregations

PartitionService (com.hazelcast.core.PartitionService)22 ParallelTest (com.hazelcast.test.annotation.ParallelTest)17 QuickTest (com.hazelcast.test.annotation.QuickTest)17 Test (org.junit.Test)17 HazelcastInstance (com.hazelcast.core.HazelcastInstance)13 Partition (com.hazelcast.core.Partition)7 Member (com.hazelcast.core.Member)4 InternalPartitionService (com.hazelcast.internal.partition.InternalPartitionService)4 IPartition (com.hazelcast.spi.partition.IPartition)4 Cluster (com.hazelcast.core.Cluster)2 MigrationListener (com.hazelcast.core.MigrationListener)2 TestHazelcastInstanceFactory (com.hazelcast.test.TestHazelcastInstanceFactory)2 Config (com.hazelcast.config.Config)1 MigrationEvent (com.hazelcast.core.MigrationEvent)1 AssertTask (com.hazelcast.test.AssertTask)1