
|
If you were logged in you would be able to see more operations.
|
|
|
|
From maliling list:
When tracking down a bug in my code caused by the DailyCalendar
expecting Utc dates, I encountered a bug In SimpleTrigger's
ComputeFirstFireTimeUtc method using .NET Framework 2.0.
GetFireTimeAfter can return a null value, causing the "return
nextFireTimeUtc.Value" statement to throw an exception. I fixed this
by removing ".Value", and all tests pass so I guess this is a viable
fix?
Here's a test case which illustrates the problem. You probably want to
clean it up and change its name if you want to add it to your source -
I simply copied and adjusted the TestGetFireTimeAfter method:
[Test]
[ExpectedException(ExceptionType = typeof(SchedulerException))]
public void TestGetFireTimeAfterWithCalendar()
{
ISchedulerFactory sf = new Quartz.Impl.StdSchedulerFactory();
IScheduler sched = sf.GetScheduler();
DailyCalendar dailyCalendar = new DailyCalendar("1:20", "14:50");
SimpleTrigger simpleTrigger = new SimpleTrigger();
DateTime neverFireTime =
TriggerUtils.GetEvenMinuteDateBefore(dailyCalendar.GetTimeRangeStartingTime(DateTime.Now));
simpleTrigger.StartTimeUtc = neverFireTime;
simpleTrigger.RepeatInterval = 10;
simpleTrigger.RepeatCount = 4;
simpleTrigger.CalendarName = "test";
simpleTrigger.Name = "simpleTrigger";
sched.AddCalendar("test", dailyCalendar, true, true);
JobDetail job = new JobDetail("job1", "test",
typeof(SimpleTriggerTestJob));
sched.ScheduleJob(job, simpleTrigger);
NullableDateTime fireTimeAfter = sched.GetTriggersOfJob("job1",
"test")[0].GetNextFireTimeUtc();
Assert.IsNull(fireTimeAfter);
}
public class SimpleTriggerTestJob : IJob
{
public void Execute(JobExecutionContext context)
{
throw new NotImplementedException();
}
}
|
|
Description
|
From maliling list:
When tracking down a bug in my code caused by the DailyCalendar
expecting Utc dates, I encountered a bug In SimpleTrigger's
ComputeFirstFireTimeUtc method using .NET Framework 2.0.
GetFireTimeAfter can return a null value, causing the "return
nextFireTimeUtc.Value" statement to throw an exception. I fixed this
by removing ".Value", and all tests pass so I guess this is a viable
fix?
Here's a test case which illustrates the problem. You probably want to
clean it up and change its name if you want to add it to your source -
I simply copied and adjusted the TestGetFireTimeAfter method:
[Test]
[ExpectedException(ExceptionType = typeof(SchedulerException))]
public void TestGetFireTimeAfterWithCalendar()
{
ISchedulerFactory sf = new Quartz.Impl.StdSchedulerFactory();
IScheduler sched = sf.GetScheduler();
DailyCalendar dailyCalendar = new DailyCalendar("1:20", "14:50");
SimpleTrigger simpleTrigger = new SimpleTrigger();
DateTime neverFireTime =
TriggerUtils.GetEvenMinuteDateBefore(dailyCalendar.GetTimeRangeStartingTime(DateTime.Now));
simpleTrigger.StartTimeUtc = neverFireTime;
simpleTrigger.RepeatInterval = 10;
simpleTrigger.RepeatCount = 4;
simpleTrigger.CalendarName = "test";
simpleTrigger.Name = "simpleTrigger";
sched.AddCalendar("test", dailyCalendar, true, true);
JobDetail job = new JobDetail("job1", "test",
typeof(SimpleTriggerTestJob));
sched.ScheduleJob(job, simpleTrigger);
NullableDateTime fireTimeAfter = sched.GetTriggersOfJob("job1",
"test")[0].GetNextFireTimeUtc();
Assert.IsNull(fireTimeAfter);
}
public class SimpleTriggerTestJob : IJob
{
public void Execute(JobExecutionContext context)
{
throw new NotImplementedException();
}
} |
Show » |
| There are no comments yet on this issue.
|
|