[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
This commit is contained in:
Benjamin Bentmann 2011-02-20 15:33:06 +00:00
parent 6d524297e9
commit 002dca2b56
4 changed files with 188 additions and 0 deletions

View File

@ -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 );

View File

@ -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 <a href="http://jira.codehaus.org/browse/MNG-5000">MNG-5000</a>. 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" ) );
}
}

View File

@ -0,0 +1,66 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
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.
-->
<project>
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.maven.its.mng5000</groupId>
<artifactId>parent</artifactId>
<version>0.1</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>
<!-- NOTE: The artifact id being different from the project's directory name is the crucial piece here -->
<artifactId>child</artifactId>
<name>Maven Integration Test :: MNG-5000 :: Child</name>
<description>
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.
</description>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.its.plugins</groupId>
<artifactId>maven-it-plugin-expression</artifactId>
<version>2.1-SNAPSHOT</version>
<executions>
<execution>
<phase>validate</phase>
<goals>
<goal>eval</goal>
</goals>
<configuration>
<outputFile>target/pom.properties</outputFile>
<expressions>
<expression>project/url</expression>
<expression>project/scm</expression>
<expression>project/distributionManagement/site</expression>
</expressions>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View File

@ -0,0 +1,53 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
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.
-->
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>org.apache.maven.its.mng5000</groupId>
<artifactId>parent</artifactId>
<version>0.1</version>
<packaging>pom</packaging>
<name>Maven Integration Test :: MNG-5000</name>
<description>
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.
</description>
<modules>
<module>../different-from-artifactId</module>
</modules>
<url>http://project.url/parent</url>
<scm>
<url>http://viewvc.project.url/parent</url>
<connection>http://scm.project.url/parent</connection>
<developerConnection>https://scm.project.url/parent</developerConnection>
</scm>
<distributionManagement>
<site>
<url>http://site.project.url/parent</url>
<id>parent.site</id>
</site>
</distributionManagement>
</project>