test_class.declarator: resolver
test_class.modifier: private
test_class.original_string: private MavenDependencyResolver resolver;
test_class.type: MavenDependencyResolver
test_class.var_name: resolver
test_class.declarator: addonFilter = new Predicate<Dependency>()
     {
        @Override
        public boolean accept(Dependency dependency)
        {
           return "forge-addon".equals(dependency.getCoordinate().getClassifier());
        }
     }
test_class.modifier: private
test_class.original_string: private Predicate<Dependency> addonFilter = new Predicate<Dependency>()
     {
        @Override
        public boolean accept(Dependency dependency)
        {
           return "forge-addon".equals(dependency.getCoordinate().getClassifier());
        }
     };
test_class.type: Predicate<Dependency>
test_class.var_name: addonFilter
test_class.file: maven/impl/src/test/java/org/jboss/forge/addon/maven/dependencies/MavenDependencyResolverTest.java
test_class.identifier: MavenDependencyResolverTest
test_case.body: @Test
     public void testResolveDependencyHierarchy() throws Exception
     {
        DependencyNode root = resolver
                 .resolveDependencyHierarchy(DependencyQueryBuilder
                          .create("org.jboss.forge:resources:jar:forge-addon:2.0.0.Alpha3"));
        Assert.assertNotNull(root);
        Assert.assertEquals(5, root.getChildren().size());
        Assert.assertEquals("convert", root.getChildren().get(1).getDependency().getCoordinate().getArtifactId());
        // TODO: ui-hints was changed to ui-spi since 2.0.0.Alpha5
        Assert.assertEquals("ui-hints", root.getChildren().get(2).getDependency().getCoordinate().getArtifactId());
     }
