Search in sources :

Example 16 with RuntimeKey

use of org.guvnor.ala.ui.model.RuntimeKey in project kie-wb-common by kiegroup.

the class RuntimePresenterActionsTest method testOnCurrentRuntimeStopped.

@Test
public void testOnCurrentRuntimeStopped() {
    prepareRuntime();
    RuntimeKey currentKey = runtime.getKey();
    presenter.onRuntimeChangeEvent(new RuntimeChangeEvent(RuntimeChange.STOPPED, currentKey));
    verify(presenter, times(1)).refresh(currentKey);
}
Also used : RuntimeKey(org.guvnor.ala.ui.model.RuntimeKey) RuntimeChangeEvent(org.guvnor.ala.ui.events.RuntimeChangeEvent) Test(org.junit.Test)

Example 17 with RuntimeKey

use of org.guvnor.ala.ui.model.RuntimeKey in project kie-wb-common by kiegroup.

the class RuntimePresenterActionsTest method testForceDeleteRuntimeConfirmYesAndSuccessful.

@Test
public void testForceDeleteRuntimeConfirmYesAndSuccessful() {
    prepareRuntimeForceDelete();
    RuntimeKey currentKey = runtime.getKey();
    when(translationService.format(RuntimePresenter_RuntimeDeleteSuccessMessage, item.getRuntime().getKey().getId())).thenReturn(SUCCESS_MESSAGE);
    when(translationService.getTranslation(RuntimePresenter_RuntimeDeletingForcedMessage)).thenReturn(BUSY_POPUP_MESSAGE);
    yesCommandCaptor.getValue().execute();
    verify(runtimeService, times(1)).deleteRuntime(currentKey, true);
    verify(notificationEvent, times(1)).fire(new NotificationEvent(SUCCESS_MESSAGE, NotificationEvent.NotificationType.SUCCESS));
    verify(popupHelper, times(1)).showBusyIndicator(BUSY_POPUP_MESSAGE);
    verify(popupHelper, times(1)).hideBusyIndicator();
}
Also used : RuntimeKey(org.guvnor.ala.ui.model.RuntimeKey) NotificationEvent(org.uberfire.workbench.events.NotificationEvent) Test(org.junit.Test)

Example 18 with RuntimeKey

use of org.guvnor.ala.ui.model.RuntimeKey in project kie-wb-common by kiegroup.

the class RuntimePresenterActionsTest method testStartRuntimeSuccessful.

@Test
public void testStartRuntimeSuccessful() {
    prepareRuntime();
    RuntimeKey currentKey = runtime.getKey();
    when(translationService.format(RuntimePresenter_RuntimeStartSuccessMessage, currentKey.getId())).thenReturn(SUCCESS_MESSAGE);
    when(translationService.getTranslation(RuntimePresenter_RuntimeStartingMessage)).thenReturn(BUSY_POPUP_MESSAGE);
    presenter.startRuntime();
    verify(popupHelper, times(1)).showBusyIndicator(BUSY_POPUP_MESSAGE);
    verify(popupHelper, times(1)).hideBusyIndicator();
    verify(notificationEvent, times(1)).fire(new NotificationEvent(SUCCESS_MESSAGE, NotificationEvent.NotificationType.SUCCESS));
}
Also used : RuntimeKey(org.guvnor.ala.ui.model.RuntimeKey) NotificationEvent(org.uberfire.workbench.events.NotificationEvent) Test(org.junit.Test)

Example 19 with RuntimeKey

use of org.guvnor.ala.ui.model.RuntimeKey in project kie-wb-common by kiegroup.

the class RuntimePresenterActionsTest method testOnCurrentRuntimeStarted.

@Test
public void testOnCurrentRuntimeStarted() {
    prepareRuntime();
    RuntimeKey currentKey = runtime.getKey();
    presenter.onRuntimeChangeEvent(new RuntimeChangeEvent(RuntimeChange.STARTED, currentKey));
    verify(presenter, times(1)).refresh(currentKey);
}
Also used : RuntimeKey(org.guvnor.ala.ui.model.RuntimeKey) RuntimeChangeEvent(org.guvnor.ala.ui.events.RuntimeChangeEvent) Test(org.junit.Test)

Example 20 with RuntimeKey

