use of org.apache.jackrabbit.oak.spi.commit.CommitHook in project jackrabbit-oak by apache.
the class NodeStoreTest method addExistingNodeJCRLastModified.
@Test
public void addExistingNodeJCRLastModified() throws CommitFailedException {
CommitHook hook = new CompositeHook(new ConflictHook(JcrConflictHandler.createJcrConflictHandler()), new EditorHook(new ConflictValidatorProvider()));
NodeBuilder b1 = store.getRoot().builder();
NodeBuilder b2 = store.getRoot().builder();
Calendar calendar = Calendar.getInstance();
b1.setChildNode("addExistingNodeJCRLastModified").setProperty(JCR_LASTMODIFIED, calendar);
calendar.add(Calendar.MINUTE, 1);
b2.setChildNode("addExistingNodeJCRLastModified").setProperty(JCR_LASTMODIFIED, calendar);
b1.setChildNode("conflict");
b2.setChildNode("conflict");
store.merge(b1, hook, CommitInfo.EMPTY);
store.merge(b2, hook, CommitInfo.EMPTY);
}
Aggregations