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/03/31 00:51:46 UTC

svn commit: r929328 - in /maven/core-integration-testing/trunk/core-it-suite/src/test: java/org/apache/maven/it/ resources/mng-4403/repo/org/apache/maven/its/mng4403/b/0.1/ resources/mng-4418/

Author: bentmann
Date: Tue Mar 30 22:51:46 2010
New Revision: 929328

URL: http://svn.apache.org/viewvc?rev=929328&view=rev
Log:
[MNG-4418] Dependency resolution appears to misbehave if a remote repository uses the id "local"

o Added IT

Added:
    maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4418ReservedRepoIdLocalTest.java   (with props)
    maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4418/
    maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4418/pom.xml   (with props)
Modified:
    maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java
    maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4403/repo/org/apache/maven/its/mng4403/b/0.1/b-0.1.pom

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=929328&r1=929327&r2=929328&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 Tue Mar 30 22:51:46 2010
@@ -121,6 +121,7 @@ public class IntegrationTestSuite
         suite.addTestSuite( MavenITmng4423SessionDataFromPluginParameterExpressionTest.class );
         suite.addTestSuite( MavenITmng4422PluginExecutionPhaseInterpolationTest.class );
         suite.addTestSuite( MavenITmng4421DeprecatedPomInterpolationExpressionsTest.class );
+        suite.addTestSuite( MavenITmng4418ReservedRepoIdLocalTest.class );
         suite.addTestSuite( MavenITmng4416PluginOrderAfterProfileInjectionTest.class );
         suite.addTestSuite( MavenITmng4415InheritedPluginOrderTest.class );
         suite.addTestSuite( MavenITmng4413MirroringOfDependencyRepoTest.class );

Added: maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4418ReservedRepoIdLocalTest.java
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4418ReservedRepoIdLocalTest.java?rev=929328&view=auto
==============================================================================
--- maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4418ReservedRepoIdLocalTest.java (added)
+++ maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4418ReservedRepoIdLocalTest.java Tue Mar 30 22:51:46 2010
@@ -0,0 +1,67 @@
+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;
+
+/**
+ * This is a test set for <a href="http://jira.codehaus.org/browse/MNG-4418">MNG-4418</a>.
+ * 
+ * @author Benjamin Bentmann
+ */
+public class MavenITmng4418ReservedRepoIdLocalTest
+    extends AbstractMavenIntegrationTestCase
+{
+
+    public MavenITmng4418ReservedRepoIdLocalTest()
+    {
+        super( "[3.0-alpha-8,)" );
+    }
+
+    /**
+     * Test that remote repositories may not use the id "local" which is reserved for the local repository.
+     */
+    public void testit()
+        throws Exception
+    {
+        File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-4418" );
+
+        Verifier verifier = new Verifier( testDir.getAbsolutePath() );
+        verifier.setAutoclean( false );
+        try
+        {
+            verifier.executeGoal( "validate" );
+            verifier.verifyErrorFreeLog();
+            fail( "Reserved id 'local' should have caused model validation error." );
+        }
+        catch ( VerificationException e )
+        {
+            verifier.verifyTextInLog( "must not be 'local'" );
+        }
+        finally
+        {
+            verifier.resetStreams();
+        }
+    }
+
+}

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

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

Modified: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4403/repo/org/apache/maven/its/mng4403/b/0.1/b-0.1.pom
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4403/repo/org/apache/maven/its/mng4403/b/0.1/b-0.1.pom?rev=929328&r1=929327&r2=929328&view=diff
==============================================================================
--- maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4403/repo/org/apache/maven/its/mng4403/b/0.1/b-0.1.pom (original)
+++ maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4403/repo/org/apache/maven/its/mng4403/b/0.1/b-0.1.pom Tue Mar 30 22:51:46 2010
@@ -36,7 +36,8 @@ under the License.
 
   <distributionManagement>
     <repository>
-      <id>maven-core-it</id>
+      <!-- reserved id (MNG-4418) -->
+      <id>local</id>
       <url>file:///${basedir}/repo</url>
     </repository>
     <!-- remote-only field (MNG-4430) -->

Added: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4418/pom.xml
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4418/pom.xml?rev=929328&view=auto
==============================================================================
--- maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4418/pom.xml (added)
+++ maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4418/pom.xml Tue Mar 30 22:51:46 2010
@@ -0,0 +1,47 @@
+<?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.mng4418</groupId>
+  <artifactId>test</artifactId>
+  <version>0.1</version>
+
+  <name>Maven Integration Test :: MNG-4418</name>
+  <description>
+    Test that remote repositories may not use the id "local" which is reserved for the local repository.
+  </description>
+
+  <repositories>
+    <repository>
+      <id>local</id>
+      <url>http://localhost/</url>
+    </repository>
+  </repositories>
+
+  <distributionManagement>
+    <repository>
+      <id>local</id>
+      <url>http://localhost/</url>
+    </repository>
+  </distributionManagement>
+</project>

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

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