Search in sources :

Example 1 with AbstractCanvasGraphCommand

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));
}
Also used : AbstractCanvasHandler(org.kie.workbench.common.stunner.core.client.canvas.AbstractCanvasHandler) AbstractCanvasGraphCommand(org.kie.workbench.common.stunner.core.client.canvas.command.AbstractCanvasGraphCommand) Test(org.junit.Test) BaseCommandsTest(org.kie.workbench.common.dmn.client.session.BaseCommandsTest)

Example 2 with AbstractCanvasGraphCommand

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));
}
Also used : BaseCanvasHandler(org.kie.workbench.common.stunner.core.client.canvas.BaseCanvasHandler) AbstractCanvasGraphCommand(org.kie.workbench.common.stunner.core.client.canvas.command.AbstractCanvasGraphCommand) Test(org.junit.Test) BaseCommandsTest(org.kie.workbench.common.dmn.client.session.BaseCommandsTest)

Example 3 with AbstractCanvasGraphCommand

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);
}
Also used : DecisionTable(org.kie.workbench.common.dmn.api.definition.model.DecisionTable) AbstractCanvasGraphCommand(org.kie.workbench.common.stunner.core.client.canvas.command.AbstractCanvasGraphCommand) Text(org.kie.workbench.common.dmn.api.property.dmn.Text) Test(org.junit.Test)

Example 4 with AbstractCanvasGraphCommand

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);
    });
}
Also used : AbstractCanvasHandler(org.kie.workbench.common.stunner.core.client.canvas.AbstractCanvasHandler) AbstractCanvasGraphCommand(org.kie.workbench.common.stunner.core.client.canvas.command.AbstractCanvasGraphCommand)

Example 5 with AbstractCanvasGraphCommand

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));
}
Also used : BaseCanvasHandler(org.kie.workbench.common.stunner.core.client.canvas.BaseCanvasHandler) AbstractCanvasGraphCommand(org.kie.workbench.common.stunner.core.client.canvas.command.AbstractCanvasGraphCommand) Test(org.junit.Test) BaseCommandsTest(org.kie.workbench.common.dmn.client.session.BaseCommandsTest)

Aggregations

AbstractCanvasGraphCommand (org.kie.workbench.common.stunner.core.client.canvas.command.AbstractCanvasGraphCommand)9 Test (org.junit.Test)6 AbstractCanvasHandler (org.kie.workbench.common.stunner.core.client.canvas.AbstractCanvasHandler)5 BaseCommandsTest (org.kie.workbench.common.dmn.client.session.BaseCommandsTest)4 DecisionTable (org.kie.workbench.common.dmn.api.definition.model.DecisionTable)2 BaseCanvasHandler (org.kie.workbench.common.stunner.core.client.canvas.BaseCanvasHandler)2 Definition (org.kie.workbench.common.stunner.core.graph.content.definition.Definition)2 HasName (org.kie.workbench.common.dmn.api.definition.HasName)1 OutputClause (org.kie.workbench.common.dmn.api.definition.model.OutputClause)1 Name (org.kie.workbench.common.dmn.api.property.dmn.Name)1 QName (org.kie.workbench.common.dmn.api.property.dmn.QName)1 Text (org.kie.workbench.common.dmn.api.property.dmn.Text)1 DMNGridColumn (org.kie.workbench.common.dmn.client.widgets.grid.model.DMNGridColumn)1 GridColumn (org.uberfire.ext.wires.core.grids.client.model.GridColumn)1