@Test public void testCreateLayeredGraph() { final Node n1 = createNode("id1"); final Node n2 = createNode("id2"); final List<Node> nodes = Arrays.asList(n1, n2); final LayeredGraph layeredGraph = mock(LayeredGraph.class); doReturn(layeredGraph).when(layoutService).getLayeredGraph(); doNothing().when(layoutService).addInEdges(layeredGraph, n1); doNothing().when(layoutService).addOutEdges(layeredGraph, n1); doNothing().when(layoutService).addInEdges(layeredGraph, n2); doNothing().when(layoutService).addOutEdges(layeredGraph, n2); layoutService.createLayeredGraph(nodes); verify(layoutService).addInEdges(layeredGraph, n1); verify(layoutService).addInEdges(layeredGraph, n2); verify(layoutService).addOutEdges(layeredGraph, n1); verify(layoutService).addOutEdges(layeredGraph, n2); }
LayeredGraph createLayeredGraph(final Iterable<? extends Node> nodes) { final LayeredGraph layeredGraph = getLayeredGraph(); for (final Node n : nodes) { addInEdges(layeredGraph, n); addOutEdges(layeredGraph, n); } return layeredGraph; }
SugiyamaLayoutService extends AbstractLayoutService { LayeredGraph createLayeredGraph(final Iterable<? extends Node> nodes) { final LayeredGraph layeredGraph = getLayeredGraph(); for (final Node n : nodes) { addInEdges(layeredGraph, n); addOutEdges(layeredGraph, n); } return layeredGraph; } }
SugiyamaLayoutService extends AbstractLayoutService { LayeredGraph createLayeredGraph(final Iterable<? extends Node> nodes) { final LayeredGraph layeredGraph = getLayeredGraph(); for (final Node n : nodes) { addInEdges(layeredGraph, n); addOutEdges(layeredGraph, n); } return layeredGraph; } @Inject  SugiyamaLayoutService(final CycleBreaker cycleBreaker,
                                 final VertexLayerer vertexLayerer,
                                 final VertexOrdering vertexOrdering,
                                 final VertexPositioning vertexPositioning,
                                 final GraphProcessor graphProcessor); }
SugiyamaLayoutService extends AbstractLayoutService { LayeredGraph createLayeredGraph(final Iterable<? extends Node> nodes) { final LayeredGraph layeredGraph = getLayeredGraph(); for (final Node n : nodes) { addInEdges(layeredGraph, n); addOutEdges(layeredGraph, n); } return layeredGraph; } @Inject  SugiyamaLayoutService(final CycleBreaker cycleBreaker,
                                 final VertexLayerer vertexLayerer,
                                 final VertexOrdering vertexOrdering,
                                 final VertexPositioning vertexPositioning,
                                 final GraphProcessor graphProcessor); @Override Layout createLayout(final Graph<?, ?> graph); }
SugiyamaLayoutService extends AbstractLayoutService { LayeredGraph createLayeredGraph(final Iterable<? extends Node> nodes) { final LayeredGraph layeredGraph = getLayeredGraph(); for (final Node n : nodes) { addInEdges(layeredGraph, n); addOutEdges(layeredGraph, n); } return layeredGraph; } @Inject  SugiyamaLayoutService(final CycleBreaker cycleBreaker,
                                 final VertexLayerer vertexLayerer,
                                 final VertexOrdering vertexOrdering,
                                 final VertexPositioning vertexPositioning,
                                 final GraphProcessor graphProcessor); @Override Layout createLayout(final Graph<?, ?> graph);  }