maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bentm...@apache.org
Subject svn commit: r929216 - in /maven/core-integration-testing/trunk/core-it-suite/src/test: java/org/apache/maven/it/ resources/mng-2741/
Date Tue, 30 Mar 2010 18:37:25 GMT
Author: bentmann
Date: Tue Mar 30 18:37:25 2010
New Revision: 929216

URL: http://svn.apache.org/viewvc?rev=929216&view=rev
Log:
[MNG-2741] [regression] Meaningless error message: "Error transferring file"

o Added IT

Added:
    maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2741PluginMetadataResolutionErrorMessageTest.java
  (with props)
    maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-2741/
    maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-2741/pom.xml
  (with props)
    maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-2741/settings.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=929216&r1=929215&r2=929216&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 18:37:25 2010
@@ -392,6 +392,7 @@ public class IntegrationTestSuite
         suite.addTestSuite( MavenITmng2790LastUpdatedMetadataTest.class );
         suite.addTestSuite( MavenITmng2749ExtensionAvailableToPluginTest.class );
         suite.addTestSuite( MavenITmng2744checksumVerificationTest.class );
+        suite.addTestSuite( MavenITmng2741PluginMetadataResolutionErrorMessageTest.class
);
         suite.addTestSuite( MavenITmng2739RequiredRepositoryElementsTest.class );
         suite.addTestSuite( MavenITmng2720SiblingClasspathArtifactsTest.class );
         suite.addTestSuite( MavenITmng2695OfflinePluginSnapshotsTest.class );

Added: maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2741PluginMetadataResolutionErrorMessageTest.java
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2741PluginMetadataResolutionErrorMessageTest.java?rev=929216&view=auto
==============================================================================
--- maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2741PluginMetadataResolutionErrorMessageTest.java
(added)
+++ maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2741PluginMetadataResolutionErrorMessageTest.java
Tue Mar 30 18:37:25 2010
@@ -0,0 +1,96 @@
+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.List;
+
+/**
+ * This is a test set for <a href="http://jira.codehaus.org/browse/MNG-2741">MNG-2741</a>.
+ * 
+ * @version $Id$
+ */
+public class MavenITmng2741PluginMetadataResolutionErrorMessageTest
+    extends AbstractMavenIntegrationTestCase
+{
+
+    public MavenITmng2741PluginMetadataResolutionErrorMessageTest()
+    {
+        super( "[2.1.0,3.0-alpha-1),[3.0-alpha-8,)" );
+    }
+
+    /**
+     * Tests that plugin prefix metadata resolution errors tell the underlying transport
issue.
+     */
+    public void testitPrefix()
+        throws Exception
+    {
+        testit( "prefix", "foo:bar" );
+    }
+
+    /**
+     * Tests that plugin version metadata resolution errors tell the underlying transport
issue.
+     */
+    public void testitVersion()
+        throws Exception
+    {
+        testit( "version", "org.apache.maven.its.mng2741:maven-it-plugin:foo" );
+    }
+
+    private void testit( String test, String goal )
+        throws Exception
+    {
+        File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-2741"
);
+
+        Verifier verifier = new Verifier( testDir.getAbsolutePath() );
+        verifier.setAutoclean( false );
+        verifier.setLogFileName( "log-" + test + ".txt" );
+        verifier.getCliOptions().add( "--settings" );
+        verifier.getCliOptions().add( "settings.xml" );
+        try
+        {
+            verifier.executeGoal( goal );
+            fail( "Build should have failed to resolve plugin prefix" );
+        }
+        catch ( VerificationException e )
+        {
+            boolean foundCause = false;
+            List lines = verifier.loadLines( verifier.getLogFileName(), "UTF-8" );
+            for ( int i = 0; i < lines.size(); i++ )
+            {
+                String line = lines.get( i ).toString();
+                if ( line.matches( ".*Connection refused.*" ) )
+                {
+                    foundCause = true;
+                    break;
+                }
+            }
+            assertTrue( "Transfer error cause was not found", foundCause );
+        }
+        finally
+        {
+            verifier.resetStreams();
+        }
+    }
+
+}

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

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

Added: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-2741/pom.xml
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-2741/pom.xml?rev=929216&view=auto
==============================================================================
--- maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-2741/pom.xml
(added)
+++ maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-2741/pom.xml
Tue Mar 30 18:37:25 2010
@@ -0,0 +1,34 @@
+<?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.mng2741</groupId>
+  <artifactId>test</artifactId>
+  <packaging>jar</packaging>
+  <version>1</version>
+
+  <name>Maven Integration Test :: MNG-2741</name> 
+  <description>
+    Tests that plugin prefix/version metadata resolution errors tell the underlying transport
issue.
+  </description>
+</project>

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

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

Added: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-2741/settings.xml
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-2741/settings.xml?rev=929216&view=auto
==============================================================================
--- maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-2741/settings.xml
(added)
+++ maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-2741/settings.xml
Tue Mar 30 18:37:25 2010
@@ -0,0 +1,58 @@
+<?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.
+-->
+
+<settings>
+  <pluginGroups>
+    <pluginGroup>org.apache.maven.its.mng2741</pluginGroup>
+  </pluginGroups>
+  <profiles>
+    <profile>
+      <id>maven-core-it-repo</id>
+      <repositories>
+        <repository>
+          <id>central</id>
+          <url>http://localhost:54312/repo</url>
+          <releases>
+            <checksumPolicy>ignore</checksumPolicy>
+          </releases>
+          <snapshots>
+            <checksumPolicy>ignore</checksumPolicy>
+          </snapshots>
+        </repository>
+      </repositories>
+      <pluginRepositories>
+        <pluginRepository>
+          <id>central</id>
+          <url>http://localhost:54312/repo</url>
+          <releases>
+            <checksumPolicy>ignore</checksumPolicy>
+          </releases>
+          <snapshots>
+            <checksumPolicy>ignore</checksumPolicy>
+          </snapshots>
+        </pluginRepository>
+      </pluginRepositories>
+    </profile>
+  </profiles>
+  <activeProfiles>
+    <activeProfile>maven-core-it-repo</activeProfile>
+  </activeProfiles>
+</settings>

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

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



Mime
View raw message