mirror of https://github.com/apache/maven.git
[MNG-2741] [regression] Meaningless error message: "Error transferring file"
o Added IT git-svn-id: https://svn.apache.org/repos/asf/maven/core-integration-testing/trunk@929216 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
1f2bfb7050
commit
fd589e23bb
|
@ -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 );
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -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>
|
|
@ -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>
|
Loading…
Reference in New Issue