use of com.hazelcast.config.QueryCacheConfig in project hazelcast by hazelcast.
the class XmlClientConfigBuilderTest method testQueryCacheFullConfig.
@Test
public void testQueryCacheFullConfig() throws Exception {
QueryCacheConfig queryCacheConfig = clientConfig.getQueryCacheConfigs().get("map-name").get("query-cache-name");
EntryListenerConfig entryListenerConfig = queryCacheConfig.getEntryListenerConfigs().get(0);
assertEquals("query-cache-name", queryCacheConfig.getName());
assertTrue(entryListenerConfig.isIncludeValue());
assertFalse(entryListenerConfig.isLocal());
assertEquals("com.hazelcast.examples.EntryListener", entryListenerConfig.getClassName());
assertTrue(queryCacheConfig.isIncludeValue());
assertEquals(1, queryCacheConfig.getBatchSize());
assertEquals(16, queryCacheConfig.getBufferSize());
assertEquals(0, queryCacheConfig.getDelaySeconds());
assertEquals(EvictionPolicy.LRU, queryCacheConfig.getEvictionConfig().getEvictionPolicy());
assertEquals(EvictionConfig.MaxSizePolicy.ENTRY_COUNT, queryCacheConfig.getEvictionConfig().getMaximumSizePolicy());
assertEquals(10000, queryCacheConfig.getEvictionConfig().getSize());
assertEquals(InMemoryFormat.BINARY, queryCacheConfig.getInMemoryFormat());
assertFalse(queryCacheConfig.isCoalesce());
assertTrue(queryCacheConfig.isPopulate());
for (MapIndexConfig mapIndexConfig : queryCacheConfig.getIndexConfigs()) {
assertEquals("name", mapIndexConfig.getAttribute());
assertFalse(mapIndexConfig.isOrdered());
}
assertEquals("com.hazelcast.examples.ExamplePredicate", queryCacheConfig.getPredicateConfig().getClassName());
}
Aggregations