Search in sources :

Example 1 with MapConfigReadOnly

use of com.hazelcast.internal.config.MapConfigReadOnly in project hazelcast by hazelcast.

the class MapConfigReadOnlyTest method getNearCacheConfigOfReadOnlyMapConfigShouldReturnNullIfConfigIsNull.

@Test
public void getNearCacheConfigOfReadOnlyMapConfigShouldReturnNullIfConfigIsNull() {
    MapConfig config = new MapConfig().setNearCacheConfig(null);
    NearCacheConfig nearCacheConfig = new MapConfigReadOnly(config).getNearCacheConfig();
    assertNull(nearCacheConfig);
}
Also used : MapConfigReadOnly(com.hazelcast.internal.config.MapConfigReadOnly) ParallelJVMTest(com.hazelcast.test.annotation.ParallelJVMTest) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test)

Example 2 with MapConfigReadOnly

use of com.hazelcast.internal.config.MapConfigReadOnly in project hazelcast by hazelcast.

the class MapConfigReadOnlyTest method getQueryCacheConfigsOfReadOnlyMapConfigShouldReturnUnmodifiable.

@Test(expected = UnsupportedOperationException.class)
public void getQueryCacheConfigsOfReadOnlyMapConfigShouldReturnUnmodifiable() {
    MapConfig config = new MapConfig().addQueryCacheConfig(new QueryCacheConfig("myQueryCache1")).addQueryCacheConfig(new QueryCacheConfig("myQueryCache2"));
    List<QueryCacheConfig> queryCacheConfigs = new MapConfigReadOnly(config).getQueryCacheConfigs();
    queryCacheConfigs.add(new QueryCacheConfig("myQueryCache3"));
}
Also used : MapConfigReadOnly(com.hazelcast.internal.config.MapConfigReadOnly) ParallelJVMTest(com.hazelcast.test.annotation.ParallelJVMTest) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test)

Example 3 with MapConfigReadOnly

use of com.hazelcast.internal.config.MapConfigReadOnly in project hazelcast by hazelcast.

the class MapConfigReadOnlyTest method getNearCacheConfigOfReadOnlyMapConfigShouldReturnUnmodifiable.

@Test(expected = UnsupportedOperationException.class)
public void getNearCacheConfigOfReadOnlyMapConfigShouldReturnUnmodifiable() {
    MapConfig config = new MapConfig().setNearCacheConfig(new NearCacheConfig());
    NearCacheConfig nearCacheConfig = new MapConfigReadOnly(config).getNearCacheConfig();
    nearCacheConfig.setName("myNearCache");
}
Also used : MapConfigReadOnly(com.hazelcast.internal.config.MapConfigReadOnly) ParallelJVMTest(com.hazelcast.test.annotation.ParallelJVMTest) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test)

Example 4 with MapConfigReadOnly

use of com.hazelcast.internal.config.MapConfigReadOnly in project hazelcast by hazelcast.

the class MapConfigReadOnlyTest method getPartitioningStrategyConfigOfReadOnlyMapConfigShouldReturnNullIfConfigIsNull.

@Test
public void getPartitioningStrategyConfigOfReadOnlyMapConfigShouldReturnNullIfConfigIsNull() {
    MapConfig config = new MapConfig().setPartitioningStrategyConfig(null);
    PartitioningStrategyConfig partitioningStrategyConfig = new MapConfigReadOnly(config).getPartitioningStrategyConfig();
    assertNull(partitioningStrategyConfig);
}
Also used : MapConfigReadOnly(com.hazelcast.internal.config.MapConfigReadOnly) ParallelJVMTest(com.hazelcast.test.annotation.ParallelJVMTest) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test)

Example 5 with MapConfigReadOnly

use of com.hazelcast.internal.config.MapConfigReadOnly in project hazelcast by hazelcast.

the class MapConfigReadOnlyTest method getPartitioningStrategyConfigOfReadOnlyMapConfigShouldReturnUnmodifiable.

@Test(expected = UnsupportedOperationException.class)
public void getPartitioningStrategyConfigOfReadOnlyMapConfigShouldReturnUnmodifiable() {
    MapConfig config = new MapConfig().setPartitioningStrategyConfig(new PartitioningStrategyConfig());
    PartitioningStrategyConfig partitioningStrategyConfig = new MapConfigReadOnly(config).getPartitioningStrategyConfig();
    partitioningStrategyConfig.setPartitioningStrategy(null);
}
Also used : MapConfigReadOnly(com.hazelcast.internal.config.MapConfigReadOnly) ParallelJVMTest(com.hazelcast.test.annotation.ParallelJVMTest) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test)

Aggregations

MapConfigReadOnly (com.hazelcast.internal.config.MapConfigReadOnly)16 ParallelJVMTest (com.hazelcast.test.annotation.ParallelJVMTest)13 QuickTest (com.hazelcast.test.annotation.QuickTest)13 Test (org.junit.Test)13 EvictionConfig (com.hazelcast.config.EvictionConfig)2 MapConfig (com.hazelcast.config.MapConfig)2 MapContainer (com.hazelcast.map.impl.MapContainer)2 MapService (com.hazelcast.map.impl.MapService)2 IndexConfig (com.hazelcast.config.IndexConfig)1 MapServiceContext (com.hazelcast.map.impl.MapServiceContext)1 DiscardMergePolicy (com.hazelcast.spi.merge.DiscardMergePolicy)1 PutIfAbsentMergePolicy (com.hazelcast.spi.merge.PutIfAbsentMergePolicy)1