Once the scheduler is started, a task will be launched when the five parts in its scheduling pattern will be true at the same time.
However this does not seem to be enforced when using the built-in Cron4j definition:
Ex. Cron expression: 1 1 1 1 tue
Results from calling:
ExecutionTime
Mon Jan 01 01:01:00 EST 2018
Tue Jan 02 01:01:00 EST 2018
Tue Jan 09 01:01:00 EST 2018
Tue Jan 16 01:01:00 EST 2018
Cron4J predicts the following:
Tue Jan 01 01:01:00 EST 2019
Tue Jan 01 01:01:00 EST 2030
Tue Jan 01 01:01:00 EST 2036
Tue Jan 01 01:01:00 EST 2041
Test for ExecutionTimeCron4jIntegrationTest:
@Test
public void testDayOfMonthAndDayOfWeek() throws Exception {
ExecutionTime executionTime = ExecutionTime.forCron(cron4jCronParser.parse("0 0 1 * tue"));
ZonedDateTime next = ZonedDateTime.now();
for(int i = 0; i < 10; i++) {
next = executionTime.nextExecution(next).get();
assertEquals(DayOfWeek.TUESDAY, next.getDayOfWeek());
assertEquals(1, next.getDayOfMonth());
}
}
Release found: 6.0.1
The cron4j documentation states:
However this does not seem to be enforced when using the built-in Cron4j definition: Ex. Cron expression:
1 1 1 1 tue
Results from calling: ExecutionTimeCron4J predicts the following:
Test for ExecutionTimeCron4jIntegrationTest: