use of org.apache.jackrabbit.oak.plugins.document.RevisionVector in project jackrabbit-oak by apache.
the class UtilsTest method getMinTimestampForDiff.
@Test
public void getMinTimestampForDiff() {
RevisionVector from = new RevisionVector(new Revision(17, 0, 1));
RevisionVector to = new RevisionVector(new Revision(19, 0, 1));
assertEquals(17, Utils.getMinTimestampForDiff(from, to, new RevisionVector()));
assertEquals(17, Utils.getMinTimestampForDiff(to, from, new RevisionVector()));
RevisionVector minRevs = new RevisionVector(new Revision(7, 0, 1), new Revision(4, 0, 2));
assertEquals(17, Utils.getMinTimestampForDiff(from, to, minRevs));
assertEquals(17, Utils.getMinTimestampForDiff(to, from, minRevs));
to = to.update(new Revision(15, 0, 2));
// must return min revision of clusterId 2
assertEquals(4, Utils.getMinTimestampForDiff(from, to, minRevs));
assertEquals(4, Utils.getMinTimestampForDiff(to, from, minRevs));
}
Aggregations