Ensure verifier resets streams if an exception is thrown when obtaining the Maven version, otherwise the error is consumed.

git-svn-id: https://svn.apache.org/repos/asf/maven/core-integration-testing/trunk@548787 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Mark Hobson 2007-06-19 16:22:11 +00:00
parent 3488007e24
commit 9ab1fd9c6e
1 changed files with 15 additions and 3 deletions

View File

@ -33,11 +33,23 @@ public class IntegrationTestSuite
public static Test suite() throws VerificationException
{
String mavenVersion = new Verifier( "" ).getMavenVersion();
Verifier verifier = null;
try
{
verifier = new Verifier( "" );
String mavenVersion = verifier.getMavenVersion();
out.println( "Running integration tests for Maven " + mavenVersion );
System.setProperty( "maven.version", mavenVersion );
}
finally
{
if ( verifier != null )
{
verifier.resetStreams();
}
}
TestSuite suite = new TestSuite();
suite.addTestSuite( MavenIT0000Test.class );