root.commit();
QueryIndex index = new SolrQueryIndex("solr", server, configuration);
FilterImpl filter = new FilterImpl(mock(SelectorImpl.class), "");
filter.restrictPath("/somenode", Filter.PathRestriction.ALL_CHILDREN);
Cursor cursor = index.query(filter, store.getRoot());
assertNotNull(cursor);
assertTrue(cursor.hasNext());
assertEquals("/somenode/child1", cursor.next().getPath());
assertTrue(cursor.hasNext());
assertEquals("/somenode/child2/descendant", cursor.next().getPath());
assertTrue(cursor.hasNext());
assertEquals("/somenode/child2", cursor.next().getPath());
assertTrue(cursor.hasNext());
assertEquals("/somenode", cursor.next().getPath());
assertFalse(cursor.hasNext());
}