*/
public class HighlanderFactoryTest extends DatabaseTestFixture {
@Test
public void testNewJob() throws SchedulerException, ParseException {
JobFactory hf = injector.getInstance(JobFactory.class);
assertNotNull(hf);
try {
hf.newJob(null, null);
fail("should've died with npe");
}
catch (NullPointerException npe) {
// Expected
}
String crontab = "0 0 12 * * ?";
JobDetail jd = newJob(TestJob.class)
.withIdentity("testjob", "group")
.build();
Trigger trigger = newTrigger()
.withIdentity("testjob", "group")
.withSchedule(cronSchedule(crontab))
.build();
TriggerFiredBundle tfb = new TriggerFiredBundle(jd, (OperableTrigger) trigger, null,
false, null, null, null, null);
Job j = hf.newJob(tfb, null);
assertNotNull(j);
}