Search in sources :

Example 1 with SimpleSchedulerQuartzJobBeanSetup

use of com.thinkbiganalytics.scheduler.SimpleSchedulerQuartzJobBeanSetup in project kylo by Teradata.

the class SimpleSchedulerQuartzJobBeanSetupTest method test.

@Test
public void test() throws Exception {
    SimpleSchedulerQuartzJobBeanSetup setup = new SimpleSchedulerQuartzJobBeanSetup();
    setup.setQuartzScheduler(scheduler);
    setup.setCronExpresson("cronExpression");
    setup.setDataMap(new HashMap<String, Object>());
    setup.setFireImmediately(false);
    setup.setGroupName("groupName");
    setup.setJobName("jobName");
    setup.setQuartzJobBean(MockJob.class.getCanonicalName());
    setup.scheduleMetadataJob();
    setup.setQuartzJobBean("ignore.error.TestMissingClass");
    setup.scheduleMetadataJob();
    Mockito.mock(QuartzScheduler.class, new Answer() {

        @Override
        public Object answer(InvocationOnMock invocationOnMock) throws Throwable {
            throw new JobSchedulerException();
        }
    });
}
Also used : SimpleSchedulerQuartzJobBeanSetup(com.thinkbiganalytics.scheduler.SimpleSchedulerQuartzJobBeanSetup) Answer(org.mockito.stubbing.Answer) JobSchedulerException(com.thinkbiganalytics.scheduler.JobSchedulerException) InvocationOnMock(org.mockito.invocation.InvocationOnMock) Test(org.junit.Test)

Aggregations

JobSchedulerException (com.thinkbiganalytics.scheduler.JobSchedulerException)1 SimpleSchedulerQuartzJobBeanSetup (com.thinkbiganalytics.scheduler.SimpleSchedulerQuartzJobBeanSetup)1 Test (org.junit.Test)1 InvocationOnMock (org.mockito.invocation.InvocationOnMock)1 Answer (org.mockito.stubbing.Answer)1