@Test public void testSimple() { reader.readPom(ROOT_DIR_SIMPLE); assertThat(dependencyGraph.getAllNodes()).hasSize(5); Node abc = assertNode("com.mycompany.abc:abc"); Node abcApi = assertNode("com.mycompany.abc:abc-api"); Node common = assertNode("com.mycompany.common:common-util"); Node guava = assertNode("com.google.guava:guava"); Node tester = assertNode("org.testtools:tester"); assertThat(dependencyGraph.getAllEdges()).hasSize(4); assertEdge(abc, abcApi, DependencyType.COMPILE); assertEdge(abc, common, DependencyType.COMPILE); assertEdge(abc, guava, DependencyType.COMPILE); assertEdge(abc, tester, DependencyType.TEST); }
public Node readPom(String dirname) { LOGGER.debug("Read pom file in directory: {}", dirname); FileSystemUtil.assertFileOrResourceExists(dirname); MavenProject bean = readFile(dirname); Node node = mapInput(bean); node.setProperty(Constants.SCOPE, "input"); bean.getModules().forEach(module -> { Node child = readPom(dirname + "/" + module); dependencyGraph.addDependency(node, child, DependencyType.CONTAINS); }
MavenInputReader { public Node readPom(String dirname) { LOGGER.debug("Read pom file in directory: {}", dirname); FileSystemUtil.assertFileOrResourceExists(dirname); MavenProject bean = readFile(dirname); Node node = mapInput(bean); node.setProperty(Constants.SCOPE, "input"); bean.getModules().forEach(module -> { Node child = readPom(dirname + "/" + module); dependencyGraph.addDependency(node, child, DependencyType.CONTAINS); } }
MavenInputReader { public Node readPom(String dirname) { LOGGER.debug("Read pom file in directory: {}", dirname); FileSystemUtil.assertFileOrResourceExists(dirname); MavenProject bean = readFile(dirname); Node node = mapInput(bean); node.setProperty(Constants.SCOPE, "input"); bean.getModules().forEach(module -> { Node child = readPom(dirname + "/" + module); dependencyGraph.addDependency(node, child, DependencyType.CONTAINS); } MavenInputReader(DependencyGraph dependencyGraph); }
MavenInputReader { public Node readPom(String dirname) { LOGGER.debug("Read pom file in directory: {}", dirname); FileSystemUtil.assertFileOrResourceExists(dirname); MavenProject bean = readFile(dirname); Node node = mapInput(bean); node.setProperty(Constants.SCOPE, "input"); bean.getModules().forEach(module -> { Node child = readPom(dirname + "/" + module); dependencyGraph.addDependency(node, child, DependencyType.CONTAINS); } MavenInputReader(DependencyGraph dependencyGraph); Node readPom(String dirname); }
MavenInputReader { public Node readPom(String dirname) { LOGGER.debug("Read pom file in directory: {}", dirname); FileSystemUtil.assertFileOrResourceExists(dirname); MavenProject bean = readFile(dirname); Node node = mapInput(bean); node.setProperty(Constants.SCOPE, "input"); bean.getModules().forEach(module -> { Node child = readPom(dirname + "/" + module); dependencyGraph.addDependency(node, child, DependencyType.CONTAINS); } MavenInputReader(DependencyGraph dependencyGraph); Node readPom(String dirname);  }