use of org.apache.geode.cache.query.internal.index.IndexProtocol in project geode by apache.
the class IndexCreationJUnitTest method testIndexCreation.
@Test
public void testIndexCreation() throws Exception {
QueryService qs;
qs = CacheUtils.getQueryService();
Index i1 = qs.createIndex("statusIndex", IndexType.FUNCTIONAL, "status", "/portfolios, positions");
// TASK ICM1
Index i2 = qs.createIndex("secIdIndex", IndexType.FUNCTIONAL, "b.secId", "/portfolios pf, pf.positions.values b");
// TASK ICM2
Index i5 = qs.createIndex("intFunctionIndex", IndexType.FUNCTIONAL, "intFunction(pf.getID)", "/portfolios pf, pf.positions b");
Index i6 = qs.createIndex("statusIndex6", IndexType.FUNCTIONAL, "a.status", "/portfolios.values.toArray a, positions");
Index i7 = qs.createIndex("statusIndex7", IndexType.FUNCTIONAL, "a.status", "/portfolios.getValues().asList() a, positions");
Index i8 = qs.createIndex("statusIndex8", IndexType.FUNCTIONAL, "a.status", "/portfolios.values.asSet a, positions");
// TASK ICM6
// remove any commented Index
Object[] indices = { i1, i2, i5, i6, i7, i8 };
for (int j = 0; j < indices.length; j++) {
CacheUtils.log(((IndexProtocol) indices[j]).isValid());
boolean r = ((IndexProtocol) indices[j]).isValid();
assertTrue("Test: testIndexCreation FAILED", r);
CacheUtils.log(((IndexProtocol) indices[j]).getName());
CacheUtils.log("Test: testIndexCreation PASS");
}
}
Aggregations