Package org.qi4j.library.scheduler.timeline

Examples of org.qi4j.library.scheduler.timeline.Timeline


            atMost( sleepMillis + 5000, MILLISECONDS ).
            until( taskOutput( taskIdentity ), equalTo( BAR ) );

        try( UnitOfWork uow = module.newUnitOfWork( usecase ) )
        {
            Timeline timeline = module.findService( Timeline.class ).get();
            DateTime now = new DateTime();

            // Queries returning past records
            assertThat( count( timeline.getLastRecords( 5 ) ),
                        is( 2L ) );
            assertThat( count( timeline.getRecords( start.getMillis(), now.getMillis() ) ),
                        is( 2L ) );

            // Queries returning future records
            assertThat( count( timeline.getNextRecords( 4 ) ),
                        is( 4L ) );
            assertThat( count( timeline.getRecords( now.getMillis() + 100, now.plusMinutes( 5 ).getMillis() ) ),
                        is( 5L ) );

            // Queries returning mixed past and future records
            assertThat( count( timeline.getRecords( start.getMillis(), now.plusMinutes( 5 ).getMillis() ) ),
                        is( 7L ) );
        }
    }
View Full Code Here

TOP

Related Classes of org.qi4j.library.scheduler.timeline.Timeline

Copyright © 2018 www.massapicom. 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.