Cache<Object, Object> indexedCache = cacheManager.getCache("indexingenabled");
useQuery(indexedCache);
}
private void useQuery(Cache<Object, Object> indexedCache) throws ParseException {
indexedCache.put("1", new Person("A Person's Name", "A paragraph containing some text", 75));
CacheQuery cq = TestQueryHelperFactory.createCacheQuery(indexedCache, "name", "Name");
assertEquals(1, cq.getResultSize());
List<Object> l = cq.list();
assertEquals(1, l.size());
Person p = (Person) l.get(0);
assertEquals("A Person's Name", p.getName());
assertEquals("A paragraph containing some text", p.getBlurb());
assertEquals(75, p.getAge());
SearchManager queryFactory = Search.getSearchManager(indexedCache);
SearchFactoryImplementor searchImpl = (SearchFactoryImplementor) queryFactory.getSearchFactory();
IndexManager[] indexManagers = searchImpl.getIndexBindingForEntity(Person.class).getIndexManagers();
assert indexManagers != null && indexManagers.length == 1;