use of org.uberfire.workbench.events.NotificationEvent in project kie-wb-common by kiegroup.
the class BaseViewPresenter method getRenameSuccessCallback.
protected RemoteCallback<Void> getRenameSuccessCallback(final RenamePopUpPresenter.View renamePopupView) {
return new RemoteCallback<Void>() {
@Override
public void callback(final Void o) {
renamePopupView.hide();
notification.fire(new NotificationEvent(CommonConstants.INSTANCE.ItemRenamedSuccessfully()));
baseView.hideBusyIndicator();
refresh();
}
};
}
use of org.uberfire.workbench.events.NotificationEvent in project kie-wb-common by kiegroup.
the class BaseViewPresenter method getCopySuccessCallback.
protected RemoteCallback<Void> getCopySuccessCallback(final CopyPopUpPresenter.View copyPopupView) {
return new RemoteCallback<Void>() {
@Override
public void callback(final Void o) {
copyPopupView.hide();
notification.fire(new NotificationEvent(CommonConstants.INSTANCE.ItemCopiedSuccessfully()));
baseView.hideBusyIndicator();
refresh();
}
};
}
use of org.uberfire.workbench.events.NotificationEvent in project kie-wb-common by kiegroup.
the class ArchetypeManagementScreenPresenterTest method fireNotificationOnArchetypeListUpdatedEvent.
private void fireNotificationOnArchetypeListUpdatedEvent(final ArchetypeListOperation operation, final String notificationMsg, final String tsKey) {
doReturn(notificationMsg).when(ts).getTranslation(tsKey);
doReturn(true).when(archetypeTablePresenter).isSetup();
presenter.onArchetypeListUpdatedEvent(new ArchetypeListUpdatedEvent(operation));
verify(notificationEvent).fire(new NotificationEvent(notificationMsg, NotificationEvent.NotificationType.SUCCESS));
}
use of org.uberfire.workbench.events.NotificationEvent in project kie-wb-common by kiegroup.
the class AbstractExecutorTest method verifyNotification.
protected void verifyNotification(final String message, final NotificationEvent.NotificationType type) {
verify(notificationEvent).fire(argThat(new ArgumentMatcher<NotificationEvent>() {
@Override
public boolean matches(final NotificationEvent argument) {
final NotificationEvent event = (NotificationEvent) argument;
final String notification = event.getNotification();
return notification.equals(message) && type.equals(event.getType());
}
}));
}
use of org.uberfire.workbench.events.NotificationEvent in project kie-wb-common by kiegroup.
the class AbstractBuildAndDeployExecutorTest method testBuildAndDeployWithoutServerTemplateError.
@Test
public void testBuildAndDeployWithoutServerTemplateError() {
Answer answer = new Answer() {
boolean executed = false;
@Override
public Object answer(InvocationOnMock invocationOnMock) throws Throwable {
if (!executed) {
executed = true;
throw new Exception();
}
return new BuildResults();
}
};
when(buildServiceMock.buildAndDeploy(any(Module.class), any(DeploymentMode.class))).thenAnswer(answer);
runner.run(context);
verify(buildDialog, times(2)).showBusyIndicator(CONSTANTS.Building());
verify(notificationEvent, times(2)).fire(any(NotificationEvent.class));
verify(buildDialog, atLeastOnce()).stopBuild();
verify(buildDialog).stopBuild();
}
Aggregations