Search in sources :

Example 61 with DependencyNode

use of org.sonatype.aether.graph.DependencyNode in project sonatype-aether by sonatype.

the class DefaultDependencyCollectorTest method testCyclicDependencies.

@Test
public void testCyclicDependencies() throws Exception {
    DependencyNode root = parser.parse("cycle.txt");
    CollectRequest request = new CollectRequest(root.getDependency(), Arrays.asList(repository));
    CollectResult result = collector.collectDependencies(session, request);
    assertEqualSubtree(root, result.getRoot());
}
Also used : CollectResult(org.sonatype.aether.collection.CollectResult) DependencyNode(org.sonatype.aether.graph.DependencyNode) CollectRequest(org.sonatype.aether.collection.CollectRequest) Test(org.junit.Test)

Example 62 with DependencyNode

use of org.sonatype.aether.graph.DependencyNode in project sonatype-aether by sonatype.

the class DefaultDependencyCollectorTest method testCyclicDependenciesBig.

@Test
public void testCyclicDependenciesBig() throws Exception {
    DependencyNode root = parser.parse("cycle-big.txt");
    CollectRequest request = new CollectRequest(root.getDependency(), Arrays.asList(repository));
    collector.setArtifactDescriptorReader(new IniArtifactDescriptorReader("artifact-descriptions/cycle-big/"));
    CollectResult result = collector.collectDependencies(session, request);
    assertNotNull(result.getRoot());
// we only care about the performance here, this test must not hang or run out of mem
}
Also used : CollectResult(org.sonatype.aether.collection.CollectResult) DependencyNode(org.sonatype.aether.graph.DependencyNode) CollectRequest(org.sonatype.aether.collection.CollectRequest) Test(org.junit.Test)

Example 63 with DependencyNode

use of org.sonatype.aether.graph.DependencyNode in project sonatype-aether by sonatype.

the class ConflictIdSorterTest method testCycle.

@Test
public void testCycle() throws Exception {
    DependencyNode node = parser.parse("cycle.txt");
    transform(node);
    expectOrder("gid:aid::ext", "gid2:aid::ext");
    expectCycle(true);
}
Also used : DependencyNode(org.sonatype.aether.graph.DependencyNode) Test(org.junit.Test)

Example 64 with DependencyNode

use of org.sonatype.aether.graph.DependencyNode in project sonatype-aether by sonatype.

the class ConflictIdSorterTest method testNoConflicts.

@Test
public void testNoConflicts() throws Exception {
    DependencyNode node = parser.parse("no-conflicts.txt");
    transform(node);
    expectOrder("gid:aid::ext", "gid3:aid::ext", "gid2:aid::ext", "gid4:aid::ext");
    expectCycle(false);
}
Also used : DependencyNode(org.sonatype.aether.graph.DependencyNode) Test(org.junit.Test)

Example 65 with DependencyNode

use of org.sonatype.aether.graph.DependencyNode in project sonatype-aether by sonatype.

the class ConflictIdSorterTest method testSimple.

@Test
public void testSimple() throws Exception {
    DependencyNode node = parser.parse("simple.txt");
    transform(node);
    expectOrder("gid2:aid::ext", "gid:aid::ext", "gid:aid2::ext");
    expectCycle(false);
}
Also used : DependencyNode(org.sonatype.aether.graph.DependencyNode) Test(org.junit.Test)

Aggregations

DependencyNode (org.sonatype.aether.graph.DependencyNode)114 Test (org.junit.Test)82 NodeBuilder (org.sonatype.aether.test.util.NodeBuilder)20 Dependency (org.sonatype.aether.graph.Dependency)14 IdentityHashMap (java.util.IdentityHashMap)13 CollectRequest (org.sonatype.aether.collection.CollectRequest)12 CollectResult (org.sonatype.aether.collection.CollectResult)11 List (java.util.List)8 Map (java.util.Map)8 LinkedList (java.util.LinkedList)7 Artifact (org.sonatype.aether.artifact.Artifact)6 DependencyFilter (org.sonatype.aether.graph.DependencyFilter)5 ArrayList (java.util.ArrayList)4 DependencyGraphTransformationContext (org.sonatype.aether.collection.DependencyGraphTransformationContext)4 ConflictMarker (org.sonatype.aether.util.graph.transformer.ConflictMarker)4 HashMap (java.util.HashMap)3 ArtifactDescriptorException (org.sonatype.aether.resolution.ArtifactDescriptorException)3 BufferedReader (java.io.BufferedReader)2 HashSet (java.util.HashSet)2 RepositorySystemSession (org.sonatype.aether.RepositorySystemSession)2