use of org.guvnor.ala.ui.model.RuntimeKey in project kie-wb-common by kiegroup.

the class RuntimePresenterActionsTest method testStopRuntimeConfirmYesAndFailed.

@Test
public void testStopRuntimeConfirmYesAndFailed() {
    prepareRuntimeStop();
    RuntimeKey currentKey = runtime.getKey();
    when(translationService.getTranslation(RuntimePresenter_RuntimeStoppingMessage)).thenReturn(BUSY_POPUP_MESSAGE);
    doThrow(new RuntimeException(ERROR_MESSAGE)).when(runtimeService).stopRuntime(currentKey);
    yesCommandCaptor.getValue().execute();
    verify(runtimeService, times(1)).stopRuntime(currentKey);
    verify(defaultErrorCallback, times(1)).error(any(Message.class), exceptionCaptor.capture());
    assertEquals(ERROR_MESSAGE, exceptionCaptor.getValue().getCause().getMessage());
    verify(popupHelper, times(1)).showBusyIndicator(BUSY_POPUP_MESSAGE);
    verify(popupHelper, times(1)).hideBusyIndicator();
}
Also used : RuntimePresenter_RuntimeDeletingForcedMessage(org.guvnor.ala.ui.client.resources.i18n.GuvnorAlaUIConstants.RuntimePresenter_RuntimeDeletingForcedMessage) RuntimePresenter_RuntimeDeleteFailedMessage(org.guvnor.ala.ui.client.resources.i18n.GuvnorAlaUIConstants.RuntimePresenter_RuntimeDeleteFailedMessage) RuntimePresenter_PipelineExecutionAlreadyStoppedMessage(org.guvnor.ala.ui.client.resources.i18n.GuvnorAlaUIConstants.RuntimePresenter_PipelineExecutionAlreadyStoppedMessage) RuntimePresenter_PipelineExecutionDeleteSuccessMessage(org.guvnor.ala.ui.client.resources.i18n.GuvnorAlaUIConstants.RuntimePresenter_PipelineExecutionDeleteSuccessMessage) RuntimePresenter_PipelineExecutionStopSuccessMessage(org.guvnor.ala.ui.client.resources.i18n.GuvnorAlaUIConstants.RuntimePresenter_PipelineExecutionStopSuccessMessage) RuntimePresenter_RuntimeDeleteSuccessMessage(org.guvnor.ala.ui.client.resources.i18n.GuvnorAlaUIConstants.RuntimePresenter_RuntimeDeleteSuccessMessage) RuntimePresenter_RuntimeDeletingMessage(org.guvnor.ala.ui.client.resources.i18n.GuvnorAlaUIConstants.RuntimePresenter_RuntimeDeletingMessage) RuntimePresenter_RuntimeConfirmForcedDeleteMessage(org.guvnor.ala.ui.client.resources.i18n.GuvnorAlaUIConstants.RuntimePresenter_RuntimeConfirmForcedDeleteMessage) RuntimePresenter_RuntimeStopSuccessMessage(org.guvnor.ala.ui.client.resources.i18n.GuvnorAlaUIConstants.RuntimePresenter_RuntimeStopSuccessMessage) RuntimePresenter_RuntimeConfirmDeleteMessage(org.guvnor.ala.ui.client.resources.i18n.GuvnorAlaUIConstants.RuntimePresenter_RuntimeConfirmDeleteMessage) RuntimePresenter_PipelineExecutionConfirmDeleteMessage(org.guvnor.ala.ui.client.resources.i18n.GuvnorAlaUIConstants.RuntimePresenter_PipelineExecutionConfirmDeleteMessage) RuntimePresenter_PipelineExecutionConfirmStopMessage(org.guvnor.ala.ui.client.resources.i18n.GuvnorAlaUIConstants.RuntimePresenter_PipelineExecutionConfirmStopMessage) RuntimePresenter_RuntimeConfirmStopMessage(org.guvnor.ala.ui.client.resources.i18n.GuvnorAlaUIConstants.RuntimePresenter_RuntimeConfirmStopMessage) Message(org.jboss.errai.bus.client.api.messaging.Message) RuntimePresenter_RuntimeStartingMessage(org.guvnor.ala.ui.client.resources.i18n.GuvnorAlaUIConstants.RuntimePresenter_RuntimeStartingMessage) RuntimePresenter_RuntimeStoppingMessage(org.guvnor.ala.ui.client.resources.i18n.GuvnorAlaUIConstants.RuntimePresenter_RuntimeStoppingMessage) RuntimePresenter_RuntimeStartSuccessMessage(org.guvnor.ala.ui.client.resources.i18n.GuvnorAlaUIConstants.RuntimePresenter_RuntimeStartSuccessMessage) RuntimeKey(org.guvnor.ala.ui.model.RuntimeKey) Test(org.junit.Test)

Aggregations

RuntimeKey (org.guvnor.ala.ui.model.RuntimeKey)24 Test (org.junit.Test)21 RuntimeChangeEvent (org.guvnor.ala.ui.events.RuntimeChangeEvent)9 ProviderKey (org.guvnor.ala.ui.model.ProviderKey)7 RuntimeListItem (org.guvnor.ala.ui.model.RuntimeListItem)5 NotificationEvent (org.uberfire.workbench.events.NotificationEvent)5 RuntimePresenter_PipelineExecutionAlreadyStoppedMessage (org.guvnor.ala.ui.client.resources.i18n.GuvnorAlaUIConstants.RuntimePresenter_PipelineExecutionAlreadyStoppedMessage)3 RuntimePresenter_PipelineExecutionConfirmDeleteMessage (org.guvnor.ala.ui.client.resources.i18n.GuvnorAlaUIConstants.RuntimePresenter_PipelineExecutionConfirmDeleteMessage)3 RuntimePresenter_PipelineExecutionConfirmStopMessage (org.guvnor.ala.ui.client.resources.i18n.GuvnorAlaUIConstants.RuntimePresenter_PipelineExecutionConfirmStopMessage)3 RuntimePresenter_PipelineExecutionDeleteSuccessMessage (org.guvnor.ala.ui.client.resources.i18n.GuvnorAlaUIConstants.RuntimePresenter_PipelineExecutionDeleteSuccessMessage)3 RuntimePresenter_PipelineExecutionStopSuccessMessage (org.guvnor.ala.ui.client.resources.i18n.GuvnorAlaUIConstants.RuntimePresenter_PipelineExecutionStopSuccessMessage)3 RuntimePresenter_RuntimeConfirmDeleteMessage (org.guvnor.ala.ui.client.resources.i18n.GuvnorAlaUIConstants.RuntimePresenter_RuntimeConfirmDeleteMessage)3 RuntimePresenter_RuntimeConfirmForcedDeleteMessage (org.guvnor.ala.ui.client.resources.i18n.GuvnorAlaUIConstants.RuntimePresenter_RuntimeConfirmForcedDeleteMessage)3 RuntimePresenter_RuntimeConfirmStopMessage (org.guvnor.ala.ui.client.resources.i18n.GuvnorAlaUIConstants.RuntimePresenter_RuntimeConfirmStopMessage)3 RuntimePresenter_RuntimeDeleteFailedMessage (org.guvnor.ala.ui.client.resources.i18n.GuvnorAlaUIConstants.RuntimePresenter_RuntimeDeleteFailedMessage)3 RuntimePresenter_RuntimeDeleteSuccessMessage (org.guvnor.ala.ui.client.resources.i18n.GuvnorAlaUIConstants.RuntimePresenter_RuntimeDeleteSuccessMessage)3 RuntimePresenter_RuntimeDeletingForcedMessage (org.guvnor.ala.ui.client.resources.i18n.GuvnorAlaUIConstants.RuntimePresenter_RuntimeDeletingForcedMessage)3 RuntimePresenter_RuntimeDeletingMessage (org.guvnor.ala.ui.client.resources.i18n.GuvnorAlaUIConstants.RuntimePresenter_RuntimeDeletingMessage)3 RuntimePresenter_RuntimeStartSuccessMessage (org.guvnor.ala.ui.client.resources.i18n.GuvnorAlaUIConstants.RuntimePresenter_RuntimeStartSuccessMessage)3 RuntimePresenter_RuntimeStartingMessage (org.guvnor.ala.ui.client.resources.i18n.GuvnorAlaUIConstants.RuntimePresenter_RuntimeStartingMessage)3