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 2010/04/02 23:59:30 UTC
svn commit: r930409 - in
/maven/core-integration-testing/trunk/core-it-suite/src/test:
java/org/apache/maven/it/ resources/mng-3133/ resources/mng-3133/child/
resources/mng-3133/parent/
Author: bentmann
Date: Fri Apr 2 21:59:29 2010
New Revision: 930409
URL: http://svn.apache.org/viewvc?rev=930409&view=rev
Log:
[MNG-3133] DefaultModelInheritence::appendPath assumes it is operating on interpolated/literal paths
o Added IT
Added:
maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3133UrlNormalizationNotBeforeInterpolationTest.java (with props)
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3133/
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3133/child/
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3133/child/pom.xml (with props)
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3133/parent/
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3133/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=930409&r1=930408&r2=930409&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 Fri Apr 2 21:59:29 2010
@@ -372,6 +372,7 @@ public class IntegrationTestSuite
suite.addTestSuite( MavenITmng3203DefaultLifecycleExecIdTest.class );
suite.addTestSuite( MavenITmng3183LoggingToFileTest.class );
suite.addTestSuite( MavenITmng3139UseCachedMetadataOfBlacklistedRepoTest.class );
+ suite.addTestSuite( MavenITmng3133UrlNormalizationNotBeforeInterpolationTest.class );
suite.addTestSuite( MavenITmng3122ActiveProfilesNoDuplicatesTest.class );
suite.addTestSuite( MavenITmng3118TestClassPathOrderTest.class );
suite.addTestSuite( MavenITmng3106ProfileMultipleActivatorsTest.class );
Added: maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3133UrlNormalizationNotBeforeInterpolationTest.java
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3133UrlNormalizationNotBeforeInterpolationTest.java?rev=930409&view=auto
==============================================================================
--- maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3133UrlNormalizationNotBeforeInterpolationTest.java (added)
+++ maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3133UrlNormalizationNotBeforeInterpolationTest.java Fri Apr 2 21:59:29 2010
@@ -0,0 +1,84 @@
+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-3133">MNG-3133</a>.
+ *
+ * @author Benjamin Bentmann
+ */
+public class MavenITmng3133UrlNormalizationNotBeforeInterpolationTest
+ extends AbstractMavenIntegrationTestCase
+{
+
+ public MavenITmng3133UrlNormalizationNotBeforeInterpolationTest()
+ {
+ super( "[3.0-beta-1,)" );
+ }
+
+ /**
+ * Verify that URL normalization does not happen before interpolation which would result in invalid
+ * inherited URLs for project layouts where the parent resides in a sibling directory of the child
+ * and expressions are used for the parent URLs ("${expression}/../foo" -> "foo").
+ */
+ public void testit()
+ throws Exception
+ {
+ File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-3133" );
+
+ Verifier verifier = new Verifier( new File( testDir, "child" ).getAbsolutePath() );
+ verifier.setAutoclean( false );
+ verifier.executeGoal( "validate" );
+ verifier.verifyErrorFreeLog();
+ verifier.resetStreams();
+
+ Properties props = verifier.loadProperties( "target/url.properties" );
+ String url;
+
+ url = props.getProperty( "project.url" );
+ assertEquals( "http://server.org/child", url );
+ url = props.getProperty( "project.scm.url" );
+ assertEquals( "scm:svn:https://svn.org/child", url );
+ url = props.getProperty( "project.scm.connection" );
+ assertEquals( "scm:svn:https://svn.org/child", url );
+ url = props.getProperty( "project.scm.developerConnection" );
+ assertEquals( "scm:svn:https://svn.org/child", url );
+ url = props.getProperty( "project.distributionManagement.site.url" );
+ assertEquals( "dav://server.org/child", url );
+
+ url = props.getProperty( "project.properties.projectUrl" );
+ assertEquals( "http://server.org/child/it", url );
+ url = props.getProperty( "project.properties.projectScmUrl" );
+ assertEquals( "scm:svn:https://svn.org/child/it", url );
+ url = props.getProperty( "project.properties.projectScmConn" );
+ assertEquals( "scm:svn:https://svn.org/child/it", url );
+ url = props.getProperty( "project.properties.projectScmDevConn" );
+ assertEquals( "scm:svn:https://svn.org/child/it", url );
+ url = props.getProperty( "project.properties.projectDistSiteUrl" );
+ assertEquals( "dav://server.org/child/it", url );
+ }
+
+}
Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3133UrlNormalizationNotBeforeInterpolationTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3133UrlNormalizationNotBeforeInterpolationTest.java
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Added: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3133/child/pom.xml
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3133/child/pom.xml?rev=930409&view=auto
==============================================================================
--- maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3133/child/pom.xml (added)
+++ maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3133/child/pom.xml Fri Apr 2 21:59:29 2010
@@ -0,0 +1,78 @@
+<?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.mng3133</groupId>
+ <artifactId>parent</artifactId>
+ <version>0.1-SNAPSHOT</version>
+ <relativePath>../parent</relativePath>
+ </parent>
+
+ <groupId>org.apache.maven.its.mng3133</groupId>
+ <artifactId>child</artifactId>
+ <version>0.1-SNAPSHOT</version>
+
+ <name>Maven Integration Test :: MNG-3133 :: Child</name>
+ <description>
+ Verify that URL normalization does not happen before interpolation which would result in invalid
+ inherited URLs for project layouts where the parent resides in a sibling directory of the child
+ and expressions are used for the parent URLs ("${expression}/../foo" -> "foo").
+ </description>
+
+ <properties>
+ <projectUrl>${project.url}/it</projectUrl>
+ <projectScmUrl>${project.scm.url}/it</projectScmUrl>
+ <projectScmConn>${project.scm.connection}/it</projectScmConn>
+ <projectScmDevConn>${project.scm.developerConnection}/it</projectScmDevConn>
+ <projectDistSiteUrl>${project.distributionManagement.site.url}/it</projectDistSiteUrl>
+ </properties>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.its.plugins</groupId>
+ <artifactId>maven-it-plugin-expression</artifactId>
+ <version>2.1-SNAPSHOT</version>
+ <configuration>
+ <outputFile>target/url.properties</outputFile>
+ <expressions>
+ <expression>project/properties</expression>
+ <expression>project/url</expression>
+ <expression>project/scm</expression>
+ <expression>project/distributionManagement/site/url</expression>
+ </expressions>
+ </configuration>
+ <executions>
+ <execution>
+ <id>test</id>
+ <phase>validate</phase>
+ <goals>
+ <goal>eval</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+</project>
Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3133/child/pom.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3133/child/pom.xml
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Added: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3133/parent/pom.xml
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3133/parent/pom.xml?rev=930409&view=auto
==============================================================================
--- maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3133/parent/pom.xml (added)
+++ maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3133/parent/pom.xml Fri Apr 2 21:59:29 2010
@@ -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>
+
+ <groupId>org.apache.maven.its.mng3133</groupId>
+ <artifactId>parent</artifactId>
+ <version>0.1-SNAPSHOT</version>
+ <packaging>pom</packaging>
+
+ <name>Maven Integration Test :: MNG-3133</name>
+ <description>
+ Verify that URL normalization does not happen before interpolation which would result in invalid
+ inherited URLs for project layouts where the parent resides in a sibling directory of the child
+ and expressions are used for the parent URLs ("${expression}/../foo" -> "foo").
+ </description>
+
+ <modules>
+ <module>../child</module>
+ </modules>
+
+ <properties>
+ <webUrl>http://server.org/project</webUrl>
+ <scmUrl>scm:svn:https://svn.org/project</scmUrl>
+ <siteUrl>dav://server.org/project</siteUrl>
+ </properties>
+
+ <url>${webUrl}</url>
+ <scm>
+ <url>${scmUrl}</url>
+ <connection>${scmUrl}</connection>
+ <developerConnection>${scmUrl}</developerConnection>
+ </scm>
+ <distributionManagement>
+ <site>
+ <id>website</id>
+ <url>${siteUrl}</url>
+ </site>
+ </distributionManagement>
+</project>
Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3133/parent/pom.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3133/parent/pom.xml
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision