From 36df74e9ad34b54faac4dc1ed66cde150c6d64c3 Mon Sep 17 00:00:00 2001 From: Benjamin Bentmann Date: Sat, 6 Dec 2008 21:52:22 +0000 Subject: [PATCH] o Added IT to check effective scope of transitive dependencies git-svn-id: https://svn.apache.org/repos/asf/maven/core-integration-testing/trunk@724043 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/maven/it/IntegrationTestSuite.java | 1 + ...MavenIT0142DirectDependencyScopesTest.java | 22 +- ...nIT0143TransitiveDependencyScopesTest.java | 250 ++++++++++++++++++ .../it0142/{pom.xml => pom-template.xml} | 2 +- .../test/resources/it0143/pom-template.xml | 85 ++++++ .../its/it0143/compile/0.1/compile-0.1.jar | Bin 0 -> 2986 bytes .../its/it0143/compile/0.1/compile-0.1.pom | 56 ++++ .../its/it0143/compile/maven-metadata.xml | 11 + .../its/it0143/direct/0.1/direct-0.1.jar | Bin 0 -> 3169 bytes .../its/it0143/direct/0.1/direct-0.1.pom | 83 ++++++ .../its/it0143/direct/maven-metadata.xml | 11 + .../its/it0143/provided/0.1/provided-0.1.jar | Bin 0 -> 2996 bytes .../its/it0143/provided/0.1/provided-0.1.pom | 56 ++++ .../its/it0143/provided/maven-metadata.xml | 11 + .../its/it0143/runtime/0.1/runtime-0.1.jar | Bin 0 -> 2986 bytes .../its/it0143/runtime/0.1/runtime-0.1.pom | 56 ++++ .../its/it0143/runtime/maven-metadata.xml | 11 + .../maven/its/it0143/test/0.1/test-0.1.jar | Bin 0 -> 2963 bytes .../maven/its/it0143/test/0.1/test-0.1.pom | 56 ++++ .../maven/its/it0143/test/maven-metadata.xml | 11 + 20 files changed, 710 insertions(+), 12 deletions(-) create mode 100644 its/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0143TransitiveDependencyScopesTest.java rename its/core-it-suite/src/test/resources/it0142/{pom.xml => pom-template.xml} (98%) create mode 100644 its/core-it-suite/src/test/resources/it0143/pom-template.xml create mode 100644 its/core-it-suite/src/test/resources/it0143/repo/org/apache/maven/its/it0143/compile/0.1/compile-0.1.jar create mode 100644 its/core-it-suite/src/test/resources/it0143/repo/org/apache/maven/its/it0143/compile/0.1/compile-0.1.pom create mode 100644 its/core-it-suite/src/test/resources/it0143/repo/org/apache/maven/its/it0143/compile/maven-metadata.xml create mode 100644 its/core-it-suite/src/test/resources/it0143/repo/org/apache/maven/its/it0143/direct/0.1/direct-0.1.jar create mode 100644 its/core-it-suite/src/test/resources/it0143/repo/org/apache/maven/its/it0143/direct/0.1/direct-0.1.pom create mode 100644 its/core-it-suite/src/test/resources/it0143/repo/org/apache/maven/its/it0143/direct/maven-metadata.xml create mode 100644 its/core-it-suite/src/test/resources/it0143/repo/org/apache/maven/its/it0143/provided/0.1/provided-0.1.jar create mode 100644 its/core-it-suite/src/test/resources/it0143/repo/org/apache/maven/its/it0143/provided/0.1/provided-0.1.pom create mode 100644 its/core-it-suite/src/test/resources/it0143/repo/org/apache/maven/its/it0143/provided/maven-metadata.xml create mode 100644 its/core-it-suite/src/test/resources/it0143/repo/org/apache/maven/its/it0143/runtime/0.1/runtime-0.1.jar create mode 100644 its/core-it-suite/src/test/resources/it0143/repo/org/apache/maven/its/it0143/runtime/0.1/runtime-0.1.pom create mode 100644 its/core-it-suite/src/test/resources/it0143/repo/org/apache/maven/its/it0143/runtime/maven-metadata.xml create mode 100644 its/core-it-suite/src/test/resources/it0143/repo/org/apache/maven/its/it0143/test/0.1/test-0.1.jar create mode 100644 its/core-it-suite/src/test/resources/it0143/repo/org/apache/maven/its/it0143/test/0.1/test-0.1.pom create mode 100644 its/core-it-suite/src/test/resources/it0143/repo/org/apache/maven/its/it0143/test/maven-metadata.xml diff --git a/its/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java b/its/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java index beaa20c132..062917606d 100644 --- a/its/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java +++ b/its/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java @@ -227,6 +227,7 @@ public class IntegrationTestSuite suite.addTestSuite( MavenITmng0282NonReactorExecWhenProjectIndependentTest.class ); suite.addTestSuite( MavenITmng0249ResolveDepsFromReactorTest.class ); suite.addTestSuite( MavenITmng0095ReactorFailureBehaviorTest.class ); + suite.addTestSuite( MavenIT0143TransitiveDependencyScopesTest.class ); suite.addTestSuite( MavenIT0142DirectDependencyScopesTest.class ); suite.addTestSuite( MavenIT0140Test.class ); suite.addTestSuite( MavenIT0139Test.class ); diff --git a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0142DirectDependencyScopesTest.java b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0142DirectDependencyScopesTest.java index d25e7dbcab..738843acdd 100644 --- a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0142DirectDependencyScopesTest.java +++ b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0142DirectDependencyScopesTest.java @@ -35,6 +35,10 @@ public class MavenIT0142DirectDependencyScopesTest extends AbstractMavenIntegrationTestCase { + /* + * NOTE: Class path ordering is another issue (MNG-1412), so we merely check set containment here. + */ + public MavenIT0142DirectDependencyScopesTest() { } @@ -51,49 +55,44 @@ public class MavenIT0142DirectDependencyScopesTest verifier.setAutoclean( false ); verifier.deleteDirectory( "target" ); verifier.deleteArtifacts( "org.apache.maven.its.it0142" ); - verifier.filterFile( "pom.xml", "pom.xml", "UTF-8", verifier.newDefaultFilterProperties() ); + verifier.filterFile( "pom-template.xml", "pom.xml", "UTF-8", verifier.newDefaultFilterProperties() ); verifier.executeGoal( "validate" ); verifier.verifyErrorFreeLog(); verifier.resetStreams(); - /* - * NOTE: Class path ordering is another issue (MNG-1412), so we merely check set containment here. - */ - List compileArtifacts = verifier.loadLines( "target/compile-artifacts.txt", "UTF-8" ); - assertEquals( 3, compileArtifacts.size() ); assertTrue( compileArtifacts.toString(), compileArtifacts.contains( "org.apache.maven.its.it0142:system:jar:0.1" ) ); assertTrue( compileArtifacts.toString(), compileArtifacts.contains( "org.apache.maven.its.it0142:provided:jar:0.1" ) ); assertTrue( compileArtifacts.toString(), compileArtifacts.contains( "org.apache.maven.its.it0142:compile:jar:0.1" ) ); + assertEquals( 3, compileArtifacts.size() ); List compileClassPath = verifier.loadLines( "target/compile-cp.txt", "UTF-8" ); - assertEquals( 4, compileClassPath.size() ); assertTrue( compileClassPath.toString(), compileClassPath.contains( "classes" ) ); assertTrue( compileClassPath.toString(), compileClassPath.contains( "system-0.1.jar" ) ); assertTrue( compileClassPath.toString(), compileClassPath.contains( "provided-0.1.jar" ) ); assertTrue( compileClassPath.toString(), compileClassPath.contains( "compile-0.1.jar" ) ); + assertEquals( 4, compileClassPath.size() ); List runtimeArtifacts = verifier.loadLines( "target/runtime-artifacts.txt", "UTF-8" ); - assertEquals( 2, runtimeArtifacts.size() ); assertTrue( runtimeArtifacts.toString(), runtimeArtifacts.contains( "org.apache.maven.its.it0142:compile:jar:0.1" ) ); assertTrue( runtimeArtifacts.toString(), runtimeArtifacts.contains( "org.apache.maven.its.it0142:runtime:jar:0.1" ) ); + assertEquals( 2, runtimeArtifacts.size() ); List runtimeClassPath = verifier.loadLines( "target/runtime-cp.txt", "UTF-8" ); - assertEquals( 3, runtimeClassPath.size() ); assertTrue( runtimeClassPath.toString(), runtimeClassPath.contains( "classes" ) ); assertTrue( runtimeClassPath.toString(), runtimeClassPath.contains( "compile-0.1.jar" ) ); assertTrue( runtimeClassPath.toString(), runtimeClassPath.contains( "runtime-0.1.jar" ) ); + assertEquals( 3, runtimeClassPath.size() ); List testArtifacts = verifier.loadLines( "target/test-artifacts.txt", "UTF-8" ); - assertEquals( 5, testArtifacts.size() ); assertTrue( testArtifacts.toString(), testArtifacts.contains( "org.apache.maven.its.it0142:system:jar:0.1" ) ); assertTrue( testArtifacts.toString(), testArtifacts.contains( "org.apache.maven.its.it0142:provided:jar:0.1" ) ); assertTrue( testArtifacts.toString(), testArtifacts.contains( "org.apache.maven.its.it0142:compile:jar:0.1" ) ); assertTrue( testArtifacts.toString(), testArtifacts.contains( "org.apache.maven.its.it0142:runtime:jar:0.1" ) ); assertTrue( testArtifacts.toString(), testArtifacts.contains( "org.apache.maven.its.it0142:test:jar:0.1" ) ); + assertEquals( 5, testArtifacts.size() ); List testClassPath = verifier.loadLines( "target/test-cp.txt", "UTF-8" ); - assertEquals( 7, testClassPath.size() ); assertTrue( testClassPath.toString(), testClassPath.contains( "classes" ) ); assertTrue( testClassPath.toString(), testClassPath.contains( "test-classes" ) ); assertTrue( testClassPath.toString(), testClassPath.contains( "system-0.1.jar" ) ); @@ -101,6 +100,7 @@ public class MavenIT0142DirectDependencyScopesTest assertTrue( testClassPath.toString(), testClassPath.contains( "compile-0.1.jar" ) ); assertTrue( testClassPath.toString(), testClassPath.contains( "runtime-0.1.jar" ) ); assertTrue( testClassPath.toString(), testClassPath.contains( "test-0.1.jar" ) ); + assertEquals( 7, testClassPath.size() ); } } diff --git a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0143TransitiveDependencyScopesTest.java b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0143TransitiveDependencyScopesTest.java new file mode 100644 index 0000000000..9b9639a01c --- /dev/null +++ b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0143TransitiveDependencyScopesTest.java @@ -0,0 +1,250 @@ +package org.apache.maven.it; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import org.apache.maven.it.Verifier; +import org.apache.maven.it.util.ResourceExtractor; + +import java.io.File; +import java.util.Arrays; +import java.util.List; +import java.util.Properties; + +/** + * + * @author Benjamin Bentmann + * @version $Id$ + */ +public class MavenIT0143TransitiveDependencyScopesTest + extends AbstractMavenIntegrationTestCase +{ + + /* + * NOTE: Class path ordering is another issue (MNG-1412), so we merely check set containment here. + */ + + public MavenIT0143TransitiveDependencyScopesTest() + { + } + + /** + * Test that the different scopes of transitive dependencies end up on the right class paths when mediated from + * a compile-scope dependency. + */ + public void testitCompileScope() + throws Exception + { + Verifier verifier = run( "compile" ); + String targetDir = "target-compile"; + + /* + * NOTE: Transitive compile dependencies end up in compile scope to support the case of a class in the direct + * dependency that extends a class from the transitive dependency, i.e. + * project imports A from direct dependency and A extends B from transitive dependency. + */ + List compileArtifacts = verifier.loadLines( targetDir + "/compile-artifacts.txt", "UTF-8" ); + assertTrue( compileArtifacts.toString(), compileArtifacts.contains( "org.apache.maven.its.it0143:direct:jar:0.1" ) ); + assertTrue( compileArtifacts.toString(), compileArtifacts.contains( "org.apache.maven.its.it0143:compile:jar:0.1" ) ); + assertEquals( 2, compileArtifacts.size() ); + + List compileClassPath = verifier.loadLines( targetDir + "/compile-cp.txt", "UTF-8" ); + assertTrue( compileClassPath.toString(), compileClassPath.contains( "classes" ) ); + assertTrue( compileClassPath.toString(), compileClassPath.contains( "direct-0.1.jar" ) ); + assertTrue( compileClassPath.toString(), compileClassPath.contains( "compile-0.1.jar" ) ); + assertEquals( 3, compileClassPath.size() ); + + List runtimeArtifacts = verifier.loadLines( targetDir + "/runtime-artifacts.txt", "UTF-8" ); + assertTrue( runtimeArtifacts.toString(), runtimeArtifacts.contains( "org.apache.maven.its.it0143:direct:jar:0.1" ) ); + assertTrue( runtimeArtifacts.toString(), runtimeArtifacts.contains( "org.apache.maven.its.it0143:compile:jar:0.1" ) ); + assertTrue( runtimeArtifacts.toString(), runtimeArtifacts.contains( "org.apache.maven.its.it0143:runtime:jar:0.1" ) ); + assertEquals( 3, runtimeArtifacts.size() ); + + List runtimeClassPath = verifier.loadLines( targetDir + "/runtime-cp.txt", "UTF-8" ); + assertTrue( runtimeClassPath.toString(), runtimeClassPath.contains( "classes" ) ); + assertTrue( runtimeClassPath.toString(), runtimeClassPath.contains( "direct-0.1.jar" ) ); + assertTrue( runtimeClassPath.toString(), runtimeClassPath.contains( "compile-0.1.jar" ) ); + assertTrue( runtimeClassPath.toString(), runtimeClassPath.contains( "runtime-0.1.jar" ) ); + assertEquals( 4, runtimeClassPath.size() ); + + List testArtifacts = verifier.loadLines( targetDir + "/test-artifacts.txt", "UTF-8" ); + assertTrue( testArtifacts.toString(), testArtifacts.contains( "org.apache.maven.its.it0143:direct:jar:0.1" ) ); + assertTrue( testArtifacts.toString(), testArtifacts.contains( "org.apache.maven.its.it0143:compile:jar:0.1" ) ); + assertTrue( testArtifacts.toString(), testArtifacts.contains( "org.apache.maven.its.it0143:runtime:jar:0.1" ) ); + assertEquals( 3, testArtifacts.size() ); + + List testClassPath = verifier.loadLines( targetDir + "/test-cp.txt", "UTF-8" ); + assertTrue( testClassPath.toString(), testClassPath.contains( "classes" ) ); + assertTrue( testClassPath.toString(), testClassPath.contains( "test-classes" ) ); + assertTrue( testClassPath.toString(), testClassPath.contains( "direct-0.1.jar" ) ); + assertTrue( testClassPath.toString(), testClassPath.contains( "compile-0.1.jar" ) ); + assertTrue( testClassPath.toString(), testClassPath.contains( "runtime-0.1.jar" ) ); + assertEquals( 5, testClassPath.size() ); + } + + /** + * Test that the different scopes of transitive dependencies end up on the right class paths when mediated from + * a provided-scope dependency. + */ + public void testitProvidedScope() + throws Exception + { + Verifier verifier = run( "provided" ); + String targetDir = "target-provided"; + + List compileArtifacts = verifier.loadLines( targetDir + "/compile-artifacts.txt", "UTF-8" ); + assertTrue( compileArtifacts.toString(), compileArtifacts.contains( "org.apache.maven.its.it0143:direct:jar:0.1" ) ); + assertTrue( compileArtifacts.toString(), compileArtifacts.contains( "org.apache.maven.its.it0143:compile:jar:0.1" ) ); + assertTrue( compileArtifacts.toString(), compileArtifacts.contains( "org.apache.maven.its.it0143:runtime:jar:0.1" ) ); + assertEquals( 3, compileArtifacts.size() ); + + List compileClassPath = verifier.loadLines( targetDir + "/compile-cp.txt", "UTF-8" ); + assertTrue( compileClassPath.toString(), compileClassPath.contains( "classes" ) ); + assertTrue( compileClassPath.toString(), compileClassPath.contains( "direct-0.1.jar" ) ); + assertTrue( compileClassPath.toString(), compileClassPath.contains( "compile-0.1.jar" ) ); + assertTrue( compileClassPath.toString(), compileClassPath.contains( "runtime-0.1.jar" ) ); + assertEquals( 4, compileClassPath.size() ); + + List runtimeArtifacts = verifier.loadLines( targetDir + "/runtime-artifacts.txt", "UTF-8" ); + assertEquals( 0, runtimeArtifacts.size() ); + + List runtimeClassPath = verifier.loadLines( targetDir + "/runtime-cp.txt", "UTF-8" ); + assertTrue( runtimeClassPath.toString(), runtimeClassPath.contains( "classes" ) ); + assertEquals( 1, runtimeClassPath.size() ); + + List testArtifacts = verifier.loadLines( targetDir + "/test-artifacts.txt", "UTF-8" ); + assertTrue( testArtifacts.toString(), testArtifacts.contains( "org.apache.maven.its.it0143:direct:jar:0.1" ) ); + assertTrue( testArtifacts.toString(), testArtifacts.contains( "org.apache.maven.its.it0143:compile:jar:0.1" ) ); + assertTrue( testArtifacts.toString(), testArtifacts.contains( "org.apache.maven.its.it0143:runtime:jar:0.1" ) ); + assertEquals( 3, testArtifacts.size() ); + + List testClassPath = verifier.loadLines( targetDir + "/test-cp.txt", "UTF-8" ); + assertTrue( testClassPath.toString(), testClassPath.contains( "classes" ) ); + assertTrue( testClassPath.toString(), testClassPath.contains( "test-classes" ) ); + assertTrue( testClassPath.toString(), testClassPath.contains( "direct-0.1.jar" ) ); + assertTrue( testClassPath.toString(), testClassPath.contains( "compile-0.1.jar" ) ); + assertTrue( testClassPath.toString(), testClassPath.contains( "runtime-0.1.jar" ) ); + assertEquals( 5, testClassPath.size() ); + } + + /** + * Test that the different scopes of transitive dependencies end up on the right class paths when mediated from + * a runtime-scope dependency. + */ + public void testitRuntimeScope() + throws Exception + { + Verifier verifier = run( "runtime" ); + String targetDir = "target-runtime"; + + List compileArtifacts = verifier.loadLines( targetDir + "/compile-artifacts.txt", "UTF-8" ); + assertEquals( 0, compileArtifacts.size() ); + + List compileClassPath = verifier.loadLines( targetDir + "/compile-cp.txt", "UTF-8" ); + assertTrue( compileClassPath.toString(), compileClassPath.contains( "classes" ) ); + assertEquals( 1, compileClassPath.size() ); + + List runtimeArtifacts = verifier.loadLines( targetDir + "/runtime-artifacts.txt", "UTF-8" ); + assertTrue( runtimeArtifacts.toString(), runtimeArtifacts.contains( "org.apache.maven.its.it0143:direct:jar:0.1" ) ); + assertTrue( runtimeArtifacts.toString(), runtimeArtifacts.contains( "org.apache.maven.its.it0143:compile:jar:0.1" ) ); + assertTrue( runtimeArtifacts.toString(), runtimeArtifacts.contains( "org.apache.maven.its.it0143:runtime:jar:0.1" ) ); + assertEquals( 3, runtimeArtifacts.size() ); + + List runtimeClassPath = verifier.loadLines( targetDir + "/runtime-cp.txt", "UTF-8" ); + assertTrue( runtimeClassPath.toString(), runtimeClassPath.contains( "classes" ) ); + assertTrue( runtimeClassPath.toString(), runtimeClassPath.contains( "direct-0.1.jar" ) ); + assertTrue( runtimeClassPath.toString(), runtimeClassPath.contains( "compile-0.1.jar" ) ); + assertTrue( runtimeClassPath.toString(), runtimeClassPath.contains( "runtime-0.1.jar" ) ); + assertEquals( 4, runtimeClassPath.size() ); + + List testArtifacts = verifier.loadLines( targetDir + "/test-artifacts.txt", "UTF-8" ); + assertTrue( testArtifacts.toString(), testArtifacts.contains( "org.apache.maven.its.it0143:direct:jar:0.1" ) ); + assertTrue( testArtifacts.toString(), testArtifacts.contains( "org.apache.maven.its.it0143:compile:jar:0.1" ) ); + assertTrue( testArtifacts.toString(), testArtifacts.contains( "org.apache.maven.its.it0143:runtime:jar:0.1" ) ); + assertEquals( 3, testArtifacts.size() ); + + List testClassPath = verifier.loadLines( targetDir + "/test-cp.txt", "UTF-8" ); + assertTrue( testClassPath.toString(), testClassPath.contains( "classes" ) ); + assertTrue( testClassPath.toString(), testClassPath.contains( "test-classes" ) ); + assertTrue( testClassPath.toString(), testClassPath.contains( "direct-0.1.jar" ) ); + assertTrue( testClassPath.toString(), testClassPath.contains( "compile-0.1.jar" ) ); + assertTrue( testClassPath.toString(), testClassPath.contains( "runtime-0.1.jar" ) ); + assertEquals( 5, testClassPath.size() ); + } + + /** + * Test that the different scopes of transitive dependencies end up on the right class paths when mediated from + * a test-scope dependency. + */ + public void testitTestScope() + throws Exception + { + Verifier verifier = run( "test" ); + String targetDir = "target-test"; + + List compileArtifacts = verifier.loadLines( targetDir + "/compile-artifacts.txt", "UTF-8" ); + assertEquals( 0, compileArtifacts.size() ); + + List compileClassPath = verifier.loadLines( targetDir + "/compile-cp.txt", "UTF-8" ); + assertTrue( compileClassPath.toString(), compileClassPath.contains( "classes" ) ); + assertEquals( 1, compileClassPath.size() ); + + List runtimeArtifacts = verifier.loadLines( targetDir + "/runtime-artifacts.txt", "UTF-8" ); + assertEquals( 0, runtimeArtifacts.size() ); + + List runtimeClassPath = verifier.loadLines( targetDir + "/runtime-cp.txt", "UTF-8" ); + assertTrue( runtimeClassPath.toString(), runtimeClassPath.contains( "classes" ) ); + assertEquals( 1, runtimeClassPath.size() ); + + List testArtifacts = verifier.loadLines( targetDir + "/test-artifacts.txt", "UTF-8" ); + assertTrue( testArtifacts.toString(), testArtifacts.contains( "org.apache.maven.its.it0143:direct:jar:0.1" ) ); + assertTrue( testArtifacts.toString(), testArtifacts.contains( "org.apache.maven.its.it0143:compile:jar:0.1" ) ); + assertTrue( testArtifacts.toString(), testArtifacts.contains( "org.apache.maven.its.it0143:runtime:jar:0.1" ) ); + assertEquals( 3, testArtifacts.size() ); + + List testClassPath = verifier.loadLines( targetDir + "/test-cp.txt", "UTF-8" ); + assertTrue( testClassPath.toString(), testClassPath.contains( "classes" ) ); + assertTrue( testClassPath.toString(), testClassPath.contains( "test-classes" ) ); + assertTrue( testClassPath.toString(), testClassPath.contains( "direct-0.1.jar" ) ); + assertTrue( testClassPath.toString(), testClassPath.contains( "compile-0.1.jar" ) ); + assertTrue( testClassPath.toString(), testClassPath.contains( "runtime-0.1.jar" ) ); + assertEquals( 5, testClassPath.size() ); + } + + private Verifier run( String scope ) + throws Exception + { + File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/it0143" ); + + Verifier verifier = new Verifier( testDir.getAbsolutePath() ); + verifier.setAutoclean( false ); + verifier.deleteDirectory( "target-" + scope ); + verifier.deleteArtifacts( "org.apache.maven.its.it0143" ); + Properties filterProps = verifier.newDefaultFilterProperties(); + filterProps.setProperty( "@scope@", scope ); + verifier.filterFile( "pom-template.xml", "pom.xml", "UTF-8", filterProps ); + verifier.setLogFileName( "log-" + scope + ".txt" ); + verifier.executeGoal( "validate" ); + verifier.verifyErrorFreeLog(); + verifier.resetStreams(); + + return verifier; + } + +} diff --git a/its/core-it-suite/src/test/resources/it0142/pom.xml b/its/core-it-suite/src/test/resources/it0142/pom-template.xml similarity index 98% rename from its/core-it-suite/src/test/resources/it0142/pom.xml rename to its/core-it-suite/src/test/resources/it0142/pom-template.xml index 32932a0ffc..fc0728ce79 100644 --- a/its/core-it-suite/src/test/resources/it0142/pom.xml +++ b/its/core-it-suite/src/test/resources/it0142/pom-template.xml @@ -71,7 +71,7 @@ under the License. maven-core-it - file:///${basedir}/repo + @baseurl@/repo ignore diff --git a/its/core-it-suite/src/test/resources/it0143/pom-template.xml b/its/core-it-suite/src/test/resources/it0143/pom-template.xml new file mode 100644 index 0000000000..ccdd677dbf --- /dev/null +++ b/its/core-it-suite/src/test/resources/it0143/pom-template.xml @@ -0,0 +1,85 @@ + + + + + + 4.0.0 + + org.apache.maven.its.it0143 + consumer + 0.1 + + Maven Integration Test :: it0143 + + Test that the different scopes of transitive dependencies end up on the right class paths. + + + + + org.apache.maven.its.it0143 + direct + 0.1 + @scope@ + + + + + + maven-core-it + @baseurl@/repo + + ignore + + + ignore + + + + + + + + org.apache.maven.its.plugins + maven-it-plugin-dependency-resolution + 2.1-SNAPSHOT + + + test + validate + + target-@scope@/compile-cp.txt + target-@scope@/compile-artifacts.txt + target-@scope@/runtime-cp.txt + target-@scope@/runtime-artifacts.txt + target-@scope@/test-cp.txt + target-@scope@/test-artifacts.txt + 1 + + + compile + runtime + test + + + + + + + diff --git a/its/core-it-suite/src/test/resources/it0143/repo/org/apache/maven/its/it0143/compile/0.1/compile-0.1.jar b/its/core-it-suite/src/test/resources/it0143/repo/org/apache/maven/its/it0143/compile/0.1/compile-0.1.jar new file mode 100644 index 0000000000000000000000000000000000000000..ef0a8d8fb82084c83e5800945cd1a00c14311ba5 GIT binary patch literal 2986 zcmWIWW@h1H0D%QF+bqEhD8UJ&eO*Hwbv^yu^aG&EI2h&vm7Tqn#*_+_t_ETeWM#gN zex7cw!6ACSZl8V6oc8h7)w{^+t*dqJ%=yhh23L$9JT21kI(I_HTi1z${mGKBDPr0O zR4R7P=?)V14hk-rtF=}{hFfT|agb<@@adq>Kp8LNVy^>_{MPxc6R7K27w%hJgRX{`bc%pU0`!l*fw|wBO=T zz3+Ff=_X6SGA&`Fdh4B0`ped{y!gA!nY>JZ9Oz=1DKAy_{ESsD)n2+PG4e(KVdEVx6G(lxr*uoJr9&JEM-v z>m_J&ojTX@a?^@RtDqk^2p6Uq*?R2rdj+T&%D5f_rAY&pZsi|n|JcN z!qnDV4>lS-sO_4ny2xeK8m@z>UOV@$a;{A(zdSua`n2Y(?Me>0#}f~%oy~vX+^tup z$-b9a_NYo}%-!rL@!Kg*Z*sTh#L|!9n;eoI9`{FOd@9+@9w#_`N`6P;LFs~ZyEbk) zyzE`CT6=2UtLij~?-d&Ev)PhV%4Hnf3TK^2nddOa=fPi_&dI?$`mWCp3(wv$FFx+v z^w&R>8n3F>MCjTddtI@0$z`Tzr={=zmeIGL$27_F3fp__w=aa9j86`O@fau2Rh&>BWjwlDbZsIlFC+eV5DNs>!!{d(V04)pDQQ zCu{h_EpWEOwp=FOj{C-6GvvRx0$ zsmyx$W?Jht^%Uhby)WcC1U@(M z;y}0MZ=O8axPaO0(MdUhzx<`)`=rJ+N-Q%#vatHZU|X#$%8%X$B?d=N4qnxRNx35k)@C0_=r8%!(zAr^vGaBY3eVa)doj92miiFN9zo0oj8{@&Vqg Uz!oe60|yY+FflMlfSTeA0A;v)EdT%j literal 0 HcmV?d00001 diff --git a/its/core-it-suite/src/test/resources/it0143/repo/org/apache/maven/its/it0143/compile/0.1/compile-0.1.pom b/its/core-it-suite/src/test/resources/it0143/repo/org/apache/maven/its/it0143/compile/0.1/compile-0.1.pom new file mode 100644 index 0000000000..7d80e0b20d --- /dev/null +++ b/its/core-it-suite/src/test/resources/it0143/repo/org/apache/maven/its/it0143/compile/0.1/compile-0.1.pom @@ -0,0 +1,56 @@ + + + + + + 4.0.0 + + org.apache.maven.its.it0143 + compile + 0.1 + jar + + + + maven-core-it + file:///${basedir}/repo + + + + + true + true + + + + + + . + + pom.xml + src/** + + + + src/main/resources + + + + diff --git a/its/core-it-suite/src/test/resources/it0143/repo/org/apache/maven/its/it0143/compile/maven-metadata.xml b/its/core-it-suite/src/test/resources/it0143/repo/org/apache/maven/its/it0143/compile/maven-metadata.xml new file mode 100644 index 0000000000..f494f4c292 --- /dev/null +++ b/its/core-it-suite/src/test/resources/it0143/repo/org/apache/maven/its/it0143/compile/maven-metadata.xml @@ -0,0 +1,11 @@ + + org.apache.maven.its.it0143 + compile + 0.1 + + + 0.1 + + 20081206181258 + + \ No newline at end of file diff --git a/its/core-it-suite/src/test/resources/it0143/repo/org/apache/maven/its/it0143/direct/0.1/direct-0.1.jar b/its/core-it-suite/src/test/resources/it0143/repo/org/apache/maven/its/it0143/direct/0.1/direct-0.1.jar new file mode 100644 index 0000000000000000000000000000000000000000..5d4317382db8d28223e32af9e8ded7ce4b428eeb GIT binary patch literal 3169 zcmWIWW@h1H0D--;+bqEhD8UJ&eO*Hwbv^yu^aG&EI2iT-m7Tqn#*_+_t_ETeWM#gN zex7cw!6ACSZl8V6oc8h7)w{^+t*dqJ%=y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7ZAR1nBA+%v{-FF zAPLuo)Z#-o0lAO_HOF9JN#i~s6IuWwG+`F`p!xv T*+3?80AVE)1H&ay4}t*zfHCfN literal 0 HcmV?d00001 diff --git a/its/core-it-suite/src/test/resources/it0143/repo/org/apache/maven/its/it0143/direct/0.1/direct-0.1.pom b/its/core-it-suite/src/test/resources/it0143/repo/org/apache/maven/its/it0143/direct/0.1/direct-0.1.pom new file mode 100644 index 0000000000..eecaf1be40 --- /dev/null +++ b/its/core-it-suite/src/test/resources/it0143/repo/org/apache/maven/its/it0143/direct/0.1/direct-0.1.pom @@ -0,0 +1,83 @@ + + + + + + 4.0.0 + + org.apache.maven.its.it0143 + direct + 0.1 + jar + + + + maven-core-it + file:///${basedir}/repo + + + + + true + true + + + + + org.apache.maven.its.it0143 + compile + 0.1 + compile + + + org.apache.maven.its.it0143 + provided + 0.1 + provided + + + org.apache.maven.its.it0143 + runtime + 0.1 + runtime + + + org.apache.maven.its.it0143 + test + 0.1 + test + + + + + + + . + + pom.xml + src/** + + + + src/main/resources + + + + diff --git a/its/core-it-suite/src/test/resources/it0143/repo/org/apache/maven/its/it0143/direct/maven-metadata.xml b/its/core-it-suite/src/test/resources/it0143/repo/org/apache/maven/its/it0143/direct/maven-metadata.xml new file mode 100644 index 0000000000..090228471a --- /dev/null +++ b/its/core-it-suite/src/test/resources/it0143/repo/org/apache/maven/its/it0143/direct/maven-metadata.xml @@ -0,0 +1,11 @@ + + org.apache.maven.its.it0143 + direct + 0.1 + + + 0.1 + + 20081206182957 + + \ No newline at end of file diff --git a/its/core-it-suite/src/test/resources/it0143/repo/org/apache/maven/its/it0143/provided/0.1/provided-0.1.jar b/its/core-it-suite/src/test/resources/it0143/repo/org/apache/maven/its/it0143/provided/0.1/provided-0.1.jar new file mode 100644 index 0000000000000000000000000000000000000000..b38b3ab750a0d5178c9bb70a5a565d42193b26f7 GIT binary patch literal 2996 zcmWIWW@h1H0D)CA+bqEhD8UJ&eO*Hwbv^yu^aG&EI2cv}m7Tqn#*_+_t_ETeWM#gN zex7cw!6ACSZl8V6oc8h7)w{^+t*dqJ%=yhh23L$9JT21kI(I_HTi1z${mGKBDPr0O zR4R7P=?)V14hk-rtF=}{hFfT|agb<@@adq>Kp8LNVy^>_{MPxc6R7K27w%C%A*ccetfzB$(&(*8Q&1nsZ&A)6QQrkb}f5FO%hRj~; z8_Z1tAqk>_7reZWZ*e!@>3del`o_6UTp#c6Jm)TbL%@Gx|NG;X&*Ri<%Hzcf+HY~F z-uFA#bdx1unU=6oz4gv0{blRb-Yebzy!XS&l2_I7E?t)r*uom`DxT4vcS$`k`gTF@ zhJdYSb}UW$kTXwb9&gMUG?$#^Q zWZ%mydsL+~=5BVB`0W&@H@RDLV(G{5O%BNpkNcxCK9y`{j}x3eCBGx_pmf2yT^qL? zUiPk6tv$8wRdt%g_X-X7*=$KF zRA#;Ok$vyd7J0%gLHdgQgAB1bt#964n3T8TxbAt+j4yLvPmt}mU3j=b|FjJ#HgvmZD^R@7k`8JAIdxHZ8X|pYu=D>3`C?fD?C8 z<7fU2wMzM)a_QxTF11wFSqq(>&vs2_F4kUk;+53NFZ(ap?O69>earL+frT^v@z;J~ z-m&6jw#wLTvDZ|_zjIIC zm#Z*2^PaBo*R4r zi%&0!bK3uIt>VQmOBQsm4vOlMS^JYQz?+dtgc)}O3FtQ<5MX%g2%?diOE7KN8%!X@ zAh4uS9Z15pAvK>67DG%xF3dn}8yHy9xDUvL7E=gKn1wT_B!>WyYgt*4tc8{9FgIgr z29@jx%|@7-@t5T0$b$nTfboS9 e+$$i95UD=En-$oWWnka{!g?kK26<4UoB;sfg^#}g literal 0 HcmV?d00001 diff --git a/its/core-it-suite/src/test/resources/it0143/repo/org/apache/maven/its/it0143/provided/0.1/provided-0.1.pom b/its/core-it-suite/src/test/resources/it0143/repo/org/apache/maven/its/it0143/provided/0.1/provided-0.1.pom new file mode 100644 index 0000000000..9c189ffe75 --- /dev/null +++ b/its/core-it-suite/src/test/resources/it0143/repo/org/apache/maven/its/it0143/provided/0.1/provided-0.1.pom @@ -0,0 +1,56 @@ + + + + + + 4.0.0 + + org.apache.maven.its.it0143 + provided + 0.1 + jar + + + + maven-core-it + file:///${basedir}/repo + + + + + true + true + + + + + + . + + pom.xml + src/** + + + + src/main/resources + + + + diff --git a/its/core-it-suite/src/test/resources/it0143/repo/org/apache/maven/its/it0143/provided/maven-metadata.xml b/its/core-it-suite/src/test/resources/it0143/repo/org/apache/maven/its/it0143/provided/maven-metadata.xml new file mode 100644 index 0000000000..06663e9518 --- /dev/null +++ b/its/core-it-suite/src/test/resources/it0143/repo/org/apache/maven/its/it0143/provided/maven-metadata.xml @@ -0,0 +1,11 @@ + + org.apache.maven.its.it0143 + provided + 0.1 + + + 0.1 + + 20081206181318 + + \ No newline at end of file diff --git a/its/core-it-suite/src/test/resources/it0143/repo/org/apache/maven/its/it0143/runtime/0.1/runtime-0.1.jar b/its/core-it-suite/src/test/resources/it0143/repo/org/apache/maven/its/it0143/runtime/0.1/runtime-0.1.jar new file mode 100644 index 0000000000000000000000000000000000000000..8822d449e027653645054d9527cb41196ffc86aa GIT binary patch literal 2986 zcmWIWW@h1H0D*Ng+bqEhD8UJ&eO*Hwbv^yu^aG&EI2hIfm7Tqn#*_+_t_ETeWM#gN zex7cw!6ACSZl8V6oc8h7)w{^+t*dqJ%=yhh23L$9JT21kI(I_HTi1z${mGKBDPr0O zR4R7P=?)V14hk-rtF=}{hFfT|agb<@@adq>Kp8LNVy^>_{MPxc6R7K27w%C#q*%%nufzB$(&(*8Q&1nsZ&A)6QQrkb}f5FO%hRj~; z8_Z1tAqk>_7reZWZ*e!@>3del`o_6UTp#c6Jm)TbL%@Gx|NG;X&*Ri<%Hzcf+HY~F z-uFA#bdx1unU=6oz4gv0{blRb-Yebzy!XS&l2_I7E?t)r*uom`DxT4vcS$`k`gTF@ zhJdYSb}UW$kTXwb9&gMUG?$#^Q zWZ%mydsL+~=5BVB`0W&@H@RDLV(G{5O%BNpkNcxCK9y`{j}x3eCBGx_pmf2yT^qL? zUiPk6tv$8wRdt%g_X-X7*=$KF zRA#+glbz|>sVJS8>+`>Eab$tmrrpl&yB3OVw^5&av3#9#na#HvzRwGL*2hdTeJ8kW zXUXb~L2ehU?|$bc**2{Zl?FyyU*+tLtxA3pi{-ya)Rm??W*?njEzYOnI z{JFTM)oiQArp4NBSFLOVBpun8Yz@0yWzpCeY%b#_=(NmrZtts}iz|Xs9qiLTZD*J3 zHL^-oSMO()-5}`yt>H!eirt@7|5ovJJ~Pzie zv);O1I-b6P9;-q=`099{ef%_t&rc_?z|%L(z#!OQ%N8S(ZAM1n1!cT}21W)O9z4~8 zHaSc$7(aRHrGH9a_k+*Iv-)1wy>&c%&Usut%{p_@^vEEdBW!JI$M(c@x~k61>^!OJ zQ0lt0Qg!Cem3v} + + + + + 4.0.0 + + org.apache.maven.its.it0143 + runtime + 0.1 + jar + + + + maven-core-it + file:///${basedir}/repo + + + + + true + true + + + + + + . + + pom.xml + src/** + + + + src/main/resources + + + + diff --git a/its/core-it-suite/src/test/resources/it0143/repo/org/apache/maven/its/it0143/runtime/maven-metadata.xml b/its/core-it-suite/src/test/resources/it0143/repo/org/apache/maven/its/it0143/runtime/maven-metadata.xml new file mode 100644 index 0000000000..bc76a2542b --- /dev/null +++ b/its/core-it-suite/src/test/resources/it0143/repo/org/apache/maven/its/it0143/runtime/maven-metadata.xml @@ -0,0 +1,11 @@ + + org.apache.maven.its.it0143 + runtime + 0.1 + + + 0.1 + + 20081206181327 + + \ No newline at end of file diff --git a/its/core-it-suite/src/test/resources/it0143/repo/org/apache/maven/its/it0143/test/0.1/test-0.1.jar b/its/core-it-suite/src/test/resources/it0143/repo/org/apache/maven/its/it0143/test/0.1/test-0.1.jar new file mode 100644 index 0000000000000000000000000000000000000000..c6e944a54a0ebe3aeac39cdc0904b55f717f5f0b GIT binary patch literal 2963 zcmWIWW@h1H0D(<2+bqEhD8UJ&eO*Hwbv^yu^aG&EI2bkpm7Tqn#*_+_t_ETeWM#gN zex7cw!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f@CeM6oM`+f^)QrDW$89jETt^sOL7KtP zQXXbH_HrI({*uOHWSEW-u-Fqe!V)VEjDW=#HefG+EI}mm0B=@cQ + + + + + 4.0.0 + + org.apache.maven.its.it0143 + test + 0.1 + jar + + + + maven-core-it + file:///${basedir}/repo + + + + + true + true + + + + + + . + + pom.xml + src/** + + + + src/main/resources + + + + diff --git a/its/core-it-suite/src/test/resources/it0143/repo/org/apache/maven/its/it0143/test/maven-metadata.xml b/its/core-it-suite/src/test/resources/it0143/repo/org/apache/maven/its/it0143/test/maven-metadata.xml new file mode 100644 index 0000000000..e226e8a817 --- /dev/null +++ b/its/core-it-suite/src/test/resources/it0143/repo/org/apache/maven/its/it0143/test/maven-metadata.xml @@ -0,0 +1,11 @@ + + org.apache.maven.its.it0143 + test + 0.1 + + + 0.1 + + 20081206181336 + + \ No newline at end of file