use of org.kie.workbench.common.stunner.core.client.canvas.command.AbstractCanvasGraphCommand in project kie-wb-common by kiegroup.
the class SessionPreviewImplTest method checkVetoExecutionCommands.
@Test
public void checkVetoExecutionCommands() {
final AbstractCanvasGraphCommand command = new MockVetoExecutionCommand();
preview.handleCanvasCommandExecutedEvent(makeCommandExecutionContext(command));
verify(canvasCommandManager, never()).execute(any(AbstractCanvasHandler.class), any(AbstractCanvasGraphCommand.class));
}
use of org.kie.workbench.common.stunner.core.client.canvas.command.AbstractCanvasGraphCommand in project kie-wb-common by kiegroup.
the class SessionPreviewImplTest method checkExecutionCommands.
@Test
public void checkExecutionCommands() {
final AbstractCanvasGraphCommand command = new MockCommand();
preview.handleCanvasCommandExecutedEvent(makeCommandExecutionContext(command));
verify(canvasCommandManager).execute(any(BaseCanvasHandler.class), eq(command));
}
use of org.kie.workbench.common.stunner.core.client.canvas.command.AbstractCanvasGraphCommand in project kie-wb-common by kiegroup.
the class DecisionTableGridTest method testInputClauseHasNameWrapperForHeaderMetaData.
@Test
@SuppressWarnings("unchecked")
public void testInputClauseHasNameWrapperForHeaderMetaData() {
setupGrid(makeHasNameForDecision(), 0);
final DecisionTable dtable = expression.get();
assertThat(dtable.getInput().get(0).getInputExpression().getText().getValue()).isEqualTo(grid.getModel().getColumns().get(1).getHeaderMetaData().get(0).getTitle());
extractHeaderMetaData(0, 1).setValue(new Text(NAME_NEW));
verify(sessionCommandManager).execute(eq(canvasHandler), compositeCommandCaptor.capture());
((AbstractCanvasGraphCommand) compositeCommandCaptor.getValue().getCommands().get(0)).execute(canvasHandler);
assertThat(expression.get().getInput().get(0).getInputExpression().getText().getValue()).isEqualTo(NAME_NEW);
}
use of org.kie.workbench.common.stunner.core.client.canvas.command.AbstractCanvasGraphCommand in project kie-wb-common by kiegroup.
the class RelationGridTest method mockInsertColumnCommandExecution.
private void mockInsertColumnCommandExecution() {
when(sessionCommandManager.execute(eq(canvasHandler), any(AbstractCanvasGraphCommand.class))).thenAnswer((i) -> {
final AbstractCanvasHandler handler = (AbstractCanvasHandler) i.getArguments()[0];
final AbstractCanvasGraphCommand command = (AbstractCanvasGraphCommand) i.getArguments()[1];
return command.execute(handler);
});
}
use of org.kie.workbench.common.stunner.core.client.canvas.command.AbstractCanvasGraphCommand in project kie-wb-common by kiegroup.
the class SessionPreviewImplTest method checkUndoCommands.
@Test
public void checkUndoCommands() {
final AbstractCanvasGraphCommand command = new MockCommand();
preview.handleCanvasUndoCommandExecutedEvent(makeCommandUndoContext(command));
verify(canvasCommandManager).undo(any(BaseCanvasHandler.class), eq(command));
}
Aggregations