use of org.kie.workbench.common.stunner.core.graph.command.impl.SetChildrenCommand in project kie-wb-common by kiegroup.
the class ConnectorParentsMatchLevel2Tests method testMoveIntermNodeIntoParentNode.
@Test
@SuppressWarnings("unchecked")
public void testMoveIntermNodeIntoParentNode() {
ContextualGraphCommandExecutionContext executionContext = createExecutionContext();
SetChildrenCommand setChildren = new SetChildrenCommand(graph.parentNode, graph.intermNode);
CommandResult<RuleViolation> result = setChildren.allow(executionContext);
assertRuleFailedResult(result);
}
use of org.kie.workbench.common.stunner.core.graph.command.impl.SetChildrenCommand in project kie-wb-common by kiegroup.
the class ConnectorParentsMatchLevel2Tests method testMoveSomeConnectedNodesIntoParentNode.
@Test
@SuppressWarnings("unchecked")
public void testMoveSomeConnectedNodesIntoParentNode() {
SetChildrenCommand setChildren = new SetChildrenCommand(graph.parentNode, Arrays.asList(graph.startNode, graph.endNode));
ContextualGraphCommandExecutionContext executionContext = createExecutionContext();
CommandResult<RuleViolation> result = setChildren.allow(executionContext);
assertRuleFailedResult(result);
}
use of org.kie.workbench.common.stunner.core.graph.command.impl.SetChildrenCommand in project kie-wb-common by kiegroup.
the class ConnectorParentsMatchLevel2Tests method testMoveStartNodeIntoNodeB.
@Test
@SuppressWarnings("unchecked")
public void testMoveStartNodeIntoNodeB() {
ContextualGraphCommandExecutionContext executionContext = createExecutionContext();
SetChildrenCommand setChildren = new SetChildrenCommand(graph.nodeB, 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.impl.SetChildrenCommand in project kie-wb-common by kiegroup.
the class ConnectorParentsMatchLevel2Tests method testMoveStartNodeIntoSubProcessNode.
@Test
@SuppressWarnings("unchecked")
public void testMoveStartNodeIntoSubProcessNode() {
SetChildrenCommand setChildren = new SetChildrenCommand(graph.subProcessNode, graph.startNode);
ContextualGraphCommandExecutionContext executionContext = createExecutionContext();
CommandResult<RuleViolation> result = setChildren.allow(executionContext);
assertSuccessfullResult(result);
}
use of org.kie.workbench.common.stunner.core.graph.command.impl.SetChildrenCommand in project kie-wb-common by kiegroup.
the class ConnectorParentsMatchLevel2Tests method testMoveSomeConnectedNodesIntoSubProcessNode.
@Test
@SuppressWarnings("unchecked")
public void testMoveSomeConnectedNodesIntoSubProcessNode() {
SetChildrenCommand setChildren = new SetChildrenCommand(graph.subProcessNode, Arrays.asList(graph.startNode, graph.endNode));
ContextualGraphCommandExecutionContext executionContext = createExecutionContext();
CommandResult<RuleViolation> result = setChildren.allow(executionContext);
assertSuccessfullResult(result);
}
Aggregations