Package org.apache.jena.atlas.lib

Examples of org.apache.jena.atlas.lib.AlarmClock.cancel()


        AlarmClock alarmClock = new AlarmClock() ;
        assertEquals(0, alarmClock.getCount()) ;
        // Very long - never happens.
        Pingback<?> ping = alarmClock.add(callback, 10000000) ;
        assertEquals(1, alarmClock.getCount()) ;
        alarmClock.cancel(ping) ;
        assertEquals(0, alarmClock.getCount()) ;
    }
   
    @Test public void alarm_02()
    {
View Full Code Here


        Pingback<?> ping = alarmClock.add(callback, 10) ;
        sleep(100) ;
        assertEquals(0, alarmClock.getCount()) ;
       
        // try to cancel anyway.
        alarmClock.cancel(ping) ;
        assertEquals(0, alarmClock.getCount()) ;
    }

    @Test public void alarm_03()
    {
View Full Code Here

        Pingback<?> ping2 = alarmClock.add(callback, 100000) ;
        assertEquals(2, alarmClock.getCount()) ;
        sleep(200) ;
        // ping1 went off.
        assertEquals(1, alarmClock.getCount()) ;
        alarmClock.cancel(ping1) ;
        assertEquals(1, alarmClock.getCount()) ;
        alarmClock.cancel(ping2) ;
        assertEquals(0, alarmClock.getCount()) ;
    }
View Full Code Here

        sleep(200) ;
        // ping1 went off.
        assertEquals(1, alarmClock.getCount()) ;
        alarmClock.cancel(ping1) ;
        assertEquals(1, alarmClock.getCount()) ;
        alarmClock.cancel(ping2) ;
        assertEquals(0, alarmClock.getCount()) ;
    }

    @Test public void alarm_04()
    {
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.