Search in sources :

Example 1 with ClassicDependencyManager

use of org.sonatype.aether.util.graph.manager.ClassicDependencyManager in project sonatype-aether by sonatype.

the class DefaultDependencyCollectorTest method testManagedVersionScope.

@Test
public void testManagedVersionScope() throws IOException, DependencyCollectionException {
    DependencyNode root = parser.parseLiteral("managed:aid:ext:ver");
    Dependency dependency = root.getDependency();
    CollectRequest request = new CollectRequest(dependency, Arrays.asList(repository));
    session.setDependencyManager(new ClassicDependencyManager());
    CollectResult result = collector.collectDependencies(session, request);
    assertEquals(0, result.getExceptions().size());
    DependencyNode newRoot = result.getRoot();
    assertEquals(dependency, dep(newRoot));
    assertEquals(dependency.getArtifact(), dep(newRoot).getArtifact());
    assertEquals(1, newRoot.getChildren().size());
    DependencyNode expect = parser.parseLiteral("gid:aid:ext:ver:compile");
    assertEquals(dep(expect), dep(newRoot, 0));
    assertEquals(1, path(newRoot, 0).getChildren().size());
    expect = parser.parseLiteral("gid:aid2:ext:managedVersion:managedScope");
    assertEquals(dep(expect), dep(newRoot, 0, 0));
}
Also used : ClassicDependencyManager(org.sonatype.aether.util.graph.manager.ClassicDependencyManager) CollectResult(org.sonatype.aether.collection.CollectResult) DependencyNode(org.sonatype.aether.graph.DependencyNode) Dependency(org.sonatype.aether.graph.Dependency) CollectRequest(org.sonatype.aether.collection.CollectRequest) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)1 CollectRequest (org.sonatype.aether.collection.CollectRequest)1 CollectResult (org.sonatype.aether.collection.CollectResult)1 Dependency (org.sonatype.aether.graph.Dependency)1 DependencyNode (org.sonatype.aether.graph.DependencyNode)1 ClassicDependencyManager (org.sonatype.aether.util.graph.manager.ClassicDependencyManager)1