From 002dca2b56108e0167ad1980136795ab5d072cc5 Mon Sep 17 00:00:00 2001 From: Benjamin Bentmann Date: Sun, 20 Feb 2011 15:33:06 +0000 Subject: [PATCH] [MNG-5000] [regression] child distributionManagment.site.url not correct in a flat directory layout when child's artifactId doesn't match its module name o Added IT git-svn-id: https://svn.apache.org/repos/asf/maven/core-integration-testing/trunk@1072612 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/maven/it/IntegrationTestSuite.java | 1 + ...g5000ChildPathAwareUrlInheritanceTest.java | 68 +++++++++++++++++++ .../different-from-artifactId/pom.xml | 66 ++++++++++++++++++ .../test/resources/mng-5000/parent/pom.xml | 53 +++++++++++++++ 4 files changed, 188 insertions(+) create mode 100644 its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5000ChildPathAwareUrlInheritanceTest.java create mode 100644 its/core-it-suite/src/test/resources/mng-5000/different-from-artifactId/pom.xml create mode 100644 its/core-it-suite/src/test/resources/mng-5000/parent/pom.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 e2b4c15f6d..156bf0df07 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 @@ -87,6 +87,7 @@ public class IntegrationTestSuite suite.addTestSuite( MavenITmng5012CollectionVsArrayParamCoercionTest.class ); suite.addTestSuite( MavenITmng5011ConfigureCollectionArrayFromSystemPropTest.class ); suite.addTestSuite( MavenITmng5009AggregationCycleTest.class ); + suite.addTestSuite( MavenITmng5000ChildPathAwareUrlInheritanceTest.class ); suite.addTestSuite( MavenITmng4992MapStylePropertiesParamConfigTest.class ); suite.addTestSuite( MavenITmng4975ProfileInjectedPluginExecutionOrderTest.class ); suite.addTestSuite( MavenITmng4973ExtensionVisibleToPluginInReactorTest.class ); diff --git a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5000ChildPathAwareUrlInheritanceTest.java b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5000ChildPathAwareUrlInheritanceTest.java new file mode 100644 index 0000000000..f7b9fbceed --- /dev/null +++ b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5000ChildPathAwareUrlInheritanceTest.java @@ -0,0 +1,68 @@ +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.Properties; + +/** + * This is a test set for MNG-5000. Note this is a subtle + * variation and not a duplicate of the test for MNG-2006. + * + * @author Benjamin Bentmann + * @version $Id$ + */ +public class MavenITmng5000ChildPathAwareUrlInheritanceTest + extends AbstractMavenIntegrationTestCase +{ + + public MavenITmng5000ChildPathAwareUrlInheritanceTest() + { + super( "[2.0.11,2.0.99),[2.2.0,3.0-alpha-1),[3.0.3,)" ); + } + + /** + * Verify that child path aware URL adjustment still works when the child's artifactId doesn't match the name + * of its base directory as given in the parent's module section. + */ + public void testit() + throws Exception + { + File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-5000" ); + + Verifier verifier = newVerifier( new File( testDir, "different-from-artifactId" ).getAbsolutePath() ); + verifier.setAutoclean( false ); + verifier.deleteDirectory( "target" ); + verifier.executeGoal( "validate" ); + verifier.verifyErrorFreeLog(); + verifier.resetStreams(); + + Properties props = verifier.loadProperties( "target/pom.properties" ); + assertEquals( "http://project.url/child", props.getProperty( "project.url" ) ); + assertEquals( "http://viewvc.project.url/child", props.getProperty( "project.scm.url" ) ); + assertEquals( "http://scm.project.url/child", props.getProperty( "project.scm.connection" ) ); + assertEquals( "https://scm.project.url/child", props.getProperty( "project.scm.developerConnection" ) ); + assertEquals( "http://site.project.url/child", props.getProperty( "project.distributionManagement.site.url" ) ); + } + +} diff --git a/its/core-it-suite/src/test/resources/mng-5000/different-from-artifactId/pom.xml b/its/core-it-suite/src/test/resources/mng-5000/different-from-artifactId/pom.xml new file mode 100644 index 0000000000..1f7c36982f --- /dev/null +++ b/its/core-it-suite/src/test/resources/mng-5000/different-from-artifactId/pom.xml @@ -0,0 +1,66 @@ + + + + + + 4.0.0 + + + org.apache.maven.its.mng5000 + parent + 0.1 + ../parent/pom.xml + + + + child + + Maven Integration Test :: MNG-5000 :: Child + + Verify that child path aware URL adjustment still works when the child's artifactId doesn't match the name + of its base directory as given in the parent's module section. + + + + + + org.apache.maven.its.plugins + maven-it-plugin-expression + 2.1-SNAPSHOT + + + validate + + eval + + + target/pom.properties + + project/url + project/scm + project/distributionManagement/site + + + + + + + + diff --git a/its/core-it-suite/src/test/resources/mng-5000/parent/pom.xml b/its/core-it-suite/src/test/resources/mng-5000/parent/pom.xml new file mode 100644 index 0000000000..a4e5f36e45 --- /dev/null +++ b/its/core-it-suite/src/test/resources/mng-5000/parent/pom.xml @@ -0,0 +1,53 @@ + + + + + + 4.0.0 + + org.apache.maven.its.mng5000 + parent + 0.1 + pom + + Maven Integration Test :: MNG-5000 + + Verify that child path aware URL adjustment still works when the child's artifactId doesn't match the name + of its base directory as given in the parent's module section. + + + + ../different-from-artifactId + + + http://project.url/parent + + + http://viewvc.project.url/parent + http://scm.project.url/parent + https://scm.project.url/parent + + + + http://site.project.url/parent + parent.site + + +