Search in sources :

Example 1 with PipelineExecutionChangeEvent

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();
}
Also used : ProviderSelectedEvent(org.guvnor.ala.ui.client.events.ProviderSelectedEvent) PipelineExecutionChangeEvent(org.guvnor.ala.ui.events.PipelineExecutionChangeEvent) PipelineExecutionTraceKey(org.guvnor.ala.ui.model.PipelineExecutionTraceKey) Test(org.junit.Test)

Example 2 with PipelineExecutionChangeEvent

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));
}
Also used : PipelineExecutionChangeEvent(org.guvnor.ala.ui.events.PipelineExecutionChangeEvent)

Example 3 with PipelineExecutionChangeEvent

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));
}
Also used : PipelineExecutionChangeEvent(org.guvnor.ala.ui.events.PipelineExecutionChangeEvent) PipelineExecutionTraceKey(org.guvnor.ala.ui.model.PipelineExecutionTraceKey) Test(org.junit.Test)

Example 4 with PipelineExecutionChangeEvent

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);
}
Also used : ProviderSelectedEvent(org.guvnor.ala.ui.client.events.ProviderSelectedEvent) PipelineExecutionChangeEvent(org.guvnor.ala.ui.events.PipelineExecutionChangeEvent) PipelineExecutionTraceKey(org.guvnor.ala.ui.model.PipelineExecutionTraceKey) Test(org.junit.Test)

Example 5 with PipelineExecutionChangeEvent

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);
}
Also used : RuntimeListItem(org.guvnor.ala.ui.model.RuntimeListItem) PipelineExecutionChangeEvent(org.guvnor.ala.ui.events.PipelineExecutionChangeEvent) PipelineExecutionTraceKey(org.guvnor.ala.ui.model.PipelineExecutionTraceKey) Test(org.junit.Test)

Aggregations

PipelineExecutionChangeEvent (org.guvnor.ala.ui.events.PipelineExecutionChangeEvent)8 PipelineExecutionTraceKey (org.guvnor.ala.ui.model.PipelineExecutionTraceKey)6 Test (org.junit.Test)6 ProviderSelectedEvent (org.guvnor.ala.ui.client.events.ProviderSelectedEvent)2 RuntimeListItem (org.guvnor.ala.ui.model.RuntimeListItem)2