FormattedGraphParser { public FormattedGraph parseFormattedGraph() throws InvalidConfigurationException { if (formattedGraph != null) { return formattedGraph; } parseBasicGraphConfiguration(); parseVertexPropertiesConfiguration(); parseEdgePropertiesConfiguration(); formattedGraph = new FormattedGraph(name, vertexCount, edgeCount, isDirected, vertexFilePath, edgeFilePath, vertexProperties, edgeProperties); return formattedGraph; } FormattedGraphParser(Configuration graphConfigurationSubset, String name, String graphRootDirectory); FormattedGraph parseFormattedGraph();  }
@Test public void testParseGraphOnBasicConfiguration() throws InvalidConfigurationException { final String ROOT_DIR = "graph-root-dir"; final Fixture FIXTURE = constructBasicGraph(ROOT_DIR); FormattedGraphParser parser = new FormattedGraphParser(FIXTURE.getConfiguration(), FIXTURE.getGraphName(), ROOT_DIR); assertGraphEqual(FIXTURE.getExpectedGraph(), parser.parseFormattedGraph()); }
@Test public void testParseGraphOnVertexPropertiesConfiguration() throws InvalidConfigurationException { final String ROOT_DIR = "graph-root-dir"; final Fixture FIXTURE = constructVertexPropertyGraph(ROOT_DIR); FormattedGraphParser parser = new FormattedGraphParser(FIXTURE.getConfiguration(), FIXTURE.getGraphName(), ROOT_DIR); assertGraphEqual(FIXTURE.getExpectedGraph(), parser.parseFormattedGraph()); }
@Test public void testParseGraphOnEdgePropertiesConfiguration() throws InvalidConfigurationException { final String ROOT_DIR = "graph-root-dir"; final Fixture FIXTURE = constructEdgePropertyGraph(ROOT_DIR); FormattedGraphParser parser = new FormattedGraphParser(FIXTURE.getConfiguration(), FIXTURE.getGraphName(), ROOT_DIR); assertGraphEqual(FIXTURE.getExpectedGraph(), parser.parseFormattedGraph()); }