use of com.hazelcast.config.MapConfig in project hazelcast by hazelcast.
the class TestFullApplicationContext method testFullQueryCacheConfig.
@Test
public void testFullQueryCacheConfig() {
MapConfig mapConfig = config.getMapConfig("map-with-query-cache");
QueryCacheConfig queryCacheConfig = mapConfig.getQueryCacheConfigs().get(0);
EntryListenerConfig entryListenerConfig = queryCacheConfig.getEntryListenerConfigs().get(0);
assertTrue(entryListenerConfig.isIncludeValue());
assertFalse(entryListenerConfig.isLocal());
assertEquals("com.hazelcast.spring.DummyEntryListener", entryListenerConfig.getClassName());
assertFalse(queryCacheConfig.isIncludeValue());
assertEquals("my-query-cache-1", queryCacheConfig.getName());
assertEquals(12, queryCacheConfig.getBatchSize());
assertEquals(33, queryCacheConfig.getBufferSize());
assertEquals(12, queryCacheConfig.getDelaySeconds());
assertEquals(InMemoryFormat.OBJECT, queryCacheConfig.getInMemoryFormat());
assertTrue(queryCacheConfig.isCoalesce());
assertFalse(queryCacheConfig.isPopulate());
assertIndexesEqual(queryCacheConfig);
assertEquals("__key > 12", queryCacheConfig.getPredicateConfig().getSql());
assertEquals(EvictionPolicy.LRU, queryCacheConfig.getEvictionConfig().getEvictionPolicy());
assertEquals(EvictionConfig.MaxSizePolicy.ENTRY_COUNT, queryCacheConfig.getEvictionConfig().getMaximumSizePolicy());
assertEquals(111, queryCacheConfig.getEvictionConfig().getSize());
}
use of com.hazelcast.config.MapConfig in project hazelcast by hazelcast.
the class TestFullApplicationContext method testMapEvictionPolicyImpl.
@Test
public void testMapEvictionPolicyImpl() {
MapConfig mapConfig = config.getMapConfig("mapWithMapEvictionPolicyImpl");
assertEquals(DummyMapEvictionPolicy.class, mapConfig.getMapEvictionPolicy().getClass());
}
use of com.hazelcast.config.MapConfig in project hazelcast by hazelcast.
the class TestFullApplicationContext method testMapEvictionPolicyClassName.
@Test
public void testMapEvictionPolicyClassName() {
MapConfig mapConfig = config.getMapConfig("mapWithMapEvictionPolicyClassName");
String expectedComparatorClassName = "com.hazelcast.map.eviction.LRUEvictionPolicy";
assertEquals(expectedComparatorClassName, mapConfig.getMapEvictionPolicy().getClass().getName());
}
use of com.hazelcast.config.MapConfig in project hazelcast by hazelcast.
the class MapConfigRequestTest method setUp.
@Before
public void setUp() {
TestHazelcastInstanceFactory factory = createHazelcastInstanceFactory(2);
HazelcastInstance[] instances = factory.newInstances();
managementCenterService = getNode(instances[0]).getManagementCenterService();
mapName = randomMapName();
dto = new MapConfigDTO(new MapConfig("MapConfigRequestTest"));
}
use of com.hazelcast.config.MapConfig in project hazelcast by hazelcast.
the class MapConfigRequestTest method testGetMapConfig.
@Test
public void testGetMapConfig() {
MapConfigRequest request = new MapConfigRequest(mapName, dto, false);
JsonObject jsonObject = new JsonObject();
request.writeResponse(managementCenterService, jsonObject);
JsonObject result = (JsonObject) jsonObject.get("result");
MapConfig mapConfig = (MapConfig) request.readResponse(result);
assertNotNull(mapConfig);
assertEquals("default", mapConfig.getName());
}
Aggregations