Search in sources :

Example 1 with NodeBuilder

use of org.eclipse.aether.internal.test.util.NodeBuilder in project maven-resolver by apache.

the class DependencyFilterUtilsTest method testClasspathFilterCompile.

@Test
public void testClasspathFilterCompile() {
    NodeBuilder builder = new NodeBuilder().artifactId("aid");
    DependencyFilter filter = DependencyFilterUtils.classpathFilter("compile");
    assertTrue(filter.accept(builder.scope("compile").build(), PARENTS));
    assertTrue(filter.accept(builder.scope("system").build(), PARENTS));
    assertTrue(filter.accept(builder.scope("provided").build(), PARENTS));
    assertFalse(filter.accept(builder.scope("runtime").build(), PARENTS));
    assertFalse(filter.accept(builder.scope("test").build(), PARENTS));
}
Also used : DependencyFilter(org.eclipse.aether.graph.DependencyFilter) NodeBuilder(org.eclipse.aether.internal.test.util.NodeBuilder) Test(org.junit.Test)

Example 2 with NodeBuilder

use of org.eclipse.aether.internal.test.util.NodeBuilder in project maven-resolver by apache.

the class DependencyFilterUtilsTest method testClasspathFilterRuntimeCommaSystem.

@Test
public void testClasspathFilterRuntimeCommaSystem() {
    NodeBuilder builder = new NodeBuilder().artifactId("aid");
    DependencyFilter filter = DependencyFilterUtils.classpathFilter("runtime,system");
    assertTrue(filter.accept(builder.scope("compile").build(), PARENTS));
    assertTrue(filter.accept(builder.scope("system").build(), PARENTS));
    assertFalse(filter.accept(builder.scope("provided").build(), PARENTS));
    assertTrue(filter.accept(builder.scope("runtime").build(), PARENTS));
    assertFalse(filter.accept(builder.scope("test").build(), PARENTS));
}
Also used : DependencyFilter(org.eclipse.aether.graph.DependencyFilter) NodeBuilder(org.eclipse.aether.internal.test.util.NodeBuilder) Test(org.junit.Test)

Example 3 with NodeBuilder

use of org.eclipse.aether.internal.test.util.NodeBuilder in project maven-resolver by apache.

the class DependencyFilterUtilsTest method testClasspathFilterNull.

@Test
public void testClasspathFilterNull() {
    NodeBuilder builder = new NodeBuilder().artifactId("aid");
    DependencyFilter filter = DependencyFilterUtils.classpathFilter((String[]) null);
    assertFalse(filter.accept(builder.scope("compile").build(), PARENTS));
    assertFalse(filter.accept(builder.scope("system").build(), PARENTS));
    assertFalse(filter.accept(builder.scope("provided").build(), PARENTS));
    assertFalse(filter.accept(builder.scope("runtime").build(), PARENTS));
    assertFalse(filter.accept(builder.scope("test").build(), PARENTS));
}
Also used : DependencyFilter(org.eclipse.aether.graph.DependencyFilter) NodeBuilder(org.eclipse.aether.internal.test.util.NodeBuilder) Test(org.junit.Test)

Example 4 with NodeBuilder

use of org.eclipse.aether.internal.test.util.NodeBuilder in project maven-resolver by apache.

the class DependencyFilterUtilsTest method testClasspathFilterRuntime.

@Test
public void testClasspathFilterRuntime() {
    NodeBuilder builder = new NodeBuilder().artifactId("aid");
    DependencyFilter filter = DependencyFilterUtils.classpathFilter("runtime");
    assertTrue(filter.accept(builder.scope("compile").build(), PARENTS));
    assertFalse(filter.accept(builder.scope("system").build(), PARENTS));
    assertFalse(filter.accept(builder.scope("provided").build(), PARENTS));
    assertTrue(filter.accept(builder.scope("runtime").build(), PARENTS));
    assertFalse(filter.accept(builder.scope("test").build(), PARENTS));
}
Also used : DependencyFilter(org.eclipse.aether.graph.DependencyFilter) NodeBuilder(org.eclipse.aether.internal.test.util.NodeBuilder) Test(org.junit.Test)

Example 5 with NodeBuilder

use of org.eclipse.aether.internal.test.util.NodeBuilder in project maven-resolver by apache.

the class DependencyFilterUtilsTest method testClasspathFilterTest.

@Test
public void testClasspathFilterTest() {
    NodeBuilder builder = new NodeBuilder().artifactId("aid");
    DependencyFilter filter = DependencyFilterUtils.classpathFilter("test");
    assertTrue(filter.accept(builder.scope("compile").build(), PARENTS));
    assertTrue(filter.accept(builder.scope("system").build(), PARENTS));
    assertTrue(filter.accept(builder.scope("provided").build(), PARENTS));
    assertTrue(filter.accept(builder.scope("runtime").build(), PARENTS));
    assertTrue(filter.accept(builder.scope("test").build(), PARENTS));
}
Also used : DependencyFilter(org.eclipse.aether.graph.DependencyFilter) NodeBuilder(org.eclipse.aether.internal.test.util.NodeBuilder) Test(org.junit.Test)

Aggregations

NodeBuilder (org.eclipse.aether.internal.test.util.NodeBuilder)24 Test (org.junit.Test)24 DependencyNode (org.eclipse.aether.graph.DependencyNode)16 DependencyFilter (org.eclipse.aether.graph.DependencyFilter)10 LinkedList (java.util.LinkedList)6 AndDependencyFilter (org.eclipse.aether.util.filter.AndDependencyFilter)2 ExclusionsDependencyFilter (org.eclipse.aether.util.filter.ExclusionsDependencyFilter)1 OrDependencyFilter (org.eclipse.aether.util.filter.OrDependencyFilter)1 PatternExclusionsDependencyFilter (org.eclipse.aether.util.filter.PatternExclusionsDependencyFilter)1 PatternInclusionsDependencyFilter (org.eclipse.aether.util.filter.PatternInclusionsDependencyFilter)1 ScopeDependencyFilter (org.eclipse.aether.util.filter.ScopeDependencyFilter)1