Package org.drools.core.time

Examples of org.drools.core.time.Job


    @Test public void timerIsSetToJobTriggerTimeForExecution() {
        final Date triggerTime = new Date(1000);
        when( mockTrigger_1.hasNextFireTime() ).thenReturn(triggerTime, triggerTime, triggerTime, null);
        when( mockTrigger_1.nextFireTime() ).thenReturn(triggerTime);

        Job job = new Job() {
            public void execute(JobContext ctx) {
                // Even though the clock has been advanced to 5000, the job should run
                // with the time set its trigger time.
                assertThat(scheduler.getCurrentTime(), is(1000L));
            }
View Full Code Here


    @Test public void timerIsResetWhenJobThrowsExceptions() {
        final Date triggerTime = new Date(1000);
        when( mockTrigger_1.hasNextFireTime() ).thenReturn(triggerTime, triggerTime, triggerTime, null);
        when( mockTrigger_1.nextFireTime() ).thenReturn(triggerTime);

        Job job = new Job() {
            public void execute(JobContext ctx) {
                assertThat(scheduler.getCurrentTime(), is(1000L));
                throw new RuntimeException("for test");
            }
        };
View Full Code Here

TOP

Related Classes of org.drools.core.time.Job

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.