use of org.guvnor.ala.pipeline.execution.PipelineExecutorTrace in project kie-wb-common by kiegroup.
the class VFSPipelineExecutorRegistryTest method testRegister.
@Test
@Override
public void testRegister() {
prepareTargetPath();
pipelineExecutorRegistry.register(trace);
try {
verify(registryHelper, times(1)).storeEntry(traceTargetPath, trace);
} catch (Exception e) {
// need to catch this exception because parent class method don't throws exceptions,
// but this will never happen in this scenario.
fail(e.getMessage());
}
PipelineExecutorTrace result = pipelineExecutorRegistry.getExecutorTrace(PIPELINE_EXECUTION_ID);
assertEquals(trace, result);
}
use of org.guvnor.ala.pipeline.execution.PipelineExecutorTrace in project kie-wb-common by kiegroup.
the class VFSPipelineExecutorRegistryTest method testDeregister.
@Test
@Override
public void testDeregister() {
prepareTargetPath();
pipelineExecutorRegistry.register(trace);
PipelineExecutorTrace result = pipelineExecutorRegistry.getExecutorTrace(PIPELINE_EXECUTION_ID);
assertEquals(trace, result);
pipelineExecutorRegistry.deregister(PIPELINE_EXECUTION_ID);
verify(registryHelper, times(1)).deleteBatch(traceTargetPath);
result = pipelineExecutorRegistry.getExecutorTrace(PIPELINE_EXECUTION_ID);
assertNull(result);
}
use of org.guvnor.ala.pipeline.execution.PipelineExecutorTrace in project kie-wb-common by kiegroup.
the class RestRuntimeProvisioningServiceImpl method destroyRuntime.
@Override
public void destroyRuntime(String runtimeId, boolean forced) throws BusinessException {
final Runtime runtimeById = runtimeRegistry.getRuntimeById(runtimeId);
if (runtimeById == null) {
throw new BusinessException("No runtime was found for runtimeId: " + runtimeId);
}
final PipelineExecutorTrace pipelineTrace = pipelineExecutorRegistry.getExecutorTrace(runtimeById);
try {
runtimeFactory.destroyRuntime(runtimeById);
} catch (Exception e) {
if (forced) {
LOG.warn("Runtime destroy raised the following error for runtime: " + runtimeId + " but forced destroy will still remove the runtime from registry.", e);
runtimeRegistry.deregisterRuntime(runtimeById);
} else {
throw e;
}
}
if (pipelineTrace != null) {
pipelineExecutorRegistry.deregister(pipelineTrace.getTaskId());
}
}
use of org.guvnor.ala.pipeline.execution.PipelineExecutorTrace in project kie-wb-common by kiegroup.
the class PipelineExecutorTaskManagerImplExecutionTest method testDeleteTaskInNonStopeableState.
private void testDeleteTaskInNonStopeableState(PipelineExecutorTask.Status nonStopeableStatus) throws Exception {
PipelineExecutorTask task = mock(PipelineExecutorTask.class);
when(task.getPipelineStatus()).thenReturn(nonStopeableStatus);
PipelineExecutorTrace trace = mock(PipelineExecutorTrace.class);
when(trace.getTask()).thenReturn(task);
when(pipelineExecutorRegistry.getExecutorTrace(TASK_ID)).thenReturn(trace);
expectedException.expectMessage(new StartsWith("A PipelineExecutorTask in status: " + nonStopeableStatus + " can not" + " be deleted. Delete operation is available for the following status set:"));
taskManager.delete(TASK_ID);
}
use of org.guvnor.ala.pipeline.execution.PipelineExecutorTrace in project kie-wb-common by kiegroup.
the class InMemoryPipelineExecutorRegistryTest method testGetExecutorTrace.
@Test
public void testGetExecutorTrace() {
pipelineExecutorRegistry.register(trace);
PipelineExecutorTrace result = pipelineExecutorRegistry.getExecutorTrace(PIPELINE_EXECUTION_ID);
assertEquals(trace, result);
}
Aggregations