use of com.dangdang.ddframe.job.executor.ShardingContexts in project elastic-job by dangdangdotcom.
the class LiteJobFacadeTest method assertRegisterJobCompletedWhenFailoverEnabled.
@Test
public void assertRegisterJobCompletedWhenFailoverEnabled() {
ShardingContexts shardingContexts = new ShardingContexts("fake_task_id", "test_job", 10, "", Collections.<Integer, String>emptyMap());
when(configService.load(true)).thenReturn(LiteJobConfiguration.newBuilder(new SimpleJobConfiguration(JobCoreConfiguration.newBuilder("test_job", "0/1 * * * * ?", 3).failover(true).build(), TestSimpleJob.class.getCanonicalName())).monitorExecution(true).build());
liteJobFacade.registerJobCompleted(shardingContexts);
verify(executionService).registerJobCompleted(shardingContexts);
verify(failoverService).updateFailoverComplete(shardingContexts.getShardingItemParameters().keySet());
}
use of com.dangdang.ddframe.job.executor.ShardingContexts in project elastic-job by dangdangdotcom.
the class LiteJobFacadeTest method assertRegisterJobBegin.
@Test
public void assertRegisterJobBegin() {
ShardingContexts shardingContexts = new ShardingContexts("fake_task_id", "test_job", 10, "", Collections.<Integer, String>emptyMap());
liteJobFacade.registerJobBegin(shardingContexts);
verify(executionService).registerJobBegin(shardingContexts);
}
use of com.dangdang.ddframe.job.executor.ShardingContexts in project elastic-job by dangdangdotcom.
the class LiteJobFacadeTest method assertRegisterJobCompletedWhenFailoverDisabled.
@Test
public void assertRegisterJobCompletedWhenFailoverDisabled() {
ShardingContexts shardingContexts = new ShardingContexts("fake_task_id", "test_job", 10, "", Collections.<Integer, String>emptyMap());
when(configService.load(true)).thenReturn(LiteJobConfiguration.newBuilder(new SimpleJobConfiguration(JobCoreConfiguration.newBuilder("test_job", "0/1 * * * * ?", 3).failover(false).build(), TestSimpleJob.class.getCanonicalName())).build());
liteJobFacade.registerJobCompleted(shardingContexts);
verify(executionService).registerJobCompleted(shardingContexts);
verify(failoverService, times(0)).updateFailoverComplete(shardingContexts.getShardingItemParameters().keySet());
}
Aggregations