SolrIndexLookup { Collection<String> collectIndexNodePaths(Filter filter) { return collectIndexNodePaths(filter, true); } SolrIndexLookup(NodeState root);   }
@Test public void collectPathOnRootNode() throws Exception { NodeBuilder index = builder.child(INDEX_DEFINITIONS_NAME); newSolrIndexDefinition(index, "l1", of("foo")); newSolrIndexDefinition(index, "l2", of("foo")); SolrIndexLookup lookup = new SolrIndexLookup(builder.getNodeState()); FilterImpl f = FilterImpl.newTestInstance(); f.restrictPath("/", Filter.PathRestriction.EXACT); assertEquals(of("/oak:index/l1", "/oak:index/l2"), lookup.collectIndexNodePaths(f)); }
@Test public void collectPathOnSubNode() throws Exception { NodeBuilder index = builder.child(INDEX_DEFINITIONS_NAME); newSolrIndexDefinition(index, "l1", of("foo")); index = builder.child("a").child(INDEX_DEFINITIONS_NAME); newSolrIndexDefinition(index, "l2", of("foo")); index = builder.child("a").child("b").child(INDEX_DEFINITIONS_NAME); newSolrIndexDefinition(index, "l3", of("foo")); SolrIndexLookup lookup = new SolrIndexLookup(builder.getNodeState()); FilterImpl f = FilterImpl.newTestInstance(); f.restrictPath("/a", Filter.PathRestriction.EXACT); assertEquals(of("/oak:index/l1", "/a/oak:index/l2"), lookup.collectIndexNodePaths(f)); f.restrictPath("/a/b", Filter.PathRestriction.EXACT); assertEquals(of("/oak:index/l1", "/a/oak:index/l2", "/a/b/oak:index/l3"), lookup.collectIndexNodePaths(f)); }