@Test public void check_second_number() throws Exception { assertThat(new CronExpression("3 * * * * *").nextTimeAfter(new DateTime(2012, 4, 10, 13, 01))).isEqualTo(new DateTime(2012, 4, 10, 13, 01, 03)); assertThat(new CronExpression("3 * * * * *").nextTimeAfter(new DateTime(2012, 4, 10, 13, 01, 03))).isEqualTo(new DateTime(2012, 4, 10, 13, 02, 03)); assertThat(new CronExpression("3 * * * * *").nextTimeAfter(new DateTime(2012, 4, 10, 13, 59, 03))).isEqualTo(new DateTime(2012, 4, 10, 14, 00, 03)); assertThat(new CronExpression("3 * * * * *").nextTimeAfter(new DateTime(2012, 4, 10, 23, 59, 03))).isEqualTo(new DateTime(2012, 4, 11, 00, 00, 03)); assertThat(new CronExpression("3 * * * * *").nextTimeAfter(new DateTime(2012, 4, 30, 23, 59, 03))).isEqualTo(new DateTime(2012, 5, 01, 00, 00, 03)); }
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();  }