use of org.talend.designer.esb.runcontainer.ui.progress.CheckingBundlesProgress in project tesb-studio-se by Talend.
the class RunContainerProcessor method run.
@Override
public Process run(int statisticsPort, int tracePort, String watchParam, String log4jLevel, IProgressMonitor monitor, IProcessMessageManager processMessageManager) throws ProcessorException {
if (!RuntimeServerController.getInstance().isRunning()) {
try {
new StartRuntimeProgress(true).run(monitor);
new CheckingBundlesProgress().run(monitor);
} catch (Exception e) {
throw new ProcessorException(RunContainerMessages.getString("StartRuntimeAction.ErrorStart"), e);
}
}
if (RuntimeServerController.getInstance().isRunning()) {
RunESBRuntimeProcess esbRunContainerProcess = new RunESBRuntimeProcess(process, statisticsPort, tracePort, monitor);
esbRunContainerProcess.setMessageManager(processMessageManager);
try {
esbRunContainerProcess.start();
} catch (Exception e) {
throw new ProcessorException(e);
}
return esbRunContainerProcess;
} else {
throw new ProcessorException(RunContainerMessages.getString("StartRuntimeAction.ErrorStart"));
}
}
use of org.talend.designer.esb.runcontainer.ui.progress.CheckingBundlesProgress in project tesb-studio-se by Talend.
the class CheckingBundlesProgressTest method testRun.
/**
* Test method for
* {@link org.talend.designer.esb.runcontainer.ui.progress.CheckingBundlesProgress#run(org.eclipse.core.runtime.IProgressMonitor)}
* .
*
* @throws Exception
*/
@Test
public void testRun() throws Exception {
long[] bundles = new long[] { 1, 2, 3 };
IProgressMonitor monitor = new NullProgressMonitor();
monitor.beginTask("test", 1);
try {
CheckingBundlesProgress mock = Mockito.mock(CheckingBundlesProgress.class);
Mockito.when(mock.checkRunning()).thenReturn(true);
mock.run(monitor);
} catch (InvocationTargetException e) {
e.printStackTrace();
} catch (InterruptedException e) {
e.printStackTrace();
}
Assert.assertFalse(monitor.isCanceled());
}
Aggregations