Package krati.retention.clock

Examples of krati.retention.clock.Clock.after()


        RandomClockFactory f = new RandomClockFactory(3);
       
        Clock c1 = f.next();
        Clock c2 = f.next();
        assertTrue(c1.before(c2));
        assertTrue(c2.after(c1));
       
        long[] scnValues = (long[])c1.values().clone();
        Clock c = new Clock(scnValues);
        assertTrue(c.compareTo(c1) == Occurred.EQUICONCURRENTLY);
        assertTrue(c1.compareTo(c) == Occurred.EQUICONCURRENTLY);
View Full Code Here


        assertTrue(c.compareTo(c1) == Occurred.EQUICONCURRENTLY);
        assertTrue(c1.compareTo(c) == Occurred.EQUICONCURRENTLY);
       
        scnValues[0] = scnValues[0] + 1;
        c = new Clock(scnValues);
        assertTrue(c.after(c1));
        assertTrue(c1.before(c));
       
        scnValues[1] = c.values()[1] - 1;
        c = new Clock(scnValues);
       
View Full Code Here

       
        // Add the second event
        clock = _randClockFactory.next();
        batch.put(new SimpleEvent<String>("Event." + clock, clock));
       
        assertTrue(clock.after(batch.getMinClock()));
        assertTrue(clock.compareTo(batch.getMaxClock()) == Occurred.EQUICONCURRENTLY);
        assertEquals(2, batch.getSize());
       
        do {
            clock = _randClockFactory.next();
View Full Code Here

       
        do {
            clock = _randClockFactory.next();
        } while(batch.put(new SimpleEvent<String>("Event." + clock, clock)));
       
        assertTrue(clock.after(batch.getMinClock()));
        assertTrue(clock.after(batch.getMaxClock()));
        assertEquals(capacity, batch.getSize());
       
        batch.setCompletionTime(System.currentTimeMillis() + 1);
        assertTrue(batch.getCreationTime() < batch.getCompletionTime());
View Full Code Here

        do {
            clock = _randClockFactory.next();
        } while(batch.put(new SimpleEvent<String>("Event." + clock, clock)));
       
        assertTrue(clock.after(batch.getMinClock()));
        assertTrue(clock.after(batch.getMaxClock()));
        assertEquals(capacity, batch.getSize());
       
        batch.setCompletionTime(System.currentTimeMillis() + 1);
        assertTrue(batch.getCreationTime() < batch.getCompletionTime());
       
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.