use of org.kie.workbench.common.stunner.core.rule.RuleViolation 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.stunner.core.rule.RuleViolation 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.stunner.core.rule.RuleViolation 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);
}
use of org.kie.workbench.common.stunner.core.rule.RuleViolation in project kie-wb-common by kiegroup.
the class AddRelationColumnCommandTest method testGraphCommandExecuteWithRows.
@Test
public void testGraphCommandExecuteWithRows() {
relation.getRow().add(new List());
final Command<GraphCommandExecutionContext, RuleViolation> c = command.newGraphCommand(handler);
assertEquals(GraphCommandResultBuilder.SUCCESS, c.execute(gce));
assertEquals(1, relation.getColumn().size());
assertEquals(informationItem, relation.getColumn().get(0));
assertEquals(1, relation.getRow().size());
assertEquals(1, relation.getRow().get(0).getExpression().size());
assertTrue(relation.getRow().get(0).getExpression().get(0) instanceof LiteralExpression);
}
use of org.kie.workbench.common.stunner.core.rule.RuleViolation in project kie-wb-common by kiegroup.
the class AddRelationColumnCommandTest method testGraphCommandUndoWithRows.
@Test
public void testGraphCommandUndoWithRows() {
relation.getRow().add(new List());
final Command<GraphCommandExecutionContext, RuleViolation> c = command.newGraphCommand(handler);
// Add column and then undo
assertEquals(GraphCommandResultBuilder.SUCCESS, c.execute(gce));
assertEquals(GraphCommandResultBuilder.SUCCESS, c.undo(gce));
assertEquals(0, relation.getColumn().size());
assertEquals(1, relation.getRow().size());
assertEquals(0, relation.getRow().get(0).getExpression().size());
}
Aggregations