use of com.qlangtech.tis.fullbuild.indexbuild.IRemoteTaskTrigger in project tis by qlangtech.
the class TestDataXExecuteInterceptor method testExecuteWithGetRunningStatusFaild.
public void testExecuteWithGetRunningStatusFaild() throws Exception {
IRemoteTaskTrigger jobTrigger = mock("remoteJobTrigger", IRemoteTaskTrigger.class);
//
EasyMock.expect(jobTrigger.isAsyn()).andReturn(false);
jobTrigger.run();
// EasyMock.expectLastCall().andThrow(new RuntimeException("throw a exception"));
RunningStatus runningStatus = RunningStatus.FAILD;
EasyMock.expect(jobTrigger.getRunningStatus()).andReturn(runningStatus);
executeJobTrigger(jobTrigger, false);
}
use of com.qlangtech.tis.fullbuild.indexbuild.IRemoteTaskTrigger in project tis by qlangtech.
the class TestDataXExecuteInterceptor method testExecute.
public void testExecute() throws Exception {
DataxReader dataxReader = mock(AP_NAME + "DataXReader", DataxReader.class);
ISelectedTab tab = new TestSelectedTab(tableName);
EasyMock.expect(dataxReader.getSelectedTabs()).andReturn(Collections.singletonList(tab));
DataxReader.dataxReaderGetter = (name) -> {
return dataxReader;
};
BatchPostDataXWriter dataxWriter = new BatchPostDataXWriter(Collections.singletonList(dataCfgFileName));
DataxWriter.dataxWriterGetter = (name) -> {
// DataxWriter dataxWriter = mock(name + "DataXWriter", DataxWriter.class);
return dataxWriter;
};
IRemoteTaskTrigger jobTrigger = mock(dataCfgTaskName + "_" + IRemoteTaskTrigger.class.getSimpleName(), IRemoteTaskTrigger.class);
//
EasyMock.expect(jobTrigger.getTaskDependencies()).andReturn(Collections.emptyList()).anyTimes();
EasyMock.expect(jobTrigger.getTaskName()).andReturn(dataCfgFileName).anyTimes();
EasyMock.expect(jobTrigger.isAsyn()).andReturn(false).anyTimes();
jobTrigger.run();
// RunningStatus runningStatus = RunningStatus.SUCCESS;
// EasyMock.expect(jobTrigger.getRunningStatus()).andReturn(runningStatus);
executeJobTrigger(jobTrigger, true);
dataxWriter.verify();
}
Aggregations