use of org.quartz.CronTrigger in project spring-framework by spring-projects.
the class CronTriggerFactoryBeanTests method createWithoutJobDetail.
@Test
public void createWithoutJobDetail() throws ParseException {
CronTriggerFactoryBean factory = new CronTriggerFactoryBean();
factory.setName("myTrigger");
factory.setCronExpression("0 15 10 ? * *");
factory.afterPropertiesSet();
CronTrigger trigger = factory.getObject();
assertEquals("0 15 10 ? * *", trigger.getCronExpression());
}
use of org.quartz.CronTrigger in project engine by craftercms.
the class FolderBasedScriptJobResolverTest method testResolveJobs.
@Test
public void testResolveJobs() throws Exception {
List<JobContext> jobContexts = resolver.resolveJobs(siteContext);
assertNotNull(jobContexts);
assertEquals(1, jobContexts.size());
JobDetailImpl jobDetail = (JobDetailImpl) jobContexts.get(0).getDetail();
CronTrigger trigger = (CronTrigger) jobContexts.get(0).getTrigger();
assertEquals(ScriptJob.class, jobDetail.getJobClass());
assertEquals("/scripts/jobs/testJob.groovy", jobDetail.getJobDataMap().getString(ScriptJob.SCRIPT_URL_DATA_KEY));
assertEquals(HOURLY_CRON_EXPRESSION, trigger.getCronExpression());
}
Aggregations