* </ul>
*
*/
@Test
public void testAsyncDoubleSubtree() throws Exception {
NodeStore store = new MemoryNodeStore();
ScheduledExecutorService executor = Executors.newScheduledThreadPool(0);
IndexEditorProvider provider = new PropertyIndexEditorProvider();
NodeStoreBranch branch = store.branch();
NodeState root = branch.getHead();
NodeBuilder builder = root.builder();
createIndexDefinition(builder.child(INDEX_DEFINITIONS_NAME),
"rootIndex", true, false, ImmutableSet.of("foo"), null)
.setProperty(ASYNC_PROPERTY_NAME, true);
createIndexDefinition(
builder.child("newchild").child("other")
.child(INDEX_DEFINITIONS_NAME), "subIndex", true,
false, ImmutableSet.of("foo"), null).setProperty(
ASYNC_PROPERTY_NAME, true);
builder.child("testRoot").setProperty("foo", "abc");
builder.child("newchild").child("other").child("testChild")
.setProperty("foo", "xyz");
// merge it back in
branch.setRoot(builder.getNodeState());
branch.merge(EmptyHook.INSTANCE);
AsyncIndexUpdate async = new AsyncIndexUpdate(store, executor, provider);
runIndexing(async, 1);
root = store.getRoot();
// first check that the index content nodes exist
checkPathExists(root, INDEX_DEFINITIONS_NAME, "rootIndex",
INDEX_CONTENT_NODE_NAME);
checkPathExists(root, "newchild", "other", INDEX_DEFINITIONS_NAME,