use of org.eclipse.aether.graph.DependencyNode in project maven-resolver by apache.
the class PatternInclusionsDependencyFilterTest method acceptTestMoreToken.
@Test
public void acceptTestMoreToken() {
NodeBuilder builder = new NodeBuilder();
builder.groupId("com.example.test").artifactId("testArtifact").ext("jar").version("1.0.3");
DependencyNode node = builder.build();
assertFalse("com.example.test:testArtifact:jar:1.0.3:foo", accept(node, "com.example.test:testArtifact:jar:1.0.3:foo"));
}
use of org.eclipse.aether.graph.DependencyNode in project maven-resolver by apache.
the class ScopeDependencyFilterTest method acceptTest.
@Test
public void acceptTest() {
NodeBuilder builder = new NodeBuilder();
builder.scope("compile").artifactId("test");
List<DependencyNode> parents = new LinkedList<>();
// null or empty
assertTrue(new ScopeDependencyFilter(null, null).accept(builder.build(), parents));
assertTrue(new ScopeDependencyFilter(new LinkedList<String>(), new LinkedList<String>()).accept(builder.build(), parents));
assertTrue(new ScopeDependencyFilter((String[]) null).accept(builder.build(), parents));
// only excludes
assertTrue(new ScopeDependencyFilter("test").accept(builder.build(), parents));
assertFalse(new ScopeDependencyFilter("compile").accept(builder.build(), parents));
assertFalse(new ScopeDependencyFilter("compile", "test").accept(builder.build(), parents));
// Both
String[] excludes1 = { "provided" };
String[] includes1 = { "compile", "test" };
assertTrue(new ScopeDependencyFilter(Arrays.asList(includes1), Arrays.asList(excludes1)).accept(builder.build(), parents));
assertTrue(new ScopeDependencyFilter(Arrays.asList(includes1), null).accept(builder.build(), parents));
// exclude wins
String[] excludes2 = { "compile" };
String[] includes2 = { "compile" };
assertFalse(new ScopeDependencyFilter(Arrays.asList(includes2), Arrays.asList(excludes2)).accept(builder.build(), parents));
}
use of org.eclipse.aether.graph.DependencyNode in project maven-resolver by apache.
the class ConflictIdSorterTest method testSimple.
@Test
public void testSimple() throws Exception {
DependencyNode node = parseResource("simple.txt");
assertSame(node, transform(node));
expectOrder("gid2:aid::jar", "gid:aid::jar", "gid:aid2::jar");
expectCycle(false);
}
use of org.eclipse.aether.graph.DependencyNode in project maven-resolver by apache.
the class ConflictIdSorterTest method testCycles.
@Test
public void testCycles() throws Exception {
DependencyNode node = parseResource("cycles.txt");
assertSame(node, transform(node));
expectOrder("*", "*", "*", "gid:aid::jar");
expectCycle(true);
}
use of org.eclipse.aether.graph.DependencyNode in project maven-resolver by apache.
the class ConflictIdSorterTest method testNoConflicts.
@Test
public void testNoConflicts() throws Exception {
DependencyNode node = parseResource("no-conflicts.txt");
assertSame(node, transform(node));
expectOrder("gid:aid::jar", "gid3:aid::jar", "gid2:aid::jar", "gid4:aid::jar");
expectCycle(false);
}
Aggregations