Search in sources :

Example 6 with TestSimpleJobConfiguration

use of com.dangdang.ddframe.job.fixture.config.TestSimpleJobConfiguration in project elastic-job by dangdangdotcom.

the class JobExecutorFactoryTest method assertGetJobExecutorForSimpleJob.

@Test
public void assertGetJobExecutorForSimpleJob() {
    when(jobFacade.getShardingContexts()).thenReturn(new ShardingContexts("fake_task_id", "simple_test_job", 10, "", Collections.<Integer, String>emptyMap()));
    when(jobFacade.loadJobRootConfiguration(true)).thenReturn(new TestSimpleJobConfiguration());
    assertThat(JobExecutorFactory.getJobExecutor(new TestSimpleJob(null), jobFacade), instanceOf(SimpleJobExecutor.class));
}
Also used : SimpleJobExecutor(com.dangdang.ddframe.job.executor.type.SimpleJobExecutor) TestSimpleJobConfiguration(com.dangdang.ddframe.job.fixture.config.TestSimpleJobConfiguration) TestSimpleJob(com.dangdang.ddframe.job.fixture.job.TestSimpleJob) Test(org.junit.Test)

Aggregations

TestSimpleJobConfiguration (com.dangdang.ddframe.job.fixture.config.TestSimpleJobConfiguration)6 Test (org.junit.Test)4 TestSimpleJob (com.dangdang.ddframe.job.fixture.job.TestSimpleJob)3 DefaultExecutorServiceHandler (com.dangdang.ddframe.job.executor.handler.impl.DefaultExecutorServiceHandler)2 Before (org.junit.Before)2 DefaultJobExceptionHandler (com.dangdang.ddframe.job.executor.handler.impl.DefaultJobExceptionHandler)1 SimpleJobExecutor (com.dangdang.ddframe.job.executor.type.SimpleJobExecutor)1 TestJobRootConfiguration (com.dangdang.ddframe.job.fixture.config.TestJobRootConfiguration)1 ThrowJobExceptionHandler (com.dangdang.ddframe.job.fixture.handler.ThrowJobExceptionHandler)1 OtherJob (com.dangdang.ddframe.job.fixture.job.OtherJob)1 TestWrongJob (com.dangdang.ddframe.job.fixture.job.TestWrongJob)1