Search in sources :

Example 11 with ChildrenTraverseProcessorImpl

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);
}
Also used : ChildrenTraverseProcessorImpl(org.kie.workbench.common.stunner.core.graph.processing.traverse.content.ChildrenTraverseProcessorImpl) ViewTraverseProcessorImpl(org.kie.workbench.common.stunner.core.graph.processing.traverse.content.ViewTraverseProcessorImpl) TreeWalkTraverseProcessorImpl(org.kie.workbench.common.stunner.core.graph.processing.traverse.tree.TreeWalkTraverseProcessorImpl) Before(org.junit.Before)

Example 12 with ChildrenTraverseProcessorImpl

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);
}
Also used : ChildrenTraverseProcessor(org.kie.workbench.common.stunner.core.graph.processing.traverse.content.ChildrenTraverseProcessor) ChildrenTraverseProcessorImpl(org.kie.workbench.common.stunner.core.graph.processing.traverse.content.ChildrenTraverseProcessorImpl) GraphBoundsIndexerImpl(org.kie.workbench.common.stunner.core.graph.processing.index.bounds.GraphBoundsIndexerImpl) TestingGraphMockHandler(org.kie.workbench.common.stunner.core.TestingGraphMockHandler) TreeWalkTraverseProcessorImpl(org.kie.workbench.common.stunner.core.graph.processing.traverse.tree.TreeWalkTraverseProcessorImpl) Before(org.junit.Before)

Example 13 with ChildrenTraverseProcessorImpl

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));
}
Also used : Node(org.kie.workbench.common.stunner.core.graph.Node) ChildrenTraverseProcessorImpl(org.kie.workbench.common.stunner.core.graph.processing.traverse.content.ChildrenTraverseProcessorImpl) TreeWalkTraverseProcessorImpl(org.kie.workbench.common.stunner.core.graph.processing.traverse.tree.TreeWalkTraverseProcessorImpl) Test(org.junit.Test)

Example 14 with ChildrenTraverseProcessorImpl

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));
}
Also used : ChildrenTraverseProcessorImpl(org.kie.workbench.common.stunner.core.graph.processing.traverse.content.ChildrenTraverseProcessorImpl) TreeWalkTraverseProcessorImpl(org.kie.workbench.common.stunner.core.graph.processing.traverse.tree.TreeWalkTraverseProcessorImpl) Test(org.junit.Test)

Aggregations

ChildrenTraverseProcessorImpl (org.kie.workbench.common.stunner.core.graph.processing.traverse.content.ChildrenTraverseProcessorImpl)14 TreeWalkTraverseProcessorImpl (org.kie.workbench.common.stunner.core.graph.processing.traverse.tree.TreeWalkTraverseProcessorImpl)14 Node (org.kie.workbench.common.stunner.core.graph.Node)7 Before (org.junit.Before)5 Test (org.junit.Test)5 TestingGraphMockHandler (org.kie.workbench.common.stunner.core.TestingGraphMockHandler)3 Edge (org.kie.workbench.common.stunner.core.graph.Edge)3 View (org.kie.workbench.common.stunner.core.graph.content.view.View)3 HashSet (java.util.HashSet)2 List (java.util.List)2 Element (org.kie.workbench.common.stunner.core.graph.Element)2 Graph (org.kie.workbench.common.stunner.core.graph.Graph)2 ViewConnector (org.kie.workbench.common.stunner.core.graph.content.view.ViewConnector)2 Collection (java.util.Collection)1 HashMap (java.util.HashMap)1 Optional (java.util.Optional)1 Set (java.util.Set)1 Stack (java.util.Stack)1 Function (java.util.function.Function)1 Predicate (java.util.function.Predicate)1