@Test public void check_hour_shall_run_23_times_in_DST_change_to_summertime() throws Exception { CronExpression cron = new CronExpression("0 0 * * * *"); DateTime start = new DateTime(2011, 03, 27, 0, 0, 0, 0); DateTime slutt = start.toLocalDate().plusDays(1).toDateTimeAtStartOfDay(); DateTime tid = start; assertThat(Hours.hoursBetween(start, slutt).getHours()).isEqualTo(23); int count=0; DateTime lastTime = tid; while(tid.isBefore(slutt)){ DateTime nextTime = cron.nextTimeAfter(tid); assertThat(nextTime.isAfter(lastTime)).isTrue(); lastTime = nextTime; tid = tid.plusHours(1); count++; } assertThat(count).isEqualTo(23); }
public DateTime nextTimeAfter(DateTime afterTime) { return nextTimeAfter(afterTime, afterTime.plusYears(4)); }
CronExpression { public DateTime nextTimeAfter(DateTime afterTime) { return nextTimeAfter(afterTime, afterTime.plusYears(4)); } }
CronExpression { public DateTime nextTimeAfter(DateTime afterTime) { return nextTimeAfter(afterTime, afterTime.plusYears(4)); } CronExpression(final String expr);  CronExpression(final String expr, final boolean withSeconds); }
CronExpression { public DateTime nextTimeAfter(DateTime 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); DateTime nextTimeAfter(DateTime afterTime); DateTime nextTimeAfter(DateTime afterTime, long durationInMillis); DateTime nextTimeAfter(DateTime afterTime, DateTime dateTimeBarrier); @Override String toString(); }
CronExpression { public DateTime nextTimeAfter(DateTime 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); DateTime nextTimeAfter(DateTime afterTime); DateTime nextTimeAfter(DateTime afterTime, long durationInMillis); DateTime nextTimeAfter(DateTime afterTime, DateTime dateTimeBarrier); @Override String toString();  }