Author: bentmann
Date: Sun Mar 22 10:30:23 2009
New Revision: 757167
URL: http://svn.apache.org/viewvc?rev=757167&view=rev
Log:
o Strengthened IT to check deeper inheritance hierarchy
Added:
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3846/another-parent/
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3846/another-parent/pom.xml
(with props)
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3846/another-parent/sub/
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3846/another-parent/sub/pom.xml
(with props)
Modified:
maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3846PomInheritanceUrlAdjustmentTest.java
Modified:
maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3846PomInheritanceUrlAdjustmentTest.java
URL:
http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3846PomInheritanceUrlAdjustmentTest.java?rev=757167&r1=757166&r2=757167&view=diff
==============================================================================
---
maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3846PomInheritanceUrlAdjustmentTest.java
(original)
+++
maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3846PomInheritanceUrlAdjustmentTest.java
Sun Mar 22 10:30:23 2009
@@ -43,7 +43,7 @@
/**
* 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 @@
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" ) );
+ }
+
}
Added:
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3846/another-parent/pom.xml
URL:
http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3846/another-parent/pom.xml?rev=757167&view=auto
==============================================================================
---
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3846/another-parent/pom.xml
(added)
+++
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3846/another-parent/pom.xml
Sun Mar 22 10:30:23 2009
@@ -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>
Propchange:
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3846/another-parent/pom.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3846/another-parent/pom.xml
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Added:
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3846/another-parent/sub/pom.xml
URL:
http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3846/another-parent/sub/pom.xml?rev=757167&view=auto
==============================================================================
---
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3846/another-parent/sub/pom.xml
(added)
+++
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3846/another-parent/sub/pom.xml
Sun Mar 22 10:30:23 2009
@@ -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>
Propchange:
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3846/another-parent/sub/pom.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3846/another-parent/sub/pom.xml
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision