@Test public void layoutHorizontalTreeViaAttribute() { GraphWidget graph = parse("graph Sample{rankdir=LR;1;}"); // $NON-NLS-1$ Assert.assertNotNull("Created graph must not be null", graph); // $NON-NLS-1$ Assert.assertEquals(TreeLayoutAlgorithm.class, graph.getLayoutAlgorithm().getClass()); Assert.assertEquals( TreeLayoutAlgorithm.LEFT_RIGHT, ((TreeLayoutAlgorithm) (graph.getLayoutAlgorithm())).getDirection()); }
@Test public void layoutTree() { GraphWidget graph = parse("graph Sample{graph[layout=dot];1;}"); // $NON-NLS-1$ Assert.assertNotNull("Created graph must not be null", graph); // $NON-NLS-1$ Assert.assertEquals(TreeLayoutAlgorithm.class, graph.getLayoutAlgorithm().getClass()); }