Search in sources :

Example 11 with PartitionService

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

the class PartitionServiceProxyTest method testRandomPartitionKeyNotNull.

@Test
public void testRandomPartitionKeyNotNull() {
    PartitionService p = client.getPartitionService();
    String key = p.randomPartitionKey();
    assertNotNull(key);
}
Also used : PartitionService(com.hazelcast.core.PartitionService) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test) ParallelTest(com.hazelcast.test.annotation.ParallelTest)

Example 12 with PartitionService

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

the class PartitionServiceProxyTest method testRemoveMigrationListener.

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

Example 13 with PartitionService

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

the class PartitionServiceProxyTest method testGetPartitions.

@Test
public void testGetPartitions() {
    String key = "Key";
    PartitionService clientPartitionService = client.getPartitionService();
    Set<Partition> clientPartitions = clientPartitionService.getPartitions();
    PartitionService serverPartitionService = server.getPartitionService();
    Set<Partition> serverPartitions = serverPartitionService.getPartitions();
    assertEquals(clientPartitions.size(), serverPartitions.size());
}
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 14 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 15 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