Search in sources :

Example 1 with TestDataflowJob

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

the class JobExecutorFactoryTest method assertGetJobExecutorForDataflowJob.

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

Example 2 with TestDataflowJob

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

the class DataflowJobExecutorTest method setUp.

private void setUp(final boolean isStreamingProcess, final ShardingContexts shardingContexts) {
    this.shardingContexts = shardingContexts;
    when(jobFacade.loadJobRootConfiguration(true)).thenReturn(new TestDataflowJobConfiguration(isStreamingProcess));
    when(jobFacade.getShardingContexts()).thenReturn(shardingContexts);
    dataflowJobExecutor = new DataflowJobExecutor(new TestDataflowJob(jobCaller), jobFacade);
    ElasticJobVerify.prepareForIsNotMisfire(jobFacade, shardingContexts);
}
Also used : TestDataflowJobConfiguration(com.dangdang.ddframe.job.fixture.config.TestDataflowJobConfiguration) TestDataflowJob(com.dangdang.ddframe.job.fixture.job.TestDataflowJob)

Aggregations

TestDataflowJobConfiguration (com.dangdang.ddframe.job.fixture.config.TestDataflowJobConfiguration)2 TestDataflowJob (com.dangdang.ddframe.job.fixture.job.TestDataflowJob)2 DataflowJobExecutor (com.dangdang.ddframe.job.executor.type.DataflowJobExecutor)1 Test (org.junit.Test)1