use of org.apache.jackrabbit.oak.plugins.index.AsyncIndexInfoService in project jackrabbit-oak by apache.
the class LucenePropertyIndexTest method storedIndexDefinitionDiff.
@Test
public void storedIndexDefinitionDiff() throws Exception {
IndexDefinitionBuilder idxb = new IndexDefinitionBuilder().noAsync();
idxb.indexRule("nt:base").property("foo").propertyIndex();
Tree idx = root.getTree("/").getChild("oak:index").addChild("test1");
idxb.build(idx);
root.commit();
AsyncIndexInfoService asyncService = new AsyncIndexInfoServiceImpl(nodeStore);
LuceneIndexInfoProvider indexInfoProvider = new LuceneIndexInfoProvider(nodeStore, asyncService, temporaryFolder.newFolder());
IndexInfo info = indexInfoProvider.getInfo("/oak:index/test1");
assertNotNull(info);
assertFalse(info.hasIndexDefinitionChangedWithoutReindexing());
assertNull(info.getIndexDefinitionDiff());
Tree idxTree = root.getTree("/oak:index/test1");
idxTree.setProperty("foo", "bar");
root.commit();
info = indexInfoProvider.getInfo("/oak:index/test1");
assertTrue(info.hasIndexDefinitionChangedWithoutReindexing());
assertNotNull(info.getIndexDefinitionDiff());
}
Aggregations