Search in sources :

Example 6 with IRemoteTaskTrigger

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);
}
Also used : RunningStatus(com.qlangtech.tis.fullbuild.indexbuild.RunningStatus) IRemoteTaskTrigger(com.qlangtech.tis.fullbuild.indexbuild.IRemoteTaskTrigger)

Example 7 with IRemoteTaskTrigger

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();
}
Also used : IRemoteTaskTrigger(com.qlangtech.tis.fullbuild.indexbuild.IRemoteTaskTrigger) ISelectedTab(com.qlangtech.tis.plugin.ds.ISelectedTab) DataxReader(com.qlangtech.tis.datax.impl.DataxReader)

Aggregations

IRemoteTaskTrigger (com.qlangtech.tis.fullbuild.indexbuild.IRemoteTaskTrigger)7 RunningStatus (com.qlangtech.tis.fullbuild.indexbuild.RunningStatus)5 DataXJobSubmit (com.qlangtech.tis.datax.DataXJobSubmit)3 IExecChainContext (com.qlangtech.tis.exec.IExecChainContext)3 ITISRpcService (com.tis.hadoop.rpc.ITISRpcService)3 RpcServiceReference (com.tis.hadoop.rpc.RpcServiceReference)3 File (java.io.File)3 AtomicReference (java.util.concurrent.atomic.AtomicReference)3 DataxProcessor (com.qlangtech.tis.datax.impl.DataxProcessor)2 DumpPhaseStatus (com.qlangtech.tis.fullbuild.phasestatus.impl.DumpPhaseStatus)2 IJoinTaskContext (com.qlangtech.tis.order.center.IJoinTaskContext)2 ISelectedTab (com.qlangtech.tis.plugin.ds.ISelectedTab)2 Lists (com.google.common.collect.Lists)1 Maps (com.google.common.collect.Maps)1 TisZkClient (com.qlangtech.tis.TisZkClient)1 FullbuildPhase (com.qlangtech.tis.assemble.FullbuildPhase)1 CuratorDataXTaskMessage (com.qlangtech.tis.datax.CuratorDataXTaskMessage)1 DataXJobSingleProcessorException (com.qlangtech.tis.datax.DataXJobSingleProcessorException)1 DataXJobSingleProcessorExecutor (com.qlangtech.tis.datax.DataXJobSingleProcessorExecutor)1 IDataXBatchPost (com.qlangtech.tis.datax.IDataXBatchPost)1