use of org.kie.workbench.common.stunner.core.TestingGraphMockHandler in project kie-wb-common by kiegroup.
the class SetCanvasChildNodeCommandTest method setUp.
@Before
@SuppressWarnings("unchecked")
public void setUp() throws Exception {
super.setUp();
TestingGraphMockHandler graphTestHandler = new TestingGraphMockHandler();
graph1Instance = TestingGraphInstanceBuilder.newGraph1(graphTestHandler);
when(diagram.getGraph()).thenReturn(graph1Instance.graph);
when(graphIndex.getGraph()).thenReturn(graph1Instance.graph);
final String edge1UUID = graph1Instance.edge1.getUUID();
final String edge2UUID = graph1Instance.edge2.getUUID();
when(canvas.getShape(edge1UUID)).thenReturn(connectorShape1);
when(canvas.getShape(edge2UUID)).thenReturn(connectorShape2);
when(connectorShape1.getShapeView()).thenReturn(connectorShapeView1);
when(connectorShape2.getShapeView()).thenReturn(connectorShapeView2);
this.tested = new SetCanvasChildNodeCommand(graph1Instance.startNode, graph1Instance.intermNode);
}
use of org.kie.workbench.common.stunner.core.TestingGraphMockHandler in project kie-wb-common by kiegroup.
the class UpdateDockNodeCommandTest method setup.
@Before
@SuppressWarnings("unchecked")
public void setup() throws Exception {
this.graphHandler = new TestingGraphMockHandler();
this.graphHolder = TestingGraphInstanceBuilder.newGraph2(graphHandler);
this.laneNode = graphHandler.newViewNode(LANE_UUID, Optional.empty(), 50, 59, 500, 500);
graphHandler.setChild(graphHolder.parentNode, laneNode);
graphHandler.removeChild(graphHolder.parentNode, graphHolder.endNode);
graphHandler.setChild(laneNode, graphHolder.endNode);
this.dockNode = graphHandler.newViewNode(DOCK_UUID, Optional.empty(), 0, 0, 15, 15);
graphHandler.setChild(graphHolder.parentNode, dockNode);
when(canvasHandler.getDiagram()).thenReturn(diagram);
when(canvasHandler.getCanvas()).thenReturn(canvas);
when(canvasHandler.getGraphIndex()).thenReturn(graphHandler.graphIndex);
when(diagram.getMetadata()).thenReturn(metadata);
when(diagram.getGraph()).thenReturn(graphHandler.graph);
when(metadata.getDefinitionSetId()).thenReturn(TestingGraphMockHandler.DEF_SET_ID);
when(metadata.getShapeSetId()).thenReturn(SHAPE_SET_ID);
when(metadata.getCanvasRootUUID()).thenReturn(graphHolder.parentNode.getUUID());
this.tested = new UpdateDockNodeCommand(graphHolder.endNode, dockNode);
}
use of org.kie.workbench.common.stunner.core.TestingGraphMockHandler in project kie-wb-common by kiegroup.
the class NodeFactoryImplTest method setup.
@Before
@SuppressWarnings("unchecked")
public void setup() throws Exception {
this.testingkHelper = new TestingGraphMockHandler();
when(testingkHelper.definitionAdapter.getId(eq(definition))).thenReturn(ID);
when(testingkHelper.definitionAdapter.getLabels(eq(definition))).thenReturn(LABELS);
when(definitionUtils.getDefinitionManager()).thenReturn(testingkHelper.definitionManager);
when(definitionUtils.buildBounds(eq(definition), anyDouble(), anyDouble())).thenReturn(BOUNDS);
this.tested = new NodeFactoryImpl(definitionUtils);
}
use of org.kie.workbench.common.stunner.core.TestingGraphMockHandler 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.TestingGraphMockHandler 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());
}
Aggregations