mirror of https://github.com/apache/maven.git
o Strengthened IT to check deeper inheritance hierarchy
git-svn-id: https://svn.apache.org/repos/asf/maven/core-integration-testing/trunk@757167 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
23de707abc
commit
9c2e480a90
|
@ -43,7 +43,7 @@ public class MavenITmng3846PomInheritanceUrlAdjustmentTest
|
|||
/**
|
||||
* Test that inheritance of certain URLs automatically appends the child's artifact id.
|
||||
*/
|
||||
public void testitMNG3846()
|
||||
public void testitOneParent()
|
||||
throws Exception
|
||||
{
|
||||
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-3846" );
|
||||
|
@ -70,4 +70,35 @@ public class MavenITmng3846PomInheritanceUrlAdjustmentTest
|
|||
assertEquals( "http://parent.url/download", props.getProperty( "project.distributionManagement.downloadUrl" ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Test that inheritance of certain URLs automatically appends the child's artifact id. In a deeper inheritance
|
||||
* hierarchy, this should contribute the artifact id of each parent that does not override the URLs.
|
||||
*/
|
||||
public void testitTwoParents()
|
||||
throws Exception
|
||||
{
|
||||
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-3846" );
|
||||
|
||||
Verifier verifier = new Verifier( new File( testDir, "another-parent/sub" ).getAbsolutePath() );
|
||||
verifier.setAutoclean( false );
|
||||
verifier.deleteDirectory( "target" );
|
||||
verifier.executeGoal( "validate" );
|
||||
verifier.verifyErrorFreeLog();
|
||||
verifier.resetStreams();
|
||||
|
||||
Properties props = verifier.loadProperties( "target/pom.properties" );
|
||||
assertEquals( "http://parent.url/ap/child", props.getProperty( "project.url" ) );
|
||||
assertEquals( "http://parent.url/org/", props.getProperty( "project.organization.url" ) );
|
||||
assertEquals( "http://parent.url/license.txt", props.getProperty( "project.licenses.0.url" ) );
|
||||
assertEquals( "http://parent.url/viewvc/ap/child", props.getProperty( "project.scm.url" ) );
|
||||
assertEquals( "http://parent.url/scm/ap/child", props.getProperty( "project.scm.connection" ) );
|
||||
assertEquals( "https://parent.url/scm/ap/child", props.getProperty( "project.scm.developerConnection" ) );
|
||||
assertEquals( "http://parent.url/issues", props.getProperty( "project.issueManagement.url" ) );
|
||||
assertEquals( "http://parent.url/ci", props.getProperty( "project.ciManagement.url" ) );
|
||||
assertEquals( "http://parent.url/dist", props.getProperty( "project.distributionManagement.repository.url" ) );
|
||||
assertEquals( "http://parent.url/snaps", props.getProperty( "project.distributionManagement.snapshotRepository.url" ) );
|
||||
assertEquals( "http://parent.url/site/ap/child", props.getProperty( "project.distributionManagement.site.url" ) );
|
||||
assertEquals( "http://parent.url/download", props.getProperty( "project.distributionManagement.downloadUrl" ) );
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,36 @@
|
|||
<?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>
|
||||
|
||||
<!-- NOTE: The base directory name of this project deliberately does not match its artifact id! -->
|
||||
|
||||
<parent>
|
||||
<groupId>org.apache.maven.its.mng3846</groupId>
|
||||
<artifactId>parent</artifactId>
|
||||
<version>0.1</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>ap</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
<name>Another Parent to test multi-level URL adjustment</name>
|
||||
</project>
|
|
@ -0,0 +1,59 @@
|
|||
<?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>
|
||||
|
||||
<!-- NOTE: The base directory name of this project deliberately does not match its artifact id! -->
|
||||
|
||||
<parent>
|
||||
<groupId>org.apache.maven.its.mng3846</groupId>
|
||||
<artifactId>ap</artifactId>
|
||||
<version>0.1</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>child</artifactId>
|
||||
<name>Child Project</name>
|
||||
|
||||
<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</expression>
|
||||
</expressions>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
Loading…
Reference in New Issue