SchedulerHelper { public void scheduleJob(IbisManager ibisManager, JobDef jobdef) throws SchedulerException { JobDetail jobDetail = jobdef.getJobDetail(ibisManager); scheduleJob(jobDetail, jobdef.getCronExpression(), jobdef.getInterval(), true); }  void scheduleJob(IbisManager ibisManager, JobDef jobdef); void scheduleJob(JobDetail jobDetail, String cronExpression); void scheduleJob(JobDetail jobDetail, long interval); void scheduleJob(JobDetail jobDetail, String cronExpression, long interval, boolean overwrite); boolean contains(String name); boolean contains(String name, String group); Trigger getTrigger(String name); Trigger getTrigger(String name, String group); JobDetail getJobDetail(String jobName); JobDetail getJobDetail(String jobName, String jobGroup); void deleteTrigger(JobDef jobDef); void deleteTrigger(String jobName); void deleteTrigger(String name, String group); Scheduler getScheduler(); void setScheduler(Scheduler scheduler); void startScheduler(); static final String DEFAULT_GROUP; }
@Test(expected = SchedulerException.class) public void testScheduleDuplicateJob() throws SchedulerException, ParseException { JobDetail jobDetail = createServiceJob("testJob"+Math.random()); schedulerHelper.scheduleJob(jobDetail, "0 0 1 * * ?"); schedulerHelper.scheduleJob(jobDetail, 0); }