use of com.dangdang.ddframe.job.lite.api.listener.fixture.TestDistributeOnceElasticJobListener in project elastic-job by dangdangdotcom.
the class JobExecutorTest method assertNew.
@Test
public void assertNew() throws NoSuchFieldException {
TestDistributeOnceElasticJobListener testDistributeOnceElasticJobListener = new TestDistributeOnceElasticJobListener(caller);
assertNull(ReflectionUtils.getFieldValue(testDistributeOnceElasticJobListener, ReflectionUtils.getFieldWithName(AbstractDistributeOnceElasticJobListener.class, "guaranteeService", false)));
new JobExecutor(null, liteJobConfig, new TestElasticJobListener(caller), testDistributeOnceElasticJobListener);
assertNotNull(ReflectionUtils.getFieldValue(testDistributeOnceElasticJobListener, ReflectionUtils.getFieldWithName(AbstractDistributeOnceElasticJobListener.class, "guaranteeService", false)));
}
use of com.dangdang.ddframe.job.lite.api.listener.fixture.TestDistributeOnceElasticJobListener in project elastic-job by dangdangdotcom.
the class DistributeOnceElasticJobListenerTest method setUp.
@Before
public void setUp() throws NoSuchFieldException {
MockitoAnnotations.initMocks(this);
distributeOnceElasticJobListener = new TestDistributeOnceElasticJobListener(elasticJobListenerCaller);
ReflectionUtils.setFieldValue(distributeOnceElasticJobListener, ReflectionUtils.getFieldWithName(AbstractDistributeOnceElasticJobListener.class, "guaranteeService", false), guaranteeService);
ReflectionUtils.setFieldValue(distributeOnceElasticJobListener, ReflectionUtils.getFieldWithName(AbstractDistributeOnceElasticJobListener.class, "timeService", false), timeService);
Map<Integer, String> map = new HashMap<>(2, 1);
map.put(0, "");
map.put(1, "");
shardingContexts = new ShardingContexts("fake_task_id", "test_job", 10, "", map);
}
Aggregations