mirror of https://github.com/apache/maven.git
embedder tests that download artifacts and plugins should use the settings file for now to honour mirrors
git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@677239 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
e0e55f40ab
commit
d046f6039f
|
@ -43,6 +43,7 @@ public abstract class AbstractEmbedderTestCase
|
|||
ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
|
||||
|
||||
Configuration configuration = new DefaultConfiguration().setClassLoader( classLoader ).setMavenEmbedderLogger( new MavenEmbedderConsoleLogger() );
|
||||
configuration.setUserSettingsFile( MavenEmbedder.DEFAULT_USER_SETTINGS_FILE );
|
||||
|
||||
maven = new MavenEmbedder( configuration );
|
||||
|
||||
|
|
|
@ -74,6 +74,7 @@ public class MavenEmbedderTest
|
|||
Configuration configuration = new DefaultConfiguration()
|
||||
.setClassLoader( classLoader )
|
||||
.setMavenEmbedderLogger( new MavenEmbedderConsoleLogger() );
|
||||
configuration.setUserSettingsFile( MavenEmbedder.DEFAULT_USER_SETTINGS_FILE );
|
||||
|
||||
maven = new MavenEmbedder( configuration );
|
||||
}
|
||||
|
|
|
@ -31,6 +31,7 @@ import org.codehaus.plexus.PlexusTestCase;
|
|||
|
||||
import java.io.File;
|
||||
import java.util.Arrays;
|
||||
import java.util.Iterator;
|
||||
|
||||
public class MavenEmbedderCrappySettingsConfigurationTest
|
||||
extends PlexusTestCase
|
||||
|
@ -40,7 +41,7 @@ public class MavenEmbedderCrappySettingsConfigurationTest
|
|||
{
|
||||
// START SNIPPET: simple-embedder-example
|
||||
|
||||
File projectDirectory = new File( getBasedir(), "src/examples/simple-project" );
|
||||
File projectDirectory = getTestFile( "src/examples/simple-project" );
|
||||
|
||||
File user = new File( projectDirectory, "invalid-settings.xml" );
|
||||
|
||||
|
@ -58,9 +59,17 @@ public class MavenEmbedderCrappySettingsConfigurationTest
|
|||
|
||||
MavenExecutionRequest request = new DefaultMavenExecutionRequest()
|
||||
.setBaseDirectory( projectDirectory )
|
||||
.setGoals( Arrays.asList( new String[]{"clean", "install"} ) );
|
||||
.setGoals( Arrays.asList( new String[]{"validate"} ) );
|
||||
|
||||
MavenExecutionResult result = embedder.execute( request );
|
||||
|
||||
for ( Iterator i = result.getExceptions().iterator(); i.hasNext(); )
|
||||
{
|
||||
Exception e = (Exception) i.next();
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
assertFalse( result.hasExceptions() );
|
||||
|
||||
assertNotNull( result.getProject() );
|
||||
|
||||
|
|
|
@ -78,7 +78,8 @@ public class ErrorReporterPointcutTest
|
|||
|
||||
Configuration configuration = new DefaultConfiguration().setClassLoader( classLoader )
|
||||
.setMavenEmbedderLogger( new MavenEmbedderConsoleLogger() );
|
||||
|
||||
configuration.setUserSettingsFile( MavenEmbedder.DEFAULT_USER_SETTINGS_FILE );
|
||||
|
||||
maven = new MavenEmbedder( configuration );
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue