use of org.kie.workbench.common.stunner.core.TestingGraphMockHandler in project kie-wb-common by kiegroup.
the class ShapeUtilsTest method setup.
@Before
@SuppressWarnings("unchecked")
public void setup() throws Exception {
final TestingGraphMockHandler graphTestHandler = new TestingGraphMockHandler();
instance2 = TestingGraphInstanceBuilder.newGraph2(graphTestHandler);
when(canvasHandler.getCanvas()).thenReturn(canvas);
when(canvasHandler.getGraphIndex()).thenReturn(graphIndex);
when(graphIndex.getGraph()).thenReturn(instance2.graph);
final String e1 = instance2.edge1.getUUID();
final String e2 = instance2.edge2.getUUID();
when(canvas.getShape(eq(e1))).thenReturn(edge1Shape);
when(canvas.getShape(eq(e2))).thenReturn(edge2Shape);
when(edge1Shape.getShapeView()).thenReturn(edge1ShapeView);
when(edge2Shape.getShapeView()).thenReturn(edge2ShapeView);
controlPoint1 = new ControlPointImpl(0, 0);
controlPointList = Arrays.asList(controlPoint1);
when(edge1Shape.getControlPoints()).thenReturn(controlPointList);
when(edge1Shape.addControlPoints(controlPoint1)).thenReturn(controlPointList);
}
use of org.kie.workbench.common.stunner.core.TestingGraphMockHandler in project kie-wb-common by kiegroup.
the class DiagramValidatorlTest method setup.
@Before
public void setup() throws Exception {
this.graphTestHandler = new TestingGraphMockHandler();
when(diagram.getName()).thenReturn("Test diagram");
when(diagram.getMetadata()).thenReturn(metadata);
this.tested = new TestDiagramValidator();
}
use of org.kie.workbench.common.stunner.core.TestingGraphMockHandler in project kie-wb-common by kiegroup.
the class GraphValidatorImplTest method setup.
@Before
@SuppressWarnings("unchecked")
public void setup() throws Exception {
this.graphTestHandler = new TestingGraphMockHandler();
when(graphTestHandler.definitionSetRegistry.getDefinitionSetById(eq(DEF_SET_ID))).thenReturn(defSetBean);
when(graphTestHandler.ruleAdapter.getRuleSet(eq(defSetBean))).thenReturn(graphTestHandler.ruleSet);
this.tested = new GraphValidatorImpl(graphTestHandler.definitionManager, graphTestHandler.ruleManager, new TreeWalkTraverseProcessorImpl());
}
use of org.kie.workbench.common.stunner.core.TestingGraphMockHandler in project kie-wb-common by kiegroup.
the class DeleteNodeCommandTest method setup.
@Before
public void setup() throws Exception {
TestingGraphMockHandler graphHandler = new TestingGraphMockHandler();
this.graphHolder = TestingGraphInstanceBuilder.newGraph2(graphHandler);
when(canvasHandler.getDiagram()).thenReturn(diagram);
when(canvasHandler.getCanvas()).thenReturn(canvas);
when(canvasHandler.getGraphIndex()).thenReturn(graphHandler.graphIndex);
when(canvasHandler.getGraphExecutionContext()).thenReturn(graphHandler.graphCommandExecutionContext);
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());
}
use of org.kie.workbench.common.stunner.core.TestingGraphMockHandler in project kie-wb-common by kiegroup.
the class RemoveCanvasChildCommandTest 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 RemoveCanvasChildCommand(graph1Instance.startNode, graph1Instance.intermNode);
}
Aggregations