use of org.kie.workbench.common.stunner.core.graph.command.ContextualGraphCommandExecutionContext in project kie-wb-common by kiegroup.
the class ConnectorParentsMatchLevel1Tests method testAddNewEdgeAndNodeButNoParentsTypeMatch.
@Test
public void testAddNewEdgeAndNodeButNoParentsTypeMatch() {
Command<GraphCommandExecutionContext, RuleViolation> command = addNewEdgeAndNodeIntoParent(graph.parentNode);
ContextualGraphCommandExecutionContext executionContext = createConstrainedExecutionContext();
CommandResult<RuleViolation> result = command.allow(executionContext);
assertRuleFailedResult(result);
}
use of org.kie.workbench.common.stunner.core.graph.command.ContextualGraphCommandExecutionContext in project kie-wb-common by kiegroup.
the class MultipleEvaluationContextStatesTest method testAllowShortcutWithRules.
@Test
@SuppressWarnings("unchecked")
public void testAllowShortcutWithRules() {
SafeDeleteNodeCommand deleteNodeCommand = new SafeDeleteNodeCommand(graph1Instance.intermNode);
ContextualGraphCommandExecutionContext executionContext = createExecutionContext();
CommandResult<RuleViolation> result = deleteNodeCommand.allow(executionContext);
assertFalse(isError(result));
assertFalse(isWarn(result));
assertFalse(result.getViolations().iterator().hasNext());
}
use of org.kie.workbench.common.stunner.core.graph.command.ContextualGraphCommandExecutionContext in project kie-wb-common by kiegroup.
the class ConnectorParentsMatchLevel2Tests method testSetEdge1SourceAsNodeB.
@Test
@SuppressWarnings("unchecked")
public void testSetEdge1SourceAsNodeB() {
SetConnectionSourceNodeCommand setTarget = new SetConnectionSourceNodeCommand(graph.nodeB, graph.edge1);
ContextualGraphCommandExecutionContext executionContext = createExecutionContext();
CommandResult<RuleViolation> result = setTarget.allow(executionContext);
assertRuleFailedResult(result);
}
use of org.kie.workbench.common.stunner.core.graph.command.ContextualGraphCommandExecutionContext in project kie-wb-common by kiegroup.
the class ConnectorParentsMatchLevel2Tests method testMoveStartNodeIntoNodeA.
// CONTAINMENT contexts
@Test
@SuppressWarnings("unchecked")
public void testMoveStartNodeIntoNodeA() {
ContextualGraphCommandExecutionContext executionContext = createExecutionContext();
SetChildrenCommand setChildren = new SetChildrenCommand(graph.nodeA, graph.startNode);
CommandResult<RuleViolation> result = setChildren.allow(executionContext);
assertTrue(isError(result));
assertTrue(result.getViolations().iterator().hasNext());
RuleViolation ruleViolation = result.getViolations().iterator().next();
assertTrue(ruleViolation instanceof ContextOperationNotAllowedViolation);
}
use of org.kie.workbench.common.stunner.core.graph.command.ContextualGraphCommandExecutionContext in project kie-wb-common by kiegroup.
the class ConnectorParentsMatchLevel2Tests method testMoveEndNodeIntoSubProcessNode.
@Test
@SuppressWarnings("unchecked")
public void testMoveEndNodeIntoSubProcessNode() {
SetChildrenCommand setChildren = new SetChildrenCommand(graph.subProcessNode, graph.endNode);
ContextualGraphCommandExecutionContext executionContext = createExecutionContext();
CommandResult<RuleViolation> result = setChildren.allow(executionContext);
assertSuccessfullResult(result);
}
Aggregations