Permalink
Browse files

fixes #98 Start Time of Day is not set correctly in DailyTimeInterval…

…TriggerPersistenceDelegate.GetTriggerProperties
  • Loading branch information...
1 parent 3c0a50c commit f5df0ae1865230ce446cf0bde3b39e8a2a72f561 @lahma lahma committed Feb 20, 2013
@@ -154,6 +154,22 @@ public void Test(IScheduler scheduler, bool clearJobs, bool scheduleJobs)
// GitHub issue #92
scheduler.GetTrigger(nt2.Key);
+ // GitHub issue #98
+ nt2.StartTimeOfDay = new TimeOfDay(1, 2, 3);
+ nt2.EndTimeOfDay = new TimeOfDay(2, 3, 4);
+
+ scheduler.UnscheduleJob(nt2.Key);
+ scheduler.ScheduleJob(nt2);
+
+ var triggerFromDb = (IDailyTimeIntervalTrigger) scheduler.GetTrigger(nt2.Key);
+ Assert.That(triggerFromDb.StartTimeOfDay.Hour, Is.EqualTo(1));
+ Assert.That(triggerFromDb.StartTimeOfDay.Minute, Is.EqualTo(2));
+ Assert.That(triggerFromDb.StartTimeOfDay.Second, Is.EqualTo(3));
+
+ Assert.That(triggerFromDb.EndTimeOfDay.Hour, Is.EqualTo(2));
+ Assert.That(triggerFromDb.EndTimeOfDay.Minute, Is.EqualTo(3));
+ Assert.That(triggerFromDb.EndTimeOfDay.Second, Is.EqualTo(4));
+
job.RequestsRecovery = (true);
CalendarIntervalTriggerImpl intervalTrigger = new CalendarIntervalTriggerImpl(
"calint_trig_" + count,
@@ -72,9 +72,9 @@ protected override SimplePropertiesTriggerProperties GetTriggerProperties(IOpera
TimeOfDay startTimeOfDay = dailyTrigger.StartTimeOfDay;
if (startTimeOfDay != null)
{
+ timeOfDayBuffer.Append(startTimeOfDay.Hour).Append(",");
timeOfDayBuffer.Append(startTimeOfDay.Minute).Append(",");
timeOfDayBuffer.Append(startTimeOfDay.Second).Append(",");
- timeOfDayBuffer.Append(startTimeOfDay.Hour).Append(",");
}
else
{

0 comments on commit f5df0ae

Please sign in to comment.