use of org.kie.workbench.common.dmn.api.definition.model.Binding in project kie-wb-common by kiegroup.
the class AddParameterBindingCommandTest method testGraphCommandUndoFromMiddle.
@Test
public void testGraphCommandUndoFromMiddle() {
final Binding firstBinding = new Binding();
final Binding secondBinding = new Binding();
invocation.getBinding().add(firstBinding);
invocation.getBinding().add(secondBinding);
makeCommand(1);
final Command<GraphCommandExecutionContext, RuleViolation> c = command.newGraphCommand(handler);
// Add parameter and then undo
assertEquals(GraphCommandResultBuilder.SUCCESS, c.execute(gce));
assertEquals(GraphCommandResultBuilder.SUCCESS, c.undo(gce));
assertBindingDefinitions(firstBinding, secondBinding);
}
use of org.kie.workbench.common.dmn.api.definition.model.Binding in project kie-wb-common by kiegroup.
the class AddParameterBindingCommandTest method makeCommand.
private void makeCommand(final int uiRowIndex, final GridRow uiGridRow) {
final Binding rowEntry = new Binding();
final InformationItem parameter = new InformationItem();
parameter.setName(new Name());
rowEntry.setParameter(parameter);
makeCommand(uiRowIndex, rowEntry, uiGridRow);
}
use of org.kie.workbench.common.dmn.api.definition.model.Binding in project kie-wb-common by kiegroup.
the class AddParameterBindingCommandTest method testGraphCommandExecuteWithParameters.
@Test
public void testGraphCommandExecuteWithParameters() {
final Binding otherBinding = new Binding();
invocation.getBinding().add(otherBinding);
makeCommand();
final Command<GraphCommandExecutionContext, RuleViolation> c = command.newGraphCommand(handler);
assertEquals(GraphCommandResultBuilder.SUCCESS, c.execute(gce));
assertBindingDefinitions(otherBinding, binding);
assertEquals(invocation, binding.getParent());
assertEquals(binding, binding.getParameter().getParent());
}
use of org.kie.workbench.common.dmn.api.definition.model.Binding in project kie-wb-common by kiegroup.
the class AddParameterBindingCommandTest method testGraphCommandUndoWithParameters.
@Test
public void testGraphCommandUndoWithParameters() {
final Binding otherBinding = new Binding();
invocation.getBinding().add(otherBinding);
makeCommand();
final Command<GraphCommandExecutionContext, RuleViolation> c = command.newGraphCommand(handler);
// Add parameter and then undo
assertEquals(GraphCommandResultBuilder.SUCCESS, c.execute(gce));
assertEquals(GraphCommandResultBuilder.SUCCESS, c.undo(gce));
assertBindingDefinitions(otherBinding);
}
use of org.kie.workbench.common.dmn.api.definition.model.Binding in project kie-wb-common by kiegroup.
the class AddParameterBindingCommandTest method testGraphCommandExecuteInsertIntoMiddle.
@Test
public void testGraphCommandExecuteInsertIntoMiddle() {
final Binding firstBinding = new Binding();
final Binding secondBinding = new Binding();
invocation.getBinding().add(firstBinding);
invocation.getBinding().add(secondBinding);
makeCommand(1);
final Command<GraphCommandExecutionContext, RuleViolation> c = command.newGraphCommand(handler);
assertEquals(GraphCommandResultBuilder.SUCCESS, c.execute(gce));
assertBindingDefinitions(firstBinding, binding, secondBinding);
assertEquals(invocation, binding.getParent());
assertEquals(binding, binding.getParameter().getParent());
}
Aggregations