@Test public void check_hour_shall_run_25_times_in_DST_change_to_wintertime() throws Exception { CronExpression cron = new CronExpression("0 1 * * * *"); ZonedDateTime start = ZonedDateTime.of(2011, 10, 30, 0, 0, 0, 0, zoneId); ZonedDateTime slutt = start.plusDays(1); ZonedDateTime tid = start; int count = 0; ZonedDateTime lastTime = tid; while (tid.isBefore(slutt)) { ZonedDateTime nextTime = cron.nextTimeAfter(tid); assertTrue(nextTime.isAfter(lastTime)); lastTime = nextTime; tid = tid.plusHours(1); count++; } assertEquals(25, count); }
public ZonedDateTime nextTimeAfter(ZonedDateTime afterTime) { return nextTimeAfter(afterTime, afterTime.plusYears(4)); }
CronExpression { public ZonedDateTime nextTimeAfter(ZonedDateTime afterTime) { return nextTimeAfter(afterTime, afterTime.plusYears(4)); } }
CronExpression { public ZonedDateTime nextTimeAfter(ZonedDateTime afterTime) { return nextTimeAfter(afterTime, afterTime.plusYears(4)); } CronExpression(final String expr);  CronExpression(final String expr, final boolean withSeconds); }
CronExpression { public ZonedDateTime nextTimeAfter(ZonedDateTime afterTime) { return nextTimeAfter(afterTime, afterTime.plusYears(4)); } CronExpression(final String expr);  CronExpression(final String expr, final boolean withSeconds); static CronExpression create(final String expr); static CronExpression createWithoutSeconds(final String expr); ZonedDateTime nextTimeAfter(ZonedDateTime afterTime); LocalDateTime nextLocalDateTimeAfter(LocalDateTime dateTime); ZonedDateTime nextTimeAfter(ZonedDateTime afterTime, long durationInMillis); ZonedDateTime nextTimeAfter(ZonedDateTime afterTime, ZonedDateTime dateTimeBarrier); @Override String toString(); }
CronExpression { public ZonedDateTime nextTimeAfter(ZonedDateTime afterTime) { return nextTimeAfter(afterTime, afterTime.plusYears(4)); } CronExpression(final String expr);  CronExpression(final String expr, final boolean withSeconds); static CronExpression create(final String expr); static CronExpression createWithoutSeconds(final String expr); ZonedDateTime nextTimeAfter(ZonedDateTime afterTime); LocalDateTime nextLocalDateTimeAfter(LocalDateTime dateTime); ZonedDateTime nextTimeAfter(ZonedDateTime afterTime, long durationInMillis); ZonedDateTime nextTimeAfter(ZonedDateTime afterTime, ZonedDateTime dateTimeBarrier); @Override String toString();  }