use of org.kie.workbench.common.stunner.core.graph.processing.traverse.content.ChildrenTraverseProcessorImpl in project kie-wb-common by kiegroup.
the class CaseManagementCanvasCommandFactoryTest method setup.
@Before
public void setup() {
when(childrenTraverseProcessorInstances.get()).thenReturn(new ChildrenTraverseProcessorImpl(new TreeWalkTraverseProcessorImpl()));
when(viewTraverseProcessorInstances.get()).thenReturn(new ViewTraverseProcessorImpl(new TreeWalkTraverseProcessorImpl()));
this.factory = new CaseManagementCanvasCommandFactory(childrenTraverseProcessorInstances, null);
}
use of org.kie.workbench.common.stunner.core.graph.processing.traverse.content.ChildrenTraverseProcessorImpl in project kie-wb-common by kiegroup.
the class GraphBoundsIndexerImplTest method setup.
@Before
public void setup() {
this.graphTestHandlerParent = new TestingGraphMockHandler();
graphInstanceParent = TestingGraphInstanceBuilder.newGraph2(graphTestHandlerParent);
ChildrenTraverseProcessor childrenTraverseProcessor = new ChildrenTraverseProcessorImpl(new TreeWalkTraverseProcessorImpl());
graphBoundsIndexerImpl = new GraphBoundsIndexerImpl(childrenTraverseProcessor);
graphBoundsIndexerImpl.build(graphInstanceParent.graph);
}
use of org.kie.workbench.common.stunner.core.graph.processing.traverse.content.ChildrenTraverseProcessorImpl 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.content.ChildrenTraverseProcessorImpl 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