use of org.kie.workbench.common.stunner.core.graph.processing.traverse.tree.TreeWalkTraverseProcessorImpl in project kie-wb-common by kiegroup.
the class ChildrenTraverseProcessorImplTest method setup.
@Before
public void setup() {
this.graphTestHandler = new TestingGraphMockHandler();
this.tested = new ChildrenTraverseProcessorImpl(new TreeWalkTraverseProcessorImpl());
}
use of org.kie.workbench.common.stunner.core.graph.processing.traverse.tree.TreeWalkTraverseProcessorImpl in project kie-wb-common by kiegroup.
the class SafeDeleteNodeProcessorTest method testDeleteIntermediateNode.
@Test
@SuppressWarnings("unchecked")
public void testDeleteIntermediateNode() {
this.tested = new SafeDeleteNodeProcessor(new ChildrenTraverseProcessorImpl(new TreeWalkTraverseProcessorImpl()), graphHolder.graph, graphHolder.intermNode);
tested.run(callback);
verify(callback, times(1)).deleteCandidateConnector(eq(graphHolder.edge1));
verify(callback, times(1)).deleteCandidateConnector(eq(graphHolder.edge2));
verify(callback, times(1)).removeChild(eq(graphHolder.parentNode), eq(graphHolder.intermNode));
verify(callback, times(1)).deleteCandidateNode(eq(graphHolder.intermNode));
verify(callback, never()).removeDock(any(Node.class), any(Node.class));
}
use of org.kie.workbench.common.stunner.core.graph.processing.traverse.tree.TreeWalkTraverseProcessorImpl in project kie-wb-common by kiegroup.
the class SafeDeleteNodeProcessorTest method testDeleteParentNode.
@Test
@SuppressWarnings("unchecked")
public void testDeleteParentNode() {
this.tested = new SafeDeleteNodeProcessor(new ChildrenTraverseProcessorImpl(new TreeWalkTraverseProcessorImpl()), graphHolder.graph, graphHolder.parentNode);
tested.run(callback);
verify(callback, times(1)).deleteConnector(eq(graphHolder.edge2));
verify(callback, times(1)).removeChild(eq(graphHolder.parentNode), eq(graphHolder.endNode));
verify(callback, times(1)).deleteNode(eq(graphHolder.endNode));
verify(callback, times(1)).deleteConnector(eq(graphHolder.edge1));
verify(callback, times(1)).deleteConnector(eq(graphHolder.edge2));
verify(callback, times(1)).removeChild(eq(graphHolder.parentNode), eq(graphHolder.intermNode));
verify(callback, times(1)).deleteNode(eq(graphHolder.intermNode));
verify(callback, times(1)).deleteConnector(eq(graphHolder.edge1));
verify(callback, times(1)).removeChild(eq(graphHolder.parentNode), eq(graphHolder.startNode));
verify(callback, times(1)).deleteNode(eq(graphHolder.startNode));
verify(callback, times(1)).deleteCandidateNode(eq(graphHolder.parentNode));
}
Aggregations