You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by be...@apache.org on 2008/11/17 19:33:20 UTC

svn commit: r718316 - in /maven/core-integration-testing/trunk/core-it-suite/src/test: java/org/apache/maven/it/ resources/mng-2006/ resources/mng-2006/child/ resources/mng-2006/parent/

Author: bentmann
Date: Mon Nov 17 10:33:20 2008
New Revision: 718316

URL: http://svn.apache.org/viewvc?rev=718316&view=rev
Log:
[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)

Added:
    maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2006ChildPathAwareUrlInheritanceTest.java   (with props)
    maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-2006/
    maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-2006/child/
    maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-2006/child/pom.xml   (with props)
    maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-2006/parent/
    maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-2006/parent/pom.xml   (with props)
Modified:
    maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java

Modified: maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java?rev=718316&r1=718315&r2=718316&view=diff
==============================================================================
--- maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java (original)
+++ maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java Mon Nov 17 10:33:20 2008
@@ -187,6 +187,7 @@
         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 );

Added: maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2006ChildPathAwareUrlInheritanceTest.java
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2006ChildPathAwareUrlInheritanceTest.java?rev=718316&view=auto
==============================================================================
--- maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2006ChildPathAwareUrlInheritanceTest.java (added)
+++ maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2006ChildPathAwareUrlInheritanceTest.java Mon Nov 17 10:33:20 2008
@@ -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" ) );
+        }
+    }
+
+}

Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2006ChildPathAwareUrlInheritanceTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2006ChildPathAwareUrlInheritanceTest.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-2006/child/pom.xml
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-2006/child/pom.xml?rev=718316&view=auto
==============================================================================
--- maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-2006/child/pom.xml (added)
+++ maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-2006/child/pom.xml Mon Nov 17 10:33:20 2008
@@ -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>

Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-2006/child/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-2006/child/pom.xml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-2006/parent/pom.xml
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-2006/parent/pom.xml?rev=718316&view=auto
==============================================================================
--- maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-2006/parent/pom.xml (added)
+++ maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-2006/parent/pom.xml Mon Nov 17 10:33:20 2008
@@ -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>

Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-2006/parent/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-2006/parent/pom.xml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision