[MNG-3848] Inheritance of project/site/scm URLs does not take child's relative location to parent into account

o Added IT (named after the original issue)

git-svn-id: https://svn.apache.org/repos/asf/maven/core-integration-testing/trunk@718316 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Benjamin Bentmann 2008-11-17 18:33:20 +00:00
parent cad836138f
commit f820c1badc
4 changed files with 189 additions and 0 deletions

View File

@ -187,6 +187,7 @@ public class IntegrationTestSuite
suite.addTestSuite( MavenITmng2068ReactorRelativeParentsTest.class );
suite.addTestSuite( MavenITmng2052InterpolateWithSettingsProfilePropertiesTest.class );
suite.addTestSuite( MavenITmng2045testJarDependenciesBrokenInReactorTest.class );
suite.addTestSuite( MavenITmng2006ChildPathAwareUrlInheritanceTest.class );
suite.addTestSuite( MavenITmng1999DefaultReportsInheritanceTest.class );
suite.addTestSuite( MavenITmng1703PluginMgmtDepInheritanceTest.class );
suite.addTestSuite( MavenITmng1493NonStandardModulePomNamesTest.class );

View File

@ -0,0 +1,71 @@
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-2006">MNG-2006</a>.
*
* @author Benjamin Bentmann
* @version $Id$
*/
public class MavenITmng2006ChildPathAwareUrlInheritanceTest
extends AbstractMavenIntegrationTestCase
{
public MavenITmng2006ChildPathAwareUrlInheritanceTest()
{
super( "(2.0.2,)" );
}
/**
* Test that inheritance of those URLs which automatically append the child's artifact id take the child's
* relative location to the parent into account.
*/
public void testitMNG2006()
throws Exception
{
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-2006" );
Verifier verifier = new Verifier( new File( testDir, "child" ).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" ) );
if ( matchesVersionRange( "(2.0.7,)" ) )
{
// MNG-3134
assertEquals( "http://site.project.url/child", props.getProperty( "project.distributionManagement.site.url" ) );
}
}
}

View File

@ -0,0 +1,64 @@
<?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.mng2006</groupId>
<artifactId>parent</artifactId>
<version>0.1</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>
<artifactId>child</artifactId>
<name>Child Project</name>
<description>
Test that inheritance of those URLs which automatically append the child's artifact id take the child's
relative location to the parent into account.
</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.mng2006</groupId>
<artifactId>parent</artifactId>
<version>0.1</version>
<packaging>pom</packaging>
<name>Maven Integration Test :: MNG-2006</name>
<description>
Test that inheritance of those URLs which automatically append the child's artifact id take the child's
relative location to the parent into account.
</description>
<modules>
<module>../child</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>