use of com.dangdang.ddframe.job.lite.api.listener.fixture.TestElasticJobListener in project elastic-job by dangdangdotcom.
the class LiteJobFacadeTest method setUp.
@Before
public void setUp() throws NoSuchFieldException {
MockitoAnnotations.initMocks(this);
liteJobFacade = new LiteJobFacade(null, "test_job", Collections.<ElasticJobListener>singletonList(new TestElasticJobListener(caller)), eventBus);
ReflectionUtils.setFieldValue(liteJobFacade, "configService", configService);
ReflectionUtils.setFieldValue(liteJobFacade, "serverService", serverService);
ReflectionUtils.setFieldValue(liteJobFacade, "shardingService", shardingService);
ReflectionUtils.setFieldValue(liteJobFacade, "executionContextService", executionContextService);
ReflectionUtils.setFieldValue(liteJobFacade, "executionService", executionService);
ReflectionUtils.setFieldValue(liteJobFacade, "failoverService", failoverService);
}
use of com.dangdang.ddframe.job.lite.api.listener.fixture.TestElasticJobListener 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)));
}
Aggregations