-------------------------------------------------------------------------------- Testing 26 expressions... -------------------------------------------------------------------------------- Expression: [10,20,45 9,10,11,12 * * *] Ref-Time: [02.08.2010, 09:09:00] nextRun(): [02.08.2010, 09:10:00] Expected: [02.08.2010, 09:10:00] - passed! lastRun(): [01.08.2010, 12:45:00] Expected: [01.08.2010, 12:45:00] - passed! -------------------------------------------------------------------------------- Expression: [10,20,45 9,10,11,12 * * *] Ref-Time: [02.08.2010, 09:46:00] nextRun(): [02.08.2010, 10:10:00] Expected: [02.08.2010, 10:10:00] - passed! lastRun(): [02.08.2010, 09:45:00] Expected: [02.08.2010, 09:45:00] - passed! -------------------------------------------------------------------------------- Expression: [10,20,45 9,10,11,12 * * *] Ref-Time: [02.08.2010, 12:46:00] nextRun(): [03.08.2010, 09:10:00] Expected: [03.08.2010, 09:10:00] - passed! lastRun(): [02.08.2010, 12:45:00] Expected: [02.08.2010, 12:45:00] - passed! -------------------------------------------------------------------------------- Expression: [10,20,45 9,10,11,12 * * *] Ref-Time: [02.08.2010, 10:36:00] nextRun(): [02.08.2010, 10:45:00] Expected: [02.08.2010, 10:45:00] - passed! lastRun(): [02.08.2010, 10:20:00] Expected: [02.08.2010, 10:20:00] - passed! -------------------------------------------------------------------------------- Expression: [10,20,45 9,10,11,12 * * *] Ref-Time: [02.08.2010, 12:46:00] nextRun(): [03.08.2010, 09:10:00] Expected: [03.08.2010, 09:10:00] - passed! lastRun(): [02.08.2010, 12:45:00] Expected: [02.08.2010, 12:45:00] - passed! -------------------------------------------------------------------------------- Expression: [25 9,10,12 * * *] Ref-Time: [02.08.2010, 10:20:00] nextRun(): [02.08.2010, 10:25:00] Expected: [02.08.2010, 10:25:00] - passed! lastRun(): [02.08.2010, 09:25:00] Expected: [02.08.2010, 09:25:00] - passed! -------------------------------------------------------------------------------- Expression: [1,2,10-20,40-50/5 10,11,12 * * *] Ref-Time: [02.08.2010, 09:45:00] nextRun(): [02.08.2010, 10:01:00] Expected: [02.08.2010, 10:01:00] - passed! lastRun(): [01.08.2010, 12:50:00] Expected: [01.08.2010, 12:50:00] - passed! -------------------------------------------------------------------------------- Expression: [10,30,50 10,11,12 * * *] Ref-Time: [02.08.2010, 11:45:00] nextRun(): [02.08.2010, 11:50:00] Expected: [02.08.2010, 11:50:00] - passed! lastRun(): [02.08.2010, 11:30:00] Expected: [02.08.2010, 11:30:00] - passed! -------------------------------------------------------------------------------- Expression: [* * 29 2 *] Ref-Time: [02.08.2010, 11:45:00] nextRun(): [29.02.2012, 00:00:00] Expected: [29.02.2012, 00:00:00] - passed! lastRun(): [29.02.2008, 23:59:00] Expected: [29.02.2008, 23:59:00] - passed! -------------------------------------------------------------------------------- Expression: [* * * * *] Ref-Time: [02.08.2010, 11:45:00] nextRun(): [02.08.2010, 11:45:00] Expected: [02.08.2010, 11:45:00] - passed! lastRun(): [02.08.2010, 11:45:00] Expected: [02.08.2010, 11:45:00] - passed! -------------------------------------------------------------------------------- Expression: [* * 3 6 3] Ref-Time: [02.08.2010, 11:45:00] nextRun(): [03.06.2015, 00:00:00] Expected: [03.06.2015, 00:00:00] - passed! lastRun(): [03.06.2009, 23:59:00] Expected: [03.06.2009, 23:59:00] - passed! -------------------------------------------------------------------------------- Expression: [* * 3 Feb Sat] Ref-Time: [02.08.2010, 11:45:00] nextRun(): [03.02.2018, 00:00:00] Expected: [03.02.2018, 00:00:00] - passed! lastRun(): [03.02.2007, 23:59:00] Expected: [03.02.2007, 23:59:00] - passed! -------------------------------------------------------------------------------- Expression: [*/15 * * * *] Ref-Time: [02.08.2010, 11:40:00] nextRun(): [02.08.2010, 11:45:00] Expected: [02.08.2010, 11:45:00] - passed! lastRun(): [02.08.2010, 11:30:00] Expected: [02.08.2010, 11:30:00] - passed! -------------------------------------------------------------------------------- Expression: [*/15 * * * Fri,Tue] Ref-Time: [02.08.2010, 11:40:00] nextRun(): [03.08.2010, 00:00:00] Expected: [03.08.2010, 00:00:00] - passed! lastRun(): [30.07.2010, 23:45:00] Expected: [30.07.2010, 23:45:00] - passed! -------------------------------------------------------------------------------- Expression: [*/15 * 1 4 Fri,Tue] Ref-Time: [02.08.2010, 11:40:00] nextRun(): [01.04.2011, 00:00:00] Expected: [01.04.2011, 00:00:00] - passed! lastRun(): [01.04.2008, 23:45:00] Expected: [01.04.2008, 23:45:00] - passed! -------------------------------------------------------------------------------- Description: [Hours match, no more minutes -> next day] Expression: [10,20,45 9,10,11 * * *] Ref-Time: [01.02.2010, 11:50:00] nextRun(): [02.02.2010, 09:10:00] Expected: [02.02.2010, 09:10:00] - passed! -------------------------------------------------------------------------------- Description: [Hours match, no more minutes -> last day] Expression: [10,20,45 9,10,11 * * *] Ref-Time: [01.02.2010, 09:05:00] lastRun(): [31.01.2010, 11:45:00] Expected: [31.01.2010, 11:45:00] - passed! -------------------------------------------------------------------------------- Description: [Hours match, no more minutes -> next day -> LEAP YEAR] Expression: [10,20,45 9,10,11 * * *] Ref-Time: [28.02.2008, 11:50:00] nextRun(): [29.02.2008, 09:10:00] Expected: [29.02.2008, 09:10:00] - passed! -------------------------------------------------------------------------------- Description: [Hours match, no more minutes -> last day -> LEAP YEAR] Expression: [10,20,45 9,10,11 * * *] Ref-Time: [01.03.2008, 09:05:00] lastRun(): [29.02.2008, 11:45:00] Expected: [29.02.2008, 11:45:00] - passed! -------------------------------------------------------------------------------- Description: [Thursday before/after Feb. 1st 2010] Expression: [* * * * 4] Ref-Time: [01.02.2010, 11:50:00] nextRun(): [04.02.2010, 00:00:00] Expected: [04.02.2010, 00:00:00] - passed! lastRun(): [28.01.2010, 23:59:00] Expected: [28.01.2010, 23:59:00] - passed! -------------------------------------------------------------------------------- Description: [Tuesday before/after Jan. 1st 2010] Expression: [* * * * 2] Ref-Time: [01.01.2010, 11:50:00] nextRun(): [05.01.2010, 00:00:00] Expected: [05.01.2010, 00:00:00] - passed! lastRun(): [29.12.2009, 23:59:00] Expected: [29.12.2009, 23:59:00] - passed! -------------------------------------------------------------------------------- Description: [Hours match, no more minutes -> next day -> August] Expression: [10,20,45 9,10,11 * 8,9 *] Ref-Time: [01.02.2010, 11:50:00] nextRun(): [01.08.2010, 09:10:00] Expected: [01.08.2010, 09:10:00] - passed! -------------------------------------------------------------------------------- Description: [Hours match, no more minutes -> last day -> September] Expression: [10,20,45 9,10,11 * 8,9 *] Ref-Time: [01.02.2010, 11:50:00] lastRun(): [30.09.2009, 11:45:00] Expected: [30.09.2009, 11:45:00] - passed! -------------------------------------------------------------------------------- Description: [Last February, 29th - 11:45] Expression: [10,20,45 9,10,11 29 2 5] Ref-Time: [01.02.2010, 11:50:00] lastRun(): [29.02.2008, 11:45:00] Expected: [29.02.2008, 11:45:00] - passed! -------------------------------------------------------------------------------- Description: [Lets get wild with the cron-expression...] Expression: [7-20,3,1 5-8,12-20/3 1-10,13,15,20-30/2 March-Sep Wed-Friday] Ref-Time: [01.02.2010, 11:50:00] nextRun(): [03.03.2010, 05:01:00] Expected: [03.03.2010, 05:01:00] - passed! lastRun(): [30.09.2009, 18:20:00] Expected: [30.09.2009, 18:20:00] - passed! -------------------------------------------------------------------------------- Description: [Just a simple -> * * * * *] Expression: [* * * * *] Ref-Time: [01.02.2010, 11:50:00] nextRun(): [01.02.2010, 11:50:00] Expected: [01.02.2010, 11:50:00] - passed! lastRun(): [01.02.2010, 11:50:00] Expected: [01.02.2010, 11:50:00] - passed! -------------------------------------------------------------------------------- OK: 45 FAIL: 0