GraphMLExporter { public void exportGraph() { writeArchitecture(); writeNodes(); writeEdges(); finish(); } GraphMLExporter(DependencyGraph dependencyGraph, String fileNameBase, Architecture architecture,
                           List<Abbreviation> abbreviationsList,
                           boolean createEdgeLabels); void exportGraph(); static final String GRAPHML_STG; static final String FILE_ST; static final String NODE_ST; static final String EDGE_ST; static final String EDGE_LABEL_ST; static final String COMPONENT_ST; static final String ID_ATT; static final String NAME_ATT; static final String NODES_ATT; static final String EDGES_ATT; static final String EDGE_LABEL_ATT; }
@Test public void exportGraphWithEdgeLabels() { String fileNameBase = "build/test-output/test_01"; GraphMLExporter graphMLExporter = new GraphMLExporter(dependencyGraph, fileNameBase, architecture, new ArrayList<>(), true); graphMLExporter.exportGraph(); String graphML = FileSystemUtil.readFileAsText(fileNameBase + ".graphml"); assertThat(graphML, notNullValue()); assertThat(graphML, containsString("root.c1.n1")); assertThat(graphML, containsString("<y:EdgeLabel")); }
@Test public void exportGraphWithoutEdgeLabels() { String fileNameBase = "build/test-output/test_02"; GraphMLExporter graphMLExporter = new GraphMLExporter(dependencyGraph, fileNameBase, architecture, new ArrayList<>(), false); graphMLExporter.exportGraph(); String graphML = FileSystemUtil.readFileAsText(fileNameBase + ".graphml"); assertThat(graphML, notNullValue()); assertThat(graphML, not(containsString("<y:EdgeLabel"))); }