use of org.uberfire.workbench.events.NotificationEvent in project drools-wb by kiegroup.
the class DecisionTableXLSEditorViewImplTest method testSubmit.
@Test
public void testSubmit() throws Exception {
Path path = mock(Path.class);
view.setupUploadWidget(type);
view.submit(path);
verify(attachmentFileWidget).submit(eq(path), eq(SERVLET_URL), commandCaptor.capture(), any(Command.class));
commandCaptor.getValue().execute();
verify(notificationEvent).fire(any(NotificationEvent.class));
verify(presenter).onUploadSuccess();
}
use of org.uberfire.workbench.events.NotificationEvent in project kie-wb-common by kiegroup.
the class SettingsPresenter method setupSection.
Promise<Object> setupSection(final ProjectScreenModel model, final Section section) {
return promises.resolve().then(ignore -> section.setup(model)).catch_(e -> {
sections.remove(section);
notificationEvent.fire(new NotificationEvent(getSectionSetupErrorMessage(section), WARNING));
return promises.reject(e);
}).then(i -> {
section.getMenuItem().setup(section, this);
resetDirtyIndicator(section);
return promises.resolve();
}).catch_(e -> {
DomGlobal.console.info(e);
return promises.resolve();
});
}
use of org.uberfire.workbench.events.NotificationEvent in project kie-wb-common by kiegroup.
the class BuildExecutor method saveContainerSpec.
private void saveContainerSpec(final String containerId, final String containerAlias, final ServerTemplate serverTemplate, final Boolean startContainer, final Map<String, String> parameters) {
if (containerId != null && serverTemplate != null && serverTemplate.getId() != null) {
final ContainerSpec containerSpec = makeContainerSpec(containerId, containerAlias, serverTemplate, parameters);
specManagementService.call(aVoid -> {
notificationEvent.fire(new NotificationEvent(ProjectEditorResources.CONSTANTS.DeploySuccessful(), NotificationEvent.NotificationType.SUCCESS));
if (startContainer) {
startContainer(containerSpec);
}
}).saveContainerSpec(serverTemplate.getId(), containerSpec);
}
}
use of org.uberfire.workbench.events.NotificationEvent in project kie-wb-common by kiegroup.
the class BuildExecutorTest method testBuildAndDeployCommandSingleServerTemplate.
@Test
public void testBuildAndDeployCommandSingleServerTemplate() {
final ServerTemplate serverTemplate = new ServerTemplate("id", "name");
when(specManagementServiceMock.listServerTemplates()).thenReturn(new ServerTemplateList(Collections.singletonList(serverTemplate)));
buildExecutor.triggerBuildAndDeploy();
ArgumentCaptor<ContainerSpec> containerSpecArgumentCaptor = ArgumentCaptor.forClass(ContainerSpec.class);
verify(specManagementServiceMock).saveContainerSpec(eq(serverTemplate.getId()), containerSpecArgumentCaptor.capture());
final ContainerSpec containerSpec = containerSpecArgumentCaptor.getValue();
assertEquals(module.getPom().getGav().getArtifactId(), containerSpec.getContainerName());
verifyNotification(ProjectEditorResources.CONSTANTS.BuildSuccessful(), NotificationEvent.NotificationType.SUCCESS);
verifyNotification(ProjectEditorResources.CONSTANTS.DeploySuccessful(), NotificationEvent.NotificationType.SUCCESS);
verify(notificationEvent, times(2)).fire(any(NotificationEvent.class));
verifyBusyShowHideAnyString(1, 1);
}
use of org.uberfire.workbench.events.NotificationEvent 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()));
}
Aggregations