Fixed day offset for the while loop instead of only modifying the original value before passing it into the next day method.

This commit is contained in:
Mark Fisher
2008-10-09 02:27:18 +00:00
parent 9140cf0134
commit 977596272c
2 changed files with 6 additions and 6 deletions

View File

@@ -148,7 +148,7 @@ public class CronTriggerTests {
@Test
public void testIncrementDayOfWeekByOne() throws Exception {
CronTrigger trigger = new CronTrigger("* * * * * 2");
calendar.set(Calendar.DAY_OF_WEEK, 1);
calendar.set(Calendar.DAY_OF_WEEK, 2);
Date date = calendar.getTime();
calendar.add(Calendar.DAY_OF_WEEK, 1);
calendar.set(Calendar.HOUR_OF_DAY, 0);
@@ -160,7 +160,7 @@ public class CronTriggerTests {
@Test
public void testIncrementDayOfWeekAndRollover() throws Exception {
CronTrigger trigger = new CronTrigger("* * * * * 2");
calendar.set(Calendar.DAY_OF_WEEK, 3);
calendar.set(Calendar.DAY_OF_WEEK, 4);
Date date = calendar.getTime();
calendar.add(Calendar.DAY_OF_MONTH, 6);
calendar.set(Calendar.HOUR_OF_DAY, 0);