@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()); Iterator<MapIndexConfig> iterator = queryCacheConfig.getIndexConfigs().iterator(); while (iterator.hasNext()) { MapIndexConfig mapIndexConfig = iterator.next(); assertEquals("name", mapIndexConfig.getAttribute()); assertFalse(mapIndexConfig.isOrdered()); } assertEquals( "com.hazelcast.examples.ExamplePredicate", queryCacheConfig.getPredicateConfig().getClassName()); }
private void assertIndexesEqual(QueryCacheConfig queryCacheConfig) { Iterator<MapIndexConfig> iterator = queryCacheConfig.getIndexConfigs().iterator(); while (iterator.hasNext()) { MapIndexConfig mapIndexConfig = iterator.next(); assertEquals("name", mapIndexConfig.getAttribute()); assertFalse(mapIndexConfig.isOrdered()); } }