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:
Brett Leslie Porter 2008-07-16 11:18:50 +00:00
parent e0e55f40ab
commit d046f6039f
4 changed files with 15 additions and 3 deletions

View File

@ -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 );

View File

@ -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 );
}

View File

@ -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,10 +59,18 @@ 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() );
MavenProject project = result.getProject();

View File

@ -78,6 +78,7 @@ public class ErrorReporterPointcutTest
Configuration configuration = new DefaultConfiguration().setClassLoader( classLoader )
.setMavenEmbedderLogger( new MavenEmbedderConsoleLogger() );
configuration.setUserSettingsFile( MavenEmbedder.DEFAULT_USER_SETTINGS_FILE );
maven = new MavenEmbedder( configuration );
}