Search in sources :

Example 76 with NotificationEvent

use of org.uberfire.workbench.events.NotificationEvent in project kie-wb-common by kiegroup.

the class EnableProviderTypeWizard method onEnableTypesSuccess.

private void onEnableTypesSuccess(final Collection<ProviderType> providerTypes) {
    notification.fire(new NotificationEvent(translationService.getTranslation(EnableProviderTypeWizard_ProviderTypeEnableSuccessMessage), NotificationEvent.NotificationType.SUCCESS));
    EnableProviderTypeWizard.super.complete();
    providerTypeListRefreshEvent.fire(new ProviderTypeListRefreshEvent(providerTypes.iterator().next().getKey()));
}
Also used : ProviderTypeListRefreshEvent(org.guvnor.ala.ui.client.events.ProviderTypeListRefreshEvent) NotificationEvent(org.uberfire.workbench.events.NotificationEvent)

Example 77 with NotificationEvent

use of org.uberfire.workbench.events.NotificationEvent in project kie-wb-common by kiegroup.

the class NewProviderWizard method onCreateProviderSuccess.

private void onCreateProviderSuccess(final ProviderConfiguration providerConfiguration) {
    notification.fire(new NotificationEvent(translationService.getTranslation(NewProviderWizard_ProviderCreateSuccessMessage), NotificationEvent.NotificationType.SUCCESS));
    NewProviderWizard.super.complete();
    providerTypeSelectedEvent.fire(new ProviderTypeSelectedEvent(providerType.getKey(), providerConfiguration.getId()));
}
Also used : ProviderTypeSelectedEvent(org.guvnor.ala.ui.client.events.ProviderTypeSelectedEvent) NotificationEvent(org.uberfire.workbench.events.NotificationEvent)

Example 78 with NotificationEvent

use of org.uberfire.workbench.events.NotificationEvent in project kie-wb-common by kiegroup.

the class RuntimePresenterActionsTest method testStopRuntimeConfirmYesAndSuccessful.

@Test
public void testStopRuntimeConfirmYesAndSuccessful() {
    prepareRuntimeStop();
    RuntimeKey currentKey = runtime.getKey();
    when(translationService.format(RuntimePresenter_RuntimeStopSuccessMessage, item.getRuntime().getKey().getId())).thenReturn(SUCCESS_MESSAGE);
    when(translationService.getTranslation(RuntimePresenter_RuntimeStoppingMessage)).thenReturn(BUSY_POPUP_MESSAGE);
    yesCommandCaptor.getValue().execute();
    verify(runtimeService, times(1)).stopRuntime(currentKey);
    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 79 with NotificationEvent

use of org.uberfire.workbench.events.NotificationEvent 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 80 with NotificationEvent

use of org.uberfire.workbench.events.NotificationEvent 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)

Aggregations

NotificationEvent (org.uberfire.workbench.events.NotificationEvent)151 Test (org.junit.Test)65 RemoteCallback (org.jboss.errai.common.client.api.RemoteCallback)34 ServerTemplate (org.kie.server.controller.api.model.spec.ServerTemplate)28 ContainerSpec (org.kie.server.controller.api.model.spec.ContainerSpec)22 ServerTemplateList (org.kie.server.controller.api.model.spec.ServerTemplateList)21 List (java.util.List)17 Path (org.uberfire.backend.vfs.Path)17 ErrorCallback (org.jboss.errai.common.client.api.ErrorCallback)16 ArrayList (java.util.ArrayList)14 Event (javax.enterprise.event.Event)14 Inject (javax.inject.Inject)12 ObservablePath (org.uberfire.backend.vfs.ObservablePath)12 PostConstruct (javax.annotation.PostConstruct)9 Observes (javax.enterprise.event.Observes)9 Caller (org.jboss.errai.common.client.api.Caller)9 Map (java.util.Map)8 Promise (elemental2.promise.Promise)7 Arrays (java.util.Arrays)7 Dependent (javax.enterprise.context.Dependent)7