@Test public void testRead() { reader.readPom(ROOT_DIR); assertThat(dependencyGraph.getAllNodes()).hasSize(10); Node pki = assertNode("com.mycompany.pki:pki"); Node pkiApi = assertNode("com.mycompany.pki:pki-api"); Node pkiServer = assertNode("com.mycompany.pki:pki-server"); Node commonUtil = assertNode("com.mycompany.common:common-util"); Node parent = assertNode("com.mycompany:mycompany-parent"); Node tester = assertNode("org.testtools:tester"); assertNode("joda-time:joda-time"); assertThat(dependencyGraph.getNode("joda-time")).isNull(); assertThat(dependencyGraph.getAllEdges()).hasSize(13); assertEdge(pki, parent, DependencyType.INHERIT); assertEdge(pki, pkiApi, DependencyType.CONTAINS); assertEdge(pkiApi, commonUtil, DependencyType.COMPILE); assertEdge(pkiServer, tester, DependencyType.TEST); GraphExporter.export(dependencyGraph, OUTPUT_DIR + "/mavenTest", new Architecture(), new ArrayList<>(), false); }
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);  }