Revisiting [MODE-2623] NodeNotFoundInParentException is thrown when unlocking a node within a transaction and assuming an "immediate write semantics" as regards locking I'm unable to assure that node is locked:
@Test
public void shouldLockNode() throws Exception {
Node node = session.getRootNode().addNode("test");
node.addMixin("mix:lockable");
session.save();
startTransaction();
JcrLockManager lockManager = session.getWorkspace().getLockManager();
Lock lock = lockManager.lock(node.getPath(), false, false, Long.MAX_VALUE, null);
assertTrue(node.isLocked());
commitTransaction();
}
Something wrong with this flow? Or it is another bug?
If the assertion fails on 5.2.0.Final, feel free to log another JIRA because it looks like a bug. Thanks.