branch.setRoot(builder.getNodeState());
branch.merge();
}
private static void run(NodeStore store) throws CommitFailedException {
NodeStoreBranch branch = store.branch();
NodeBuilder builder = branch.getRoot().builder();
assertTrue("child node x should be present", builder.hasChildNode("x"));
assertTrue("child node x/y should be present", builder.child("x")
.hasChildNode("y"));
assertTrue("child node x/y/z should be present", builder.child("x")
.child("y").hasChildNode("z"));
builder.removeNode("x");
assertFalse("child node x not should be present",
builder.hasChildNode("x"));
assertFalse("child node x/y not should be present", builder.child("x")
.hasChildNode("y"));
// See OAK-531
assertFalse("child node x/y/z not should not be present", builder
.child("x").child("y").hasChildNode("z"));
branch.merge();
}