@Test public void getGraphOfModuleWithOneArtifactAndDependencyOfEachType(){ repoHandler.loadTestCase(new TC02_ModuleWithOneArtifactAndDependencyOfEachType()); final String moduleId = DbModule.generateID(TC02_ModuleWithOneArtifactAndDependencyOfEachType.MODULE_NAME, TC02_ModuleWithOneArtifactAndDependencyOfEachType.MODULE_VERSION); AbstractGraph graph = graph = graphHandler.getModuleGraph(moduleId); assertNotNull(graph); assertEquals(5, graph.getElements().size()); assertEquals(4, graph.getDependencies().size()); GraphDependency compDependency = null, runDependency = null, proDependency = null, testDependency = null; for(GraphDependency dependency: graph.getDependencies()){ if(dependency.getType().equals(Scope.COMPILE.toString())){ compDependency = dependency; } else if(dependency.getType().equals(Scope.PROVIDED.toString())){ proDependency = dependency; } else if(dependency.getType().equals(Scope.RUNTIME.toString())){ runDependency = dependency; } else if(dependency.getType().equals(Scope.TEST.toString())){ testDependency = dependency; } } assertNotNull(compDependency); assertEquals(TC02_ModuleWithOneArtifactAndDependencyOfEachType.MODULE_NAME, compDependency.getSource()); assertEquals(TC02_ModuleWithOneArtifactAndDependencyOfEachType.COMPILE_DEPENDENCY_MODULE, compDependency.getTarget()); assertNotNull(proDependency); assertNotNull(runDependency); assertNotNull(testDependency); }
public AbstractGraph getModuleGraph(final String moduleId) { final ModuleHandler moduleHandler = new ModuleHandler(repoHandler); final DbModule module = moduleHandler.getModule(moduleId); final DbOrganization organization = moduleHandler.getOrganization(module); filters.setCorporateFilter(new CorporateFilter(organization)); final AbstractGraph graph = new ModuleGraph(); addModuleToGraph(module, graph, 0); return graph; }
GraphsHandler { public AbstractGraph getModuleGraph(final String moduleId) { final ModuleHandler moduleHandler = new ModuleHandler(repoHandler); final DbModule module = moduleHandler.getModule(moduleId); final DbOrganization organization = moduleHandler.getOrganization(module); filters.setCorporateFilter(new CorporateFilter(organization)); final AbstractGraph graph = new ModuleGraph(); addModuleToGraph(module, graph, 0); return graph; } }
GraphsHandler { public AbstractGraph getModuleGraph(final String moduleId) { final ModuleHandler moduleHandler = new ModuleHandler(repoHandler); final DbModule module = moduleHandler.getModule(moduleId); final DbOrganization organization = moduleHandler.getOrganization(module); filters.setCorporateFilter(new CorporateFilter(organization)); final AbstractGraph graph = new ModuleGraph(); addModuleToGraph(module, graph, 0); return graph; } GraphsHandler(final RepositoryHandler repoHandler, final FiltersHolder filters); }
GraphsHandler { public AbstractGraph getModuleGraph(final String moduleId) { final ModuleHandler moduleHandler = new ModuleHandler(repoHandler); final DbModule module = moduleHandler.getModule(moduleId); final DbOrganization organization = moduleHandler.getOrganization(module); filters.setCorporateFilter(new CorporateFilter(organization)); final AbstractGraph graph = new ModuleGraph(); addModuleToGraph(module, graph, 0); return graph; } GraphsHandler(final RepositoryHandler repoHandler, final FiltersHolder filters); AbstractGraph getModuleGraph(final String moduleId); TreeNode getModuleTree(final String moduleId); }
GraphsHandler { public AbstractGraph getModuleGraph(final String moduleId) { final ModuleHandler moduleHandler = new ModuleHandler(repoHandler); final DbModule module = moduleHandler.getModule(moduleId); final DbOrganization organization = moduleHandler.getOrganization(module); filters.setCorporateFilter(new CorporateFilter(organization)); final AbstractGraph graph = new ModuleGraph(); addModuleToGraph(module, graph, 0); return graph; } GraphsHandler(final RepositoryHandler repoHandler, final FiltersHolder filters); AbstractGraph getModuleGraph(final String moduleId); TreeNode getModuleTree(final String moduleId);  }