You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by ol...@apache.org on 2012/08/03 23:27:57 UTC
svn commit: r1369218 -
/maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/fixture/SurefireLauncher.java
Author: olamy
Date: Fri Aug 3 21:27:56 2012
New Revision: 1369218
URL: http://svn.apache.org/viewvc?rev=1369218&view=rev
Log:
no need to interpolate the file on each call
Modified:
maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/fixture/SurefireLauncher.java
Modified: maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/fixture/SurefireLauncher.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/fixture/SurefireLauncher.java?rev=1369218&r1=1369217&r2=1369218&view=diff
==============================================================================
--- maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/fixture/SurefireLauncher.java (original)
+++ maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/fixture/SurefireLauncher.java Fri Aug 3 21:27:56 2012
@@ -280,31 +280,37 @@ public class SurefireLauncher
public OutputValidator executeCurrentGoals()
{
- // hack "a la" invoker plugin to download dependencies from local repo
- // and not download from central
- try
+ String userLocalRepo = System.getProperty( "user.localRepository" );
+ String testBuildDirectory = System.getProperty( "testBuildDirectory" );
+
+ File interpolatedSettings = new File( testBuildDirectory, "interpolated-settings.xml" );
+ if ( !interpolatedSettings.exists() )
{
- String userLocalRepo = System.getProperty( "user.localRepository" );
- String testBuildDirectory = System.getProperty( "testBuildDirectory" );
+ // hack "a la" invoker plugin to download dependencies from local repo
+ // and not download from central
+ try
+ {
- Map<String, String> values = new HashMap<String, String>( 1 );
- values.put( "localRepositoryUrl", toUrl( userLocalRepo ) );
- StrSubstitutor strSubstitutor = new StrSubstitutor( values );
+ Map<String, String> values = new HashMap<String, String>( 1 );
+ values.put( "localRepositoryUrl", toUrl( userLocalRepo ) );
+ StrSubstitutor strSubstitutor = new StrSubstitutor( values );
- String fileContent = FileUtils.fileRead( new File( testBuildDirectory, "settings.xml" ) );
+ String fileContent = FileUtils.fileRead( new File( testBuildDirectory, "settings.xml" ) );
- File interpolatedSettings = new File( testBuildDirectory, "interpolated-settings.xml" );
- String filtered = strSubstitutor.replace( fileContent );
+ String filtered = strSubstitutor.replace( fileContent );
- FileUtils.fileWrite( interpolatedSettings.getAbsolutePath(), filtered );
+ FileUtils.fileWrite( interpolatedSettings.getAbsolutePath(), filtered );
- cliOptions.add( "-s " + interpolatedSettings.getAbsolutePath() );
- }
- catch ( IOException e )
- {
- throw new SurefireVerifierException( e );
+
+ }
+ catch ( IOException e )
+ {
+ throw new SurefireVerifierException( e );
+ }
}
+ cliOptions.add( "-s " + interpolatedSettings.getAbsolutePath() );
+
verifier.setCliOptions( cliOptions );
try
{