use of com.hazelcast.internal.config.MapConfigReadOnly in project hazelcast by hazelcast.
the class MapConfigTest method testEqualsAndHashCode.
@Test
public void testEqualsAndHashCode() {
assumeDifferentHashCodes();
EqualsVerifier.forClass(MapConfig.class).suppress(Warning.NULL_FIELDS, Warning.NONFINAL_FIELDS).withPrefabValues(EvictionConfig.class, new EvictionConfig().setSize(300).setMaxSizePolicy(MaxSizePolicy.PER_PARTITION), new EvictionConfig().setSize(100).setMaxSizePolicy(MaxSizePolicy.PER_NODE)).withPrefabValues(MapStoreConfig.class, new MapStoreConfig().setEnabled(true).setClassName("red"), new MapStoreConfig().setEnabled(true).setClassName("black")).withPrefabValues(NearCacheConfig.class, new NearCacheConfig().setTimeToLiveSeconds(10).setMaxIdleSeconds(20).setInvalidateOnChange(false).setInMemoryFormat(InMemoryFormat.BINARY), new NearCacheConfig().setTimeToLiveSeconds(15).setMaxIdleSeconds(25).setInvalidateOnChange(true).setInMemoryFormat(InMemoryFormat.OBJECT)).withPrefabValues(WanReplicationRef.class, new WanReplicationRef().setName("red"), new WanReplicationRef().setName("black")).withPrefabValues(PartitioningStrategyConfig.class, new PartitioningStrategyConfig("red"), new PartitioningStrategyConfig("black")).withPrefabValues(MapConfigReadOnly.class, new MapConfigReadOnly(new MapConfig("red")), new MapConfigReadOnly(new MapConfig("black"))).withPrefabValues(MergePolicyConfig.class, new MergePolicyConfig(PutIfAbsentMergePolicy.class.getName(), 100), new MergePolicyConfig(DiscardMergePolicy.class.getName(), 200)).verify();
}
use of com.hazelcast.internal.config.MapConfigReadOnly in project hazelcast by hazelcast.
the class MapConfigReadOnlyTest method getEntryListenerConfigsOfReadOnlyMapConfigShouldReturnUnmodifiable.
@Test(expected = UnsupportedOperationException.class)
public void getEntryListenerConfigsOfReadOnlyMapConfigShouldReturnUnmodifiable() {
MapConfig config = new MapConfig().addEntryListenerConfig(new EntryListenerConfig()).addEntryListenerConfig(new EntryListenerConfig());
List<EntryListenerConfig> listenerConfigs = new MapConfigReadOnly(config).getEntryListenerConfigs();
listenerConfigs.add(new EntryListenerConfig());
}
use of com.hazelcast.internal.config.MapConfigReadOnly in project hazelcast by hazelcast.
the class MapConfigReadOnlyTest method getWanReplicationRefOfReadOnlyMapConfigShouldReturnNullIfWanReplicationRefIsNull.
@Test
public void getWanReplicationRefOfReadOnlyMapConfigShouldReturnNullIfWanReplicationRefIsNull() {
MapConfig config = new MapConfig().setWanReplicationRef(null);
WanReplicationRef wanReplicationRef = new MapConfigReadOnly(config).getWanReplicationRef();
assertNull(wanReplicationRef);
}
use of com.hazelcast.internal.config.MapConfigReadOnly in project hazelcast by hazelcast.
the class MapConfigReadOnlyTest method getMapStoreConfigOfReadOnlyMapConfigShouldReturnUnmodifiable.
@Test(expected = UnsupportedOperationException.class)
public void getMapStoreConfigOfReadOnlyMapConfigShouldReturnUnmodifiable() {
MapConfig config = new MapConfig().setMapStoreConfig(new MapStoreConfig());
MapStoreConfig mapStoreConfig = new MapConfigReadOnly(config).getMapStoreConfig();
mapStoreConfig.setEnabled(true);
}
use of com.hazelcast.internal.config.MapConfigReadOnly in project hazelcast by hazelcast.
the class MapConfigReadOnlyTest method getPartitionLostListenerConfigsOfReadOnlyMapConfigShouldReturnUnmodifiable.
@Test(expected = UnsupportedOperationException.class)
public void getPartitionLostListenerConfigsOfReadOnlyMapConfigShouldReturnUnmodifiable() {
MapConfig config = new MapConfig().addMapPartitionLostListenerConfig(new MapPartitionLostListenerConfig()).addMapPartitionLostListenerConfig(new MapPartitionLostListenerConfig());
List<MapPartitionLostListenerConfig> listenerConfigs = new MapConfigReadOnly(config).getPartitionLostListenerConfigs();
listenerConfigs.add(new MapPartitionLostListenerConfig());
}
Aggregations