Search in sources :

Example 1 with RefreshRuntimeEvent

use of org.guvnor.ala.ui.client.events.RefreshRuntimeEvent in project kie-wb-common by kiegroup.

the class NewDeployWizardTest method testStartDeploymentSuccess.

@Test
public void testStartDeploymentSuccess() {
    // initialize and start the wizard.
    wizard.start(provider, pipelines);
    verifyStart();
    // e.g. PIPELINE1 was selected.
    preSelectForms(PIPELINE1_KEY);
    // emulate the user completing the wizard.
    preCompleteWizard(PIPELINE1_KEY, RUNTIME);
    // emulates the user pressing the finish button
    wizard.complete();
    // the parameters must the the values collected by the forms.
    Map<String, String> expectedPrams = buildExpectedParams(paramsFormsValues);
    expectedPrams.put(RUNTIME_NAME, RUNTIME);
    verify(runtimeService, times(1)).createRuntime(provider.getKey(), RUNTIME, PIPELINE1_KEY, expectedPrams);
    verify(notification, times(1)).fire(new NotificationEvent(SUCCESS_MESSAGE, NotificationEvent.NotificationType.SUCCESS));
    verify(refreshRuntimeEvent, times(1)).fire(new RefreshRuntimeEvent(provider.getKey()));
}
Also used : RefreshRuntimeEvent(org.guvnor.ala.ui.client.events.RefreshRuntimeEvent) NotificationEvent(org.uberfire.workbench.events.NotificationEvent) Test(org.junit.Test)

Example 2 with RefreshRuntimeEvent

use of org.guvnor.ala.ui.client.events.RefreshRuntimeEvent in project kie-wb-common by kiegroup.

the class NewDeployWizard method onPipelineStartSuccess.

private void onPipelineStartSuccess() {
    notification.fire(new NotificationEvent(translationService.getTranslation(NewDeployWizard_PipelineStartSuccessMessage), NotificationEvent.NotificationType.SUCCESS));
    NewDeployWizard.super.complete();
    refreshRuntimeEvent.fire(new RefreshRuntimeEvent(provider.getKey()));
}
Also used : RefreshRuntimeEvent(org.guvnor.ala.ui.client.events.RefreshRuntimeEvent) NotificationEvent(org.uberfire.workbench.events.NotificationEvent)

Example 3 with RefreshRuntimeEvent

use of org.guvnor.ala.ui.client.events.RefreshRuntimeEvent in project kie-wb-common by kiegroup.

the class ProviderPresenterTest method testOnRefreshRuntimesWithItems.

@Test
public void testOnRefreshRuntimesWithItems() {
    // emulate that the provider was already loaded.
    prepareRefreshWithItems();
    // emulate the refresh action in a later time.
    presenter.onRefreshRuntime(new RefreshRuntimeEvent(providerKey));
    // the ui must have been loaded with the items twice, the initial loading + the refresh
    verify(providerStatusPresenter, times(2)).setupItems(runtimeItems);
    verify(view, times(2)).setStatus(providerStatusPresenterView);
    // common verifications.
    verifyRuntimesInfoLoaded(2);
}
Also used : RefreshRuntimeEvent(org.guvnor.ala.ui.client.events.RefreshRuntimeEvent) Test(org.junit.Test)

Example 4 with RefreshRuntimeEvent

use of org.guvnor.ala.ui.client.events.RefreshRuntimeEvent in project kie-wb-common by kiegroup.

the class ProviderPresenterTest method testOnRefreshRuntimesWithNoItems.

@Test
public void testOnRefreshRuntimesWithNoItems() {
    // emulate that the provider was already loaded.
    prepareRefreshWithNoItems();
    // emulate the refresh action in a later time.
    presenter.onRefreshRuntime(new RefreshRuntimeEvent(providerKey));
    // the ui must have been loaded with the items twice, the initial loading + the refresh
    // the empty status must have been set twice.
    verifyUILoadedWithNoItems(2);
    // common verifications.
    verifyRuntimesInfoLoaded(2);
}
Also used : RefreshRuntimeEvent(org.guvnor.ala.ui.client.events.RefreshRuntimeEvent) Test(org.junit.Test)

Example 5 with RefreshRuntimeEvent

use of org.guvnor.ala.ui.client.events.RefreshRuntimeEvent in project kie-wb-common by kiegroup.

the class ProviderStatusEmptyPresenterTest method testOnRefresh.

@Test
public void testOnRefresh() {
    presenter.onRefresh();
    verify(refreshRuntimeEvent, times(1)).fire(new RefreshRuntimeEvent(providerKey));
}
Also used : RefreshRuntimeEvent(org.guvnor.ala.ui.client.events.RefreshRuntimeEvent) Test(org.junit.Test)

Aggregations

RefreshRuntimeEvent (org.guvnor.ala.ui.client.events.RefreshRuntimeEvent)5 Test (org.junit.Test)4 NotificationEvent (org.uberfire.workbench.events.NotificationEvent)2