mirror of https://github.com/apache/maven.git
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:
parent
e1c145bffa
commit
68595a32c2
|
@ -26,6 +26,7 @@ import java.util.ArrayList;
|
|||
import java.util.Collections;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Properties;
|
||||
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 )
|
||||
throws VerificationException
|
||||
{
|
||||
|
@ -399,7 +422,7 @@ public class Verifier
|
|||
//
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
public void executeGoals( String filename )
|
||||
public void executeGoals( Properties properties, String filename )
|
||||
throws VerificationException
|
||||
{
|
||||
String mavenHome = System.getProperty( "maven.home" );
|
||||
|
@ -439,6 +462,12 @@ public class Verifier
|
|||
|
||||
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(); )
|
||||
{
|
||||
cli.createArgument().setValue( (String) i.next() );
|
||||
|
@ -450,7 +479,7 @@ public class Verifier
|
|||
|
||||
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 );
|
||||
|
||||
|
@ -533,7 +562,9 @@ public class Verifier
|
|||
{
|
||||
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" );
|
||||
|
||||
|
|
|
@ -1,3 +1,2 @@
|
|||
-DupdateReleaseInfo=true
|
||||
install
|
||||
it0013:it0013
|
||||
|
|
|
@ -0,0 +1,2 @@
|
|||
updateReleaseInfo=true
|
||||
|
|
@ -1,3 +1,2 @@
|
|||
-DupdateReleaseInfo=true
|
||||
install
|
||||
it0015:it0015
|
||||
|
|
|
@ -0,0 +1,2 @@
|
|||
updateReleaseInfo=true
|
||||
|
|
@ -1,3 +1,2 @@
|
|||
-DupdateReleaseInfo=true
|
||||
install
|
||||
it0020:it0020
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
updateReleaseInfo=true
|
Loading…
Reference in New Issue