Search in sources :

Example 11 with PartitioningStrategy

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

the class PartitioningStrategyFactoryTest method whenPartitioningStrategyClassDefined_getPartitioningStrategy_returnsNewInstance.

@Test
public void whenPartitioningStrategyClassDefined_getPartitioningStrategy_returnsNewInstance() {
    PartitioningStrategyConfig cfg = new PartitioningStrategyConfig();
    cfg.setPartitioningStrategyClass("com.hazelcast.partition.strategy.StringPartitioningStrategy");
    PartitioningStrategy partitioningStrategy = partitioningStrategyFactory.getPartitioningStrategy(mapName, cfg);
    assertEquals(StringPartitioningStrategy.class, partitioningStrategy.getClass());
}
Also used : PartitioningStrategyConfig(com.hazelcast.config.PartitioningStrategyConfig) PartitioningStrategy(com.hazelcast.core.PartitioningStrategy) StringPartitioningStrategy(com.hazelcast.partition.strategy.StringPartitioningStrategy) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test) ParallelTest(com.hazelcast.test.annotation.ParallelTest)

Example 12 with PartitioningStrategy

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

the class PartitioningStrategyFactoryTest method whenPartitioningStrategyDefined_getPartitioningStrategy_returnsSameInstance.

@Test
public void whenPartitioningStrategyDefined_getPartitioningStrategy_returnsSameInstance() {
    PartitioningStrategy configuredPartitioningStrategy = new StringPartitioningStrategy();
    PartitioningStrategyConfig cfg = new PartitioningStrategyConfig(configuredPartitioningStrategy);
    PartitioningStrategy partitioningStrategy = partitioningStrategyFactory.getPartitioningStrategy(mapName, cfg);
    assertSame(configuredPartitioningStrategy, partitioningStrategy);
}
Also used : PartitioningStrategyConfig(com.hazelcast.config.PartitioningStrategyConfig) StringPartitioningStrategy(com.hazelcast.partition.strategy.StringPartitioningStrategy) PartitioningStrategy(com.hazelcast.core.PartitioningStrategy) StringPartitioningStrategy(com.hazelcast.partition.strategy.StringPartitioningStrategy) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test) ParallelTest(com.hazelcast.test.annotation.ParallelTest)

Aggregations

PartitioningStrategy (com.hazelcast.core.PartitioningStrategy)12 StringPartitioningStrategy (com.hazelcast.partition.strategy.StringPartitioningStrategy)6 QuickTest (com.hazelcast.test.annotation.QuickTest)6 Test (org.junit.Test)6 PartitioningStrategyConfig (com.hazelcast.config.PartitioningStrategyConfig)5 ParallelTest (com.hazelcast.test.annotation.ParallelTest)5 DefaultSerializationServiceBuilder (com.hazelcast.internal.serialization.impl.DefaultSerializationServiceBuilder)4 Config (com.hazelcast.config.Config)2 MapConfig (com.hazelcast.config.MapConfig)2 SerializationConfig (com.hazelcast.config.SerializationConfig)2 InternalSerializationService (com.hazelcast.internal.serialization.InternalSerializationService)2 SerializationServiceBuilder (com.hazelcast.internal.serialization.SerializationServiceBuilder)2 DefaultPartitioningStrategy (com.hazelcast.partition.strategy.DefaultPartitioningStrategy)2 ClientConfig (com.hazelcast.client.config.ClientConfig)1 MapStoreConfig (com.hazelcast.config.MapStoreConfig)1 HazelcastInstance (com.hazelcast.core.HazelcastInstance)1 VersionMismatchException (com.hazelcast.internal.cluster.impl.VersionMismatchException)1 HeapData (com.hazelcast.internal.serialization.impl.HeapData)1 SerializationUtil.isNullData (com.hazelcast.internal.serialization.impl.SerializationUtil.isNullData)1 MapServiceContext (com.hazelcast.map.impl.MapServiceContext)1