DotExporter { public void exportGraph() { writeClusters(); writeNodes(); writeEdges(); finish(); } DotExporter(DependencyGraph dependencyGraph, String fileNameBase, Architecture architecture,
                       List<Abbreviation> abbreviationsList,
                       boolean createEdgeLabels); void exportGraph(); static final int MAX_NODES_FOR_DOT_CREATION; static final String DOT_STG; static final String FILE_ST; static final String NODE_ST; static final String EDGE_ST; static final String CLUSTER_ST; static final String ID_ATT; static final String NAME_ATT; static final String URL_ATT; static final String LABEL_ATT; static final String HEAD_LABEL_ATT; static final String TAIL_LABEL_ATT; static final String STYLE_ATT; static final String NODES_ATT; static final String EDGES_ATT; static final String CLUSTERS_ATT; static final String FROM_ATT; static final String TO_ATT; }
@Test public void exportGraphWithEdgeLabels() { String fileNameBase = "build/test-output/test_01"; DotExporter dotExporter = new DotExporter(dependencyGraph, fileNameBase, architecture, new ArrayList<>(), true); dotExporter.exportGraph(); String graphML = FileSystemUtil.readFileAsText(fileNameBase + ".dot"); assertThat(graphML, notNullValue()); assertThat(graphML, containsString("root.c1.n1")); assertThat(graphML, containsString("_root_c1 -> _root_c2 [ color = \"#67001f\", fontcolor = \"#67001f\", penwidth = 3.0, style = dashed , label=\"2\", headlabel=\"1\", taillabel=\"2\"];")); }
@Test public void exportGraphWithoutEdgeLabels() { String fileNameBase = "build/test-output/test_02"; DotExporter dotExporter = new DotExporter(dependencyGraph, fileNameBase, architecture, new ArrayList<>(), false); dotExporter.exportGraph(); String graphML = FileSystemUtil.readFileAsText(fileNameBase + ".dot"); assertThat(graphML, notNullValue()); assertThat(graphML, not(containsString("_root_c1 -> _root_c2 [ color = \"#000000\", fontcolor = \"#000000\", penwidth = 3.0, style = dashed , label=\"2\", headlabel=\"1\", taillabel=\"2\"];"))); }