use of org.guvnor.ala.ui.events.PipelineExecutionChangeEvent in project kie-wb-common by kiegroup.
the class ProviderPresenterTest method testPipelineExecutionDeletedRefreshRequired.
@Test
public void testPipelineExecutionDeletedRefreshRequired() {
// load the presenter.
prepareRuntimesInfo();
when(runtimeItems.isEmpty()).thenReturn(true);
presenter.onProviderSelected(new ProviderSelectedEvent(providerKey));
PipelineExecutionTraceKey pipelineExecutionTraceKey = mock(PipelineExecutionTraceKey.class);
when(providerStatusPresenter.removeItem(pipelineExecutionTraceKey)).thenReturn(true);
// the status presenter is empty after the removal.
when(providerStatusPresenter.isEmpty()).thenReturn(true);
presenter.onPipelineExecutionChange(new PipelineExecutionChangeEvent(PipelineExecutionChange.DELETED, pipelineExecutionTraceKey));
verify(providerStatusPresenter, times(1)).removeItem(pipelineExecutionTraceKey);
verify(presenter, times(1)).refresh();
}
use of org.guvnor.ala.ui.events.PipelineExecutionChangeEvent in project kie-wb-common by kiegroup.
the class RuntimeServiceImpl method stopPipelineExecution.
@Override
public void stopPipelineExecution(final PipelineExecutionTraceKey pipelineExecutionTraceKey) {
checkNotNull("pipelineExecutionTraceKey", pipelineExecutionTraceKey);
pipelineService.stopPipelineExecution(pipelineExecutionTraceKey.getId());
pipelineExecutionChangeEvent.fire(new PipelineExecutionChangeEvent(PipelineExecutionChange.STOPPED, pipelineExecutionTraceKey));
}
use of org.guvnor.ala.ui.events.PipelineExecutionChangeEvent in project kie-wb-common by kiegroup.
the class RuntimeServiceImplTest method testStopPipelineExecution.
@Test
public void testStopPipelineExecution() {
PipelineExecutionTraceKey pipelineExecutionTraceKey = new PipelineExecutionTraceKey(PIPELINE_EXECUTION_ID);
service.stopPipelineExecution(pipelineExecutionTraceKey);
verify(pipelineService, times(1)).stopPipelineExecution(PIPELINE_EXECUTION_ID);
verify(pipelineExecutionChangeEvent, times(1)).fire(new PipelineExecutionChangeEvent(PipelineExecutionChange.STOPPED, pipelineExecutionTraceKey));
}
use of org.guvnor.ala.ui.events.PipelineExecutionChangeEvent in project kie-wb-common by kiegroup.
the class ProviderPresenterTest method testPipelineExecutionDeleted.
@Test
public void testPipelineExecutionDeleted() {
// load the presenter.
prepareRuntimesInfo();
when(runtimeItems.isEmpty()).thenReturn(true);
presenter.onProviderSelected(new ProviderSelectedEvent(providerKey));
PipelineExecutionTraceKey pipelineExecutionTraceKey = mock(PipelineExecutionTraceKey.class);
when(providerStatusPresenter.removeItem(pipelineExecutionTraceKey)).thenReturn(true);
// the provider status presenter is not empty after the removal.
when(providerStatusPresenter.isEmpty()).thenReturn(false);
presenter.onPipelineExecutionChange(new PipelineExecutionChangeEvent(PipelineExecutionChange.DELETED, pipelineExecutionTraceKey));
verify(providerStatusPresenter, times(1)).removeItem(pipelineExecutionTraceKey);
}
use of org.guvnor.ala.ui.events.PipelineExecutionChangeEvent in project kie-wb-common by kiegroup.
the class RuntimePresenterActionsTest method testOnCurrentPipelineExecutionStopped.
@Test
public void testOnCurrentPipelineExecutionStopped() {
preparePipelineExecutionTraceSetup();
PipelineExecutionTraceKey currentKey = trace.getKey();
RuntimeListItem item = new RuntimeListItem(RUNTIME_NAME, trace);
presenter.setup(item);
presenter.onPipelineExecutionChange(new PipelineExecutionChangeEvent(PipelineExecutionChange.STOPPED, currentKey));
verify(presenter, times(1)).refresh(currentKey);
}
Aggregations