CronExpression implements Serializable, Cloneable { public Date getNextValidTimeAfter(Date date) { return getTimeAfter(date); } CronExpression(String cronExpression);  CronExpression(CronExpression expression); boolean isSatisfiedBy(Date date); Date getNextValidTimeAfter(Date date); Date getNextInvalidTimeAfter(Date date); TimeZone getTimeZone(); void setTimeZone(TimeZone timeZone); @Override String toString(); static boolean isValidExpression(String cronExpression); static void validateExpression(String cronExpression); String getCronExpression(); String getExpressionSummary(); Date getTimeAfter(Date afterTime); Date getTimeBefore(Date endTime); Date getFinalFireTime(); @Override @Deprecated Object clone(); static final int MAX_YEAR; }
@Test public void testQtz259() throws Exception { CronExpression cronExpression = new CronExpression("0 0 0 L-2 * ? *"); int i = 0; Date pdate = cronExpression.getNextValidTimeAfter(new Date()); while (++i < 26) { Date date = cronExpression.getNextValidTimeAfter(pdate); LOG.info("fireTime: " + date + ", previousFireTime: " + pdate); assertFalse(pdate.equals(date), "Next fire time is the same as previous fire time!"); pdate = date; } }
@Test public void testQtz259LW() throws Exception { CronExpression cronExpression = new CronExpression("0 0 0 LW * ? *"); int i = 0; Date pdate = cronExpression.getNextValidTimeAfter(new Date()); while (++i < 26) { Date date = cronExpression.getNextValidTimeAfter(pdate); LOG.info("fireTime: " + date + ", previousFireTime: " + pdate); assertFalse(pdate.equals(date), "Next fire time is the same as previous fire time!"); pdate = date; } }
@Test public void testQtz259() throws Exception { CronExpression cronExpression = new CronExpression("0 0 0 L-2 * ? *"); int i = 0; Date pdate = cronExpression.getNextValidTimeAfter(new Date()); while (++i < 26) { Date date = cronExpression.getNextValidTimeAfter(pdate); LOG.debug("fireTime: " + date + ", previousFireTime: " + pdate); assertFalse(pdate.equals(date), "Next fire time is the same as previous fire time!"); pdate = date; } }
@Test public void testQtz259LW() throws Exception { CronExpression cronExpression = new CronExpression("0 0 0 LW * ? *"); int i = 0; Date pdate = cronExpression.getNextValidTimeAfter(new Date()); while (++i < 26) { Date date = cronExpression.getNextValidTimeAfter(pdate); LOG.debug("fireTime: " + date + ", previousFireTime: " + pdate); assertFalse(pdate.equals(date), "Next fire time is the same as previous fire time!"); pdate = date; } }