test_case.class_method_signature: MavenDependencyResolverTest.testResolveDependencyHierarchy()
test_case.full_signature: @Test public void testResolveDependencyHierarchy()
test_case.identifier: testResolveDependencyHierarchy
test_case.invocations: resolveDependencyHierarchy create assertNotNull assertEquals size getChildren assertEquals getArtifactId getCoordinate getDependency get getChildren assertEquals getArtifactId getCoordinate getDependency get getChildren
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testResolveDependencyHierarchy()
focal_class.declarator: container = new MavenContainer()
focal_class.modifier: private final
focal_class.original_string: private final MavenContainer container = new MavenContainer();
focal_class.type: MavenContainer
focal_class.var_name: container
focal_class.declarator: resourceFactory
focal_class.modifier: private
focal_class.original_string: private ResourceFactory resourceFactory;
focal_class.type: ResourceFactory
focal_class.var_name: resourceFactory
focal_class.file: maven/impl/src/main/java/org/jboss/forge/addon/maven/dependencies/MavenDependencyResolver.java
focal_class.identifier: MavenDependencyResolver
focal_class.interfaces: implements DependencyResolver
focal_class.class_method_signature: MavenDependencyResolver.MavenDependencyResolver()
focal_class.full_signature: public  MavenDependencyResolver()
focal_class.identifier: MavenDependencyResolver
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.signature:  MavenDependencyResolver()
focal_class.class_method_signature: MavenDependencyResolver.MavenDependencyResolver(ResourceFactory resourceFactory)
focal_class.full_signature: public  MavenDependencyResolver(ResourceFactory resourceFactory)
focal_class.identifier: MavenDependencyResolver
focal_class.modifiers: public
focal_class.parameters: (ResourceFactory resourceFactory)
focal_class.signature:  MavenDependencyResolver(ResourceFactory resourceFactory)
focal_class.class_method_signature: MavenDependencyResolver.resolveDependencies(DependencyQuery query)
focal_class.full_signature: @Override public Set<Dependency> resolveDependencies(DependencyQuery query)
focal_class.identifier: resolveDependencies
focal_class.modifiers: @Override public
focal_class.parameters: (DependencyQuery query)
focal_class.return: Set<Dependency>
focal_class.signature: Set<Dependency> resolveDependencies(DependencyQuery query)
focal_class.class_method_signature: MavenDependencyResolver.resolveVersions(DependencyQuery query)
focal_class.full_signature: @Override public List<Coordinate> resolveVersions(DependencyQuery query)
focal_class.identifier: resolveVersions
focal_class.modifiers: @Override public
focal_class.parameters: (DependencyQuery query)
focal_class.return: List<Coordinate>
focal_class.signature: List<Coordinate> resolveVersions(DependencyQuery query)
focal_class.class_method_signature: MavenDependencyResolver.getVersions(DependencyQuery query)
focal_class.full_signature:  VersionRangeResult getVersions(DependencyQuery query)
focal_class.identifier: getVersions
focal_class.parameters: (DependencyQuery query)
focal_class.return: VersionRangeResult
focal_class.signature: VersionRangeResult getVersions(DependencyQuery query)
focal_class.class_method_signature: MavenDependencyResolver.resolveArtifact(DependencyQuery query)
focal_class.full_signature: @Override public Dependency resolveArtifact(DependencyQuery query)
focal_class.identifier: resolveArtifact
focal_class.modifiers: @Override public
focal_class.parameters: (DependencyQuery query)
focal_class.return: Dependency
focal_class.signature: Dependency resolveArtifact(DependencyQuery query)
focal_class.class_method_signature: MavenDependencyResolver.resolveDependencyHierarchy(final DependencyQuery query)
focal_class.full_signature: @Override public org.jboss.forge.addon.dependencies.DependencyNode resolveDependencyHierarchy(final DependencyQuery query)
focal_class.identifier: resolveDependencyHierarchy
focal_class.modifiers: @Override public
focal_class.parameters: (final DependencyQuery query)
focal_class.return: org.jboss.forge.addon.dependencies.DependencyNode
focal_class.signature: org.jboss.forge.addon.dependencies.DependencyNode resolveDependencyHierarchy(final DependencyQuery query)
focal_class.class_method_signature: MavenDependencyResolver.resolveDependencyMetadata(final DependencyQuery query)
focal_class.full_signature: @Override public DependencyMetadata resolveDependencyMetadata(final DependencyQuery query)
focal_class.identifier: resolveDependencyMetadata
focal_class.modifiers: @Override public
focal_class.parameters: (final DependencyQuery query)
focal_class.return: DependencyMetadata
focal_class.signature: DependencyMetadata resolveDependencyMetadata(final DependencyQuery query)
focal_class.class_method_signature: MavenDependencyResolver.getResourceFactory()
focal_class.full_signature: private ResourceFactory getResourceFactory()
focal_class.identifier: getResourceFactory
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.return: ResourceFactory
focal_class.signature: ResourceFactory getResourceFactory()
focal_method.body: @Override
     public org.jboss.forge.addon.dependencies.DependencyNode resolveDependencyHierarchy(final DependencyQuery query)
     {
        try
        {
           RepositorySystem system = container.getRepositorySystem();
           Settings settings = container.getSettings();
           DefaultRepositorySystemSession session = container.setupRepoSession(system, settings);
           session.setDependencyTraverser(new DependencyTraverser()
           {
              @Override
              public boolean traverseDependency(org.eclipse.aether.graph.Dependency dependency)
              {
                 if (query.getScopeType() != null)
                    return query.getScopeType().equals(dependency.getScope());
                 else
                    return !"test".equals(dependency.getScope());
              }
  
              @Override
              public DependencyTraverser deriveChildTraverser(DependencyCollectionContext context)
              {
                 return this;
              }
           });
           session.setDependencySelector(new ScopeDependencySelector("test"));
  
           final CoordinateBuilder coord = CoordinateBuilder.create(query.getCoordinate());
           Artifact queryArtifact = MavenConvertUtils.coordinateToMavenArtifact(coord);
  
           List<RemoteRepository> remoteRepos = MavenConvertUtils.convertToMavenRepos(query.getDependencyRepositories(),
                    settings);
           remoteRepos.addAll(MavenRepositories.getRemoteRepositories(container, settings));
           CollectRequest collectRequest = new CollectRequest(new org.eclipse.aether.graph.Dependency(queryArtifact,
                    null), remoteRepos);
  
           DependencyRequest dr = new DependencyRequest(collectRequest, null);
  
           DependencyResult result = system.resolveDependencies(session, dr);
           DependencyNodeBuilder hierarchy = MavenConvertUtils.toDependencyNode(getResourceFactory(), null,
                    result.getRoot());
           return hierarchy;
        }
        catch (Exception e)
        {
           throw new DependencyException("Could not resolve dependencies for addon [" + query.getCoordinate() + "]", e);
        }
     }
focal_method.class_method_signature: MavenDependencyResolver.resolveDependencyHierarchy(final DependencyQuery query)
focal_method.full_signature: @Override public org.jboss.forge.addon.dependencies.DependencyNode resolveDependencyHierarchy(final DependencyQuery query)
focal_method.identifier: resolveDependencyHierarchy
focal_method.invocations: getRepositorySystem getSettings setupRepoSession setDependencyTraverser getScopeType equals getScopeType getScope equals getScope setDependencySelector create getCoordinate coordinateToMavenArtifact convertToMavenRepos getDependencyRepositories addAll getRemoteRepositories resolveDependencies toDependencyNode getResourceFactory getRoot getCoordinate
focal_method.modifiers: @Override public
focal_method.parameters: (final DependencyQuery query)
focal_method.return: org.jboss.forge.addon.dependencies.DependencyNode
focal_method.signature: org.jboss.forge.addon.dependencies.DependencyNode resolveDependencyHierarchy(final DependencyQuery query)