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());
}
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);
}
Aggregations