move system property specification to system.properties in itests

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@177983 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Brett Leslie Porter 2005-05-23 13:37:34 +00:00
parent e1c145bffa
commit 68595a32c2
7 changed files with 39 additions and 6 deletions

View File

@ -26,6 +26,7 @@ import java.util.ArrayList;
import java.util.Collections; import java.util.Collections;
import java.util.Iterator; import java.util.Iterator;
import java.util.List; import java.util.List;
import java.util.Properties;
import java.util.StringTokenizer; import java.util.StringTokenizer;
/** /**
@ -122,6 +123,28 @@ public class Verifier
} }
} }
private static Properties loadProperties( File propertiesFile )
throws VerificationException
{
Properties properties = new Properties();
FileInputStream fis = null;
try
{
if ( propertiesFile.exists() )
{
fis = new FileInputStream( propertiesFile );
properties.load( fis );
}
}
catch ( IOException e )
{
throw new VerificationException( "Error reading properties file", e );
}
return properties;
}
private static List loadFile( String basedir, String filename ) private static List loadFile( String basedir, String filename )
throws VerificationException throws VerificationException
{ {
@ -399,7 +422,7 @@ public class Verifier
// //
// ---------------------------------------------------------------------- // ----------------------------------------------------------------------
public void executeGoals( String filename ) public void executeGoals( Properties properties, String filename )
throws VerificationException throws VerificationException
{ {
String mavenHome = System.getProperty( "maven.home" ); String mavenHome = System.getProperty( "maven.home" );
@ -439,6 +462,12 @@ public class Verifier
cli.createArgument().setValue( "-e" ); cli.createArgument().setValue( "-e" );
for ( Iterator i = properties.keySet().iterator(); i.hasNext(); )
{
String key = (String) i.next();
cli.createArgument().setLine( "-D" + key + "=" + properties.getProperty( key ) );
}
for ( Iterator i = allGoals.iterator(); i.hasNext(); ) for ( Iterator i = allGoals.iterator(); i.hasNext(); )
{ {
cli.createArgument().setValue( (String) i.next() ); cli.createArgument().setValue( (String) i.next() );
@ -450,7 +479,7 @@ public class Verifier
StreamConsumer err = new WriterStreamConsumer( logWriter ); StreamConsumer err = new WriterStreamConsumer( logWriter );
System.out.println( Commandline.toString( cli.getCommandline() ) ); System.out.println( "Command: " + Commandline.toString( cli.getCommandline() ) );
ret = CommandLineUtils.executeCommandLine( cli, out, err ); ret = CommandLineUtils.executeCommandLine( cli, out, err );
@ -533,7 +562,9 @@ public class Verifier
{ {
verifier.executeHook( "prebuild-hook.txt" ); verifier.executeHook( "prebuild-hook.txt" );
verifier.executeGoals( "goals.txt" ); Properties properties = verifier.loadProperties( new File( basedir, "system.properties" ) );
verifier.executeGoals( properties, "goals.txt" );
verifier.executeHook( "postbuild-hook.txt" ); verifier.executeHook( "postbuild-hook.txt" );

View File

@ -1,3 +1,2 @@
-DupdateReleaseInfo=true
install install
it0013:it0013 it0013:it0013

View File

@ -0,0 +1,2 @@
updateReleaseInfo=true

View File

@ -1,3 +1,2 @@
-DupdateReleaseInfo=true
install install
it0015:it0015 it0015:it0015

View File

@ -0,0 +1,2 @@
updateReleaseInfo=true

View File

@ -1,3 +1,2 @@
-DupdateReleaseInfo=true
install install
it0020:it0020 it0020:it0020

View File

@ -0,0 +1 @@
updateReleaseInfo=true