Closed

Description
This is probably due to me using the wrong trigger type, but if you only have one execution per day of a DailyTimeIntervalTrigger it fails with a message like: "StartTimeOfDay TimeOfDay[11:11:0] should not come after endTimeOfDay TimeOfDay[11:11:0]"
The problem appears to result from line 345 and 346 in DailyTimeIntervalScheduleBuilder
long incrementInMillis = (count - 1) * intervalInMillis;
Date endTimeOfDayDate = new Date(startTimeOfDayDate.getTime() + incrementInMillis);
These two lines set the start time equal to the end time which then blows up in DailyTimeIntervalTriggerImpl on line 857 which throws an exception if the start time is not before the end time.
DailyTimeIntervalTrigger trigger = newTrigger()
.withIdentity("trigger1", "group1")
.startAt(startDay)
.withSchedule(dailyTimeIntervalSchedule()
.onDaysOfTheWeek(Calendar.MONDAY)
.startingDailyAt(start)
.endingDailyAfterCount(1)
.withRepeatCount(2))
.build();
The exception stack trace is:
org.quartz.SchedulerException: StartTimeOfDay TimeOfDay[11:11:0] should not come after endTimeOfDay TimeOfDay[11:11:0]
at org.quartz.impl.triggers.DailyTimeIntervalTriggerImpl.validate(DailyTimeIntervalTriggerImpl.java:858)
at org.quartz.core.QuartzScheduler.scheduleJob(QuartzScheduler.java:842)
at org.quartz.impl.StdScheduler.scheduleJob(StdScheduler.java:249)
at calpers.ais.sample.quartz.calendar.SimpleQuartzTest.scheduledJobForSaturdayShouldRunMonday(SimpleQuartzTest.java:80)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:538)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:760)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:460)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:206)
Metadata
Metadata
Assignees
Labels
No labels
Activity