use of org.kie.workbench.common.dmn.api.definition.v1_1.InformationItem in project kie-wb-common by kiegroup.
the class RemoveParameterCommandTest method testGraphCommandUndoWithParameters.
@Test
public void testGraphCommandUndoWithParameters() {
final InformationItem otherParameter = new InformationItem();
function.getFormalParameter().add(otherParameter);
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));
assertFormalParameters(parameter, otherParameter);
}
use of org.kie.workbench.common.dmn.api.definition.v1_1.InformationItem in project kie-wb-common by kiegroup.
the class RemoveParameterCommandTest method testRemoveFromMiddleThenUndo.
@Test
public void testRemoveFromMiddleThenUndo() {
final InformationItem firstParameter = new InformationItem();
firstParameter.setName(new Name("first"));
function.getFormalParameter().add(0, firstParameter);
final InformationItem lastParameter = new InformationItem();
lastParameter.setName(new Name("last"));
function.getFormalParameter().add(lastParameter);
// call to get proper old index of parameter
this.command = new RemoveParameterCommand(function, parameter, canvasOperation);
final Command<GraphCommandExecutionContext, RuleViolation> c = command.newGraphCommand(handler);
// Add parameter and then undo
assertEquals(GraphCommandResultBuilder.SUCCESS, c.execute(gce));
assertFormalParameters(firstParameter, lastParameter);
assertEquals(GraphCommandResultBuilder.SUCCESS, c.undo(gce));
assertFormalParameters(firstParameter, parameter, lastParameter);
}
use of org.kie.workbench.common.dmn.api.definition.v1_1.InformationItem in project kie-wb-common by kiegroup.
the class RemoveParameterCommandTest method testGraphCommandExecuteWithParameters.
@Test
public void testGraphCommandExecuteWithParameters() {
final InformationItem otherParameter = new InformationItem();
function.getFormalParameter().add(otherParameter);
final Command<GraphCommandExecutionContext, RuleViolation> c = command.newGraphCommand(handler);
assertEquals(GraphCommandResultBuilder.SUCCESS, c.execute(gce));
assertFormalParameters(otherParameter);
}
use of org.kie.workbench.common.dmn.api.definition.v1_1.InformationItem in project kie-wb-common by kiegroup.
the class AddParameterBindingCommandTest method makeCommand.
private void makeCommand(final int uiRowIndex, final String bindingName, final DMNGridRow uiGridRow) {
final Binding rowEntry = new Binding();
final InformationItem parameter = new InformationItem();
parameter.setName(new Name(bindingName));
rowEntry.setParameter(parameter);
makeCommand(uiRowIndex, rowEntry, uiGridRow);
}
use of org.kie.workbench.common.dmn.api.definition.v1_1.InformationItem in project kie-wb-common by kiegroup.
the class DeleteParameterBindingCommandTest method makeBinding.
private Binding makeBinding(final String bindingName) {
final Binding newBinding = new Binding();
final InformationItem parameter = new InformationItem();
parameter.setName(new Name(bindingName));
newBinding.setParameter(parameter);
return newBinding;
}
Aggregations