Author: bentmann
Date: Tue Mar 30 21:25:27 2010
New Revision: 929297

URL: http://svn.apache.org/viewvc?rev=929297&view=rev
Log:
[MNG-3477] Authentication failures on dependency download aren't reported

o Added IT

Added:
    
maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3477DependencyResolutionErrorMessageTest.java
   (with props)
    
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3477/
    
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3477/pom.xml
   (with props)
    
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3477/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=929297&r1=929296&r2=929297&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 21:25:27 2010
@@ -339,6 +339,7 @@ public class IntegrationTestSuite
         suite.addTestSuite( MavenITmng3498ForkToOtherMojoTest.class );
         suite.addTestSuite( MavenITmng3485OverrideWagonExtensionTest.class );
         suite.addTestSuite( MavenITmng3482DependencyPomInterpolationTest.class 
);
+        suite.addTestSuite( 
MavenITmng3477DependencyResolutionErrorMessageTest.class );
         suite.addTestSuite( MavenITmng3475BaseAlignedDirTest.class );
         suite.addTestSuite( MavenITmng3461MirrorMatchingTest.class );
         suite.addTestSuite( 
MavenITmng3441MetadataUpdatedFromDeploymentRepositoryTest.class );

Added: 
maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3477DependencyResolutionErrorMessageTest.java
URL: 
http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3477DependencyResolutionErrorMessageTest.java?rev=929297&view=auto
==============================================================================
--- 
maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3477DependencyResolutionErrorMessageTest.java
 (added)
+++ 
maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3477DependencyResolutionErrorMessageTest.java
 Tue Mar 30 21:25:27 2010
@@ -0,0 +1,81 @@
+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-3477";>MNG-3477</a>.
+ * 
+ * @version $Id$
+ */
+public class MavenITmng3477DependencyResolutionErrorMessageTest
+    extends AbstractMavenIntegrationTestCase
+{
+
+    public MavenITmng3477DependencyResolutionErrorMessageTest()
+    {
+        super( "[2.1.0,3.0-alpha-1),[3.0-alpha-8,)" );
+    }
+
+    /**
+     * Tests that dependency resolution errors tell the underlying transport 
issue.
+     */
+    public void testit()
+        throws Exception
+    {
+        File testDir = ResourceExtractor.simpleExtractResources( getClass(), 
"/mng-3477" );
+
+        Verifier verifier = new Verifier( testDir.getAbsolutePath() );
+        verifier.setAutoclean( false );
+        verifier.deleteArtifacts( "org.apache.maven.its.mng3477" );
+        verifier.getCliOptions().add( "--settings" );
+        verifier.getCliOptions().add( "settings.xml" );
+        try
+        {
+            verifier.executeGoal( "validate" );
+            fail( "Build should have failed to resolve dependency" );
+        }
+        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( 
".*org.apache.maven.its.mng3477:dep:jar:1.0.*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/MavenITmng3477DependencyResolutionErrorMessageTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

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

Added: 
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3477/pom.xml
URL: 
http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3477/pom.xml?rev=929297&view=auto
==============================================================================
--- 
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3477/pom.xml
 (added)
+++ 
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3477/pom.xml
 Tue Mar 30 21:25:27 2010
@@ -0,0 +1,61 @@
+<?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.mng3477</groupId>
+  <artifactId>test</artifactId>
+  <packaging>jar</packaging>
+  <version>1</version>
+
+  <name>Maven Integration Test :: MNG-3477</name> 
+  <description>
+    Tests that dependency resolution errors tell the underlying transport 
issue.
+  </description>
+
+  <dependencies>
+    <dependency>
+      <groupId>org.apache.maven.its.mng3477</groupId>
+      <artifactId>dep</artifactId>
+      <version>1.0</version>
+    </dependency>
+  </dependencies>
+
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.its.plugins</groupId>
+        <artifactId>maven-it-plugin-dependency-resolution</artifactId>
+        <version>2.1-SNAPSHOT</version>
+        <executions>
+          <execution>
+            <id>test</id>
+            <phase>validate</phase>
+            <goals>
+              <goal>compile</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
+</project>

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

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

Added: 
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3477/settings.xml
URL: 
http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3477/settings.xml?rev=929297&view=auto
==============================================================================
--- 
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3477/settings.xml
 (added)
+++ 
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3477/settings.xml
 Tue Mar 30 21:25:27 2010
@@ -0,0 +1,43 @@
+<?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>
+  <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>
+            <enabled>false</enabled>
+          </snapshots>
+        </repository>
+      </repositories>
+    </profile>
+  </profiles>
+  <activeProfiles>
+    <activeProfile>maven-core-it-repo</activeProfile>
+  </activeProfiles>
+</settings>

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

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


Reply via email to