use of org.kie.workbench.common.stunner.core.command.Command in project kie-wb-common by kiegroup.
the class BaseExpressionGridGeneralTest method testRegisterColumnResizeCompleted.
@Test
@SuppressWarnings("unchecked")
public void testRegisterColumnResizeCompleted() {
final DMNGridColumn uiColumn = mockColumn(200.0, grid);
grid.registerColumnResizeCompleted(uiColumn, 100.0);
verify(sessionCommandManager).execute(eq(canvasHandler), commandCaptor.capture());
final Command command = commandCaptor.getValue();
assertThat(command).isInstanceOf(SetComponentWidthCommand.class);
}
use of org.kie.workbench.common.stunner.core.command.Command in project kie-wb-common by kiegroup.
the class NotificationsObserverTest method testNotifyCommandExecutionSuccess.
@Test
@SuppressWarnings("unchecked")
public void testNotifyCommandExecutionSuccess() {
final Command command = mock(Command.class);
final CommandResult<CanvasViolation> result = mock(CommandResult.class);
final CanvasCommandExecutedEvent<? extends CanvasHandler> commandExecutedEvent = new CanvasCommandExecutedEvent<>(canvasHandler, command, result);
commandNotification = new CommandNotification(Notification.Type.INFO, notificationContext, command, "message1");
tested.onGraphCommandExecuted(commandExecutedEvent);
verify(onNotification, times(1)).execute(eq(commandNotification));
verify(commandSuccess, times(1)).execute(eq(commandNotification));
verify(commandFailed, never()).execute(any(CommandNotification.class));
verify(validationSuccess, never()).execute(any(ValidationSuccessNotification.class));
verify(validationFailed, never()).execute(any(ValidationFailedNotification.class));
}
use of org.kie.workbench.common.stunner.core.command.Command in project kie-wb-common by kiegroup.
the class NotificationsObserverTest method testNotifyCommandUndoSuccess.
@Test
@SuppressWarnings("unchecked")
public void testNotifyCommandUndoSuccess() {
final Command command = mock(Command.class);
final CommandResult<CanvasViolation> result = mock(CommandResult.class);
final CanvasCommandUndoneEvent<CanvasHandler> commandExecutedEvent = new CanvasCommandUndoneEvent<>(canvasHandler, command, result);
commandNotification = new CommandNotification(Notification.Type.INFO, notificationContext, command, "message1");
tested.onCanvasCommandUndoneEvent(commandExecutedEvent);
verify(onNotification, times(1)).execute(eq(commandNotification));
verify(commandSuccess, times(1)).execute(eq(commandNotification));
verify(commandFailed, never()).execute(any(CommandNotification.class));
verify(validationSuccess, never()).execute(any(ValidationSuccessNotification.class));
verify(validationFailed, never()).execute(any(ValidationFailedNotification.class));
}
use of org.kie.workbench.common.stunner.core.command.Command in project kie-wb-common by kiegroup.
the class NotificationsObserverTest method testNotifyCommandUndoFailed.
@Test
@SuppressWarnings("unchecked")
public void testNotifyCommandUndoFailed() {
final Command command = mock(Command.class);
final CommandResult<CanvasViolation> result = mock(CommandResult.class);
final CanvasCommandUndoneEvent<? extends CanvasHandler> commandExecutedEvent = new CanvasCommandUndoneEvent<>(canvasHandler, command, result);
commandNotification = new CommandNotification(Notification.Type.ERROR, notificationContext, command, "message1");
tested.onCanvasCommandUndoneEvent(commandExecutedEvent);
verify(onNotification, times(1)).execute(eq(commandNotification));
verify(commandFailed, times(1)).execute(eq(commandNotification));
verify(commandSuccess, never()).execute(any(CommandNotification.class));
verify(validationSuccess, never()).execute(any(ValidationSuccessNotification.class));
verify(validationFailed, never()).execute(any(ValidationFailedNotification.class));
}
use of org.kie.workbench.common.stunner.core.command.Command in project kie-wb-common by kiegroup.
the class NotificationsObserverTest method testNotifyCommandExecutionFailed.
@Test
@SuppressWarnings("unchecked")
public void testNotifyCommandExecutionFailed() {
final Command command = mock(Command.class);
final CommandResult<CanvasViolation> result = mock(CommandResult.class);
final CanvasCommandExecutedEvent<? extends CanvasHandler> commandExecutedEvent = new CanvasCommandExecutedEvent<>(canvasHandler, command, result);
commandNotification = new CommandNotification(Notification.Type.ERROR, notificationContext, command, "message1");
tested.onGraphCommandExecuted(commandExecutedEvent);
verify(onNotification, times(1)).execute(eq(commandNotification));
verify(commandFailed, times(1)).execute(eq(commandNotification));
verify(commandSuccess, never()).execute(any(CommandNotification.class));
verify(validationSuccess, never()).execute(any(ValidationSuccessNotification.class));
verify(validationFailed, never()).execute(any(ValidationFailedNotification.class));
}
Aggregations