Package org.apache.jackrabbit.oak.plugins.document.Revision

Examples of org.apache.jackrabbit.oak.plugins.document.Revision.RevisionComparator.compare()


        assertEquals(1, comp.compare(r0c1, r0c2));

        assertEquals(1, comp.compare(r1c1, r1c2));
        assertEquals(1, comp.compare(r2c1, r2c2));
        // both r3cx are still "in the future"
        assertEquals(-1, comp.compare(r3c1, r3c2));

        // now we declare r3 of c1 to be before r3 of c2
        // (with the same range timestamp,
        // the revision timestamps are compared)
        comp.add(r3c1, new Revision(0x30, 0, 0));
View Full Code Here


        assertEquals(
                "1:\n r120-0-1:r20-0-0 r130-0-1:r30-0-0\n" +
                "2:\n r200-0-2:r10-0-0 r300-0-2:r30-0-0\n", comp.toString());

        assertEquals(1, comp.compare(r1c1, r1c2));
        assertEquals(1, comp.compare(r2c1, r2c2));
        assertEquals(-1, comp.compare(r3c1, r3c2));
        // reverse
        assertEquals(-1, comp.compare(r1c2, r1c1));
        assertEquals(-1, comp.compare(r2c2, r2c1));
View Full Code Here

        assertEquals(
                "1:\n r120-0-1:r20-0-0 r130-0-1:r30-0-0\n" +
                "2:\n r200-0-2:r10-0-0 r300-0-2:r30-0-0\n", comp.toString());

        assertEquals(1, comp.compare(r1c1, r1c2));
        assertEquals(1, comp.compare(r2c1, r2c2));
        assertEquals(-1, comp.compare(r3c1, r3c2));
        // reverse
        assertEquals(-1, comp.compare(r1c2, r1c1));
        assertEquals(-1, comp.compare(r2c2, r2c1));
        assertEquals(1, comp.compare(r3c2, r3c1));
View Full Code Here

                "1:\n r120-0-1:r20-0-0 r130-0-1:r30-0-0\n" +
                "2:\n r200-0-2:r10-0-0 r300-0-2:r30-0-0\n", comp.toString());

        assertEquals(1, comp.compare(r1c1, r1c2));
        assertEquals(1, comp.compare(r2c1, r2c2));
        assertEquals(-1, comp.compare(r3c1, r3c2));
        // reverse
        assertEquals(-1, comp.compare(r1c2, r1c1));
        assertEquals(-1, comp.compare(r2c2, r2c1));
        assertEquals(1, comp.compare(r3c2, r3c1));
View Full Code Here

        assertEquals(1, comp.compare(r1c1, r1c2));
        assertEquals(1, comp.compare(r2c1, r2c2));
        assertEquals(-1, comp.compare(r3c1, r3c2));
        // reverse
        assertEquals(-1, comp.compare(r1c2, r1c1));
        assertEquals(-1, comp.compare(r2c2, r2c1));
        assertEquals(1, comp.compare(r3c2, r3c1));

        // get rid of old timestamps
        comp.purge(0x10);
View Full Code Here

        assertEquals(1, comp.compare(r1c1, r1c2));
        assertEquals(1, comp.compare(r2c1, r2c2));
        assertEquals(-1, comp.compare(r3c1, r3c2));
        // reverse
        assertEquals(-1, comp.compare(r1c2, r1c1));
        assertEquals(-1, comp.compare(r2c2, r2c1));
        assertEquals(1, comp.compare(r3c2, r3c1));

        // get rid of old timestamps
        comp.purge(0x10);
        assertEquals(
View Full Code Here

        assertEquals(1, comp.compare(r2c1, r2c2));
        assertEquals(-1, comp.compare(r3c1, r3c2));
        // reverse
        assertEquals(-1, comp.compare(r1c2, r1c1));
        assertEquals(-1, comp.compare(r2c2, r2c1));
        assertEquals(1, comp.compare(r3c2, r3c1));

        // get rid of old timestamps
        comp.purge(0x10);
        assertEquals(
                "1:\n r120-0-1:r20-0-0 r130-0-1:r30-0-0\n" +
View Full Code Here

        comp.add(r1c1, new Revision(0x10, 0, 0));
        comp.add(r2c1, new Revision(0x30, 0, 0));

        // there's no range for c2, and therefore this
        // revision must be considered to be in the future
        assertTrue(comp.compare(r1c2, r2c1) > 0);

        // add a range for r2r2
        comp.add(r2c2, new Revision(0x40, 0, 0));
        comp.purge(0x20);
View Full Code Here

        comp.add(r2c2, new Revision(0x40, 0, 0));
        comp.purge(0x20);

        // now there is a range for c2, but the revision is old (before purge
        // time, so it must be considered to be in the past
        assertTrue(comp.compare(r1c2, r2c1) < 0);
    }

    // OAK-1727
    @Test
    public void clusterCompare2() {
View Full Code Here

        Revision c2sync = Revision.fromString("r4-1-2");
        comp.add(c2sync,  Revision.fromString("r2-1-0"));
        Revision c3sync = Revision.fromString("r2-0-3");
        comp.add(c3sync, Revision.fromString("r2-1-0"));

        assertTrue(comp.compare(r1, r2) < 0);
        assertTrue(comp.compare(r2, c2sync) < 0);
        // same seen-at revision, but clusterId 2 < 3
        assertTrue(comp.compare(c2sync, c3sync) < 0);

        // this means, c3sync must be after r1 and r2
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.