use of org.kie.workbench.common.stunner.core.graph.command.ContextualGraphCommandExecutionContext in project kie-wb-common by kiegroup.
the class ConnectorParentsMatchLevel2Tests method testMoveEndNodeIntoParentNode.
@Test
@SuppressWarnings("unchecked")
public void testMoveEndNodeIntoParentNode() {
ContextualGraphCommandExecutionContext executionContext = createExecutionContext();
SetChildrenCommand setChildren = new SetChildrenCommand(graph.parentNode, graph.endNode);
CommandResult<RuleViolation> result = setChildren.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 testMoveIntermNodeIntoSubProcessNode.
@Test
@SuppressWarnings("unchecked")
public void testMoveIntermNodeIntoSubProcessNode() {
SetChildrenCommand setChildren = new SetChildrenCommand(graph.subProcessNode, graph.intermNode);
ContextualGraphCommandExecutionContext executionContext = createExecutionContext();
CommandResult<RuleViolation> result = setChildren.allow(executionContext);
assertSuccessfullResult(result);
}
use of org.kie.workbench.common.stunner.core.graph.command.ContextualGraphCommandExecutionContext in project kie-wb-common by kiegroup.
the class ConnectorParentsMatchLevel2Tests method testMoveAllConnectedNodesIntoSubProcessNode.
@Test
@SuppressWarnings("unchecked")
public void testMoveAllConnectedNodesIntoSubProcessNode() {
SetChildrenCommand setChildren = new SetChildrenCommand(graph.subProcessNode, Arrays.asList(graph.startNode, graph.intermNode, graph.endNode));
ContextualGraphCommandExecutionContext executionContext = createExecutionContext();
CommandResult<RuleViolation> result = setChildren.allow(executionContext);
assertSuccessfullResult(result);
}
use of org.kie.workbench.common.stunner.core.graph.command.ContextualGraphCommandExecutionContext in project kie-wb-common by kiegroup.
the class ConnectorParentsMatchLevel2Tests method testMoveAllConnectedNodesIntoParentNode.
@Test
@SuppressWarnings("unchecked")
public void testMoveAllConnectedNodesIntoParentNode() {
SetChildrenCommand setChildren = new SetChildrenCommand(graph.parentNode, Arrays.asList(graph.startNode, graph.intermNode, graph.endNode));
ContextualGraphCommandExecutionContext executionContext = createExecutionContext();
CommandResult<RuleViolation> result = setChildren.allow(executionContext);
assertSuccessfullResult(result);
}
use of org.kie.workbench.common.stunner.core.graph.command.ContextualGraphCommandExecutionContext in project kie-wb-common by kiegroup.
the class TestingGraphInstances method createConstrainedExecutionContext.
public static ContextualGraphCommandExecutionContext createConstrainedExecutionContext(TestingGraphMockHandler graphTestHandler, String ruleId, Class<?> constrainedType) {
ContextualGraphCommandExecutionContext executionContext = createExecutionContext(graphTestHandler);
RuleExtension edge1ParentMatch = new RuleExtension("connectorParentMatchExtRule", ruleId).setHandlerType(ConnectorParentsMatchHandler.class).setArguments(new String[] { RULE_ERROR_MESSAGE }).setTypeArguments(new Class[] { constrainedType });
graphTestHandler.ruleSet.getRules().add(edge1ParentMatch);
return executionContext;
}
Aggregations