use of com.hazelcast.config.PredicateConfig in project hazelcast by hazelcast.
the class QueryCacheIndexConfigTest method testIndexConfigIsRespected.
@Test
public void testIndexConfigIsRespected() {
IndexConfig indexConfig = IndexUtils.createTestIndexConfig(IndexType.SORTED, "field");
final Config config = new Config();
final MapConfig mapConfig = new MapConfig("map").addQueryCacheConfig(new QueryCacheConfig().setName("query-cache").setPredicateConfig(new PredicateConfig(Predicates.alwaysTrue())).addIndexConfig(indexConfig));
config.addMapConfig(mapConfig);
final HazelcastInstance instance = createHazelcastInstance(config);
final IMap<Object, Object> map = instance.getMap("map");
final DefaultQueryCache<Object, Object> cache = (DefaultQueryCache<Object, Object>) map.getQueryCache("query-cache");
assertNotNull(cache.indexes.getIndex(indexConfig.getName()));
assertTrue(cache.indexes.getIndex(indexConfig.getName()).isOrdered());
}
Aggregations