o Extended IT to check resume-from

git-svn-id: https://svn.apache.org/repos/asf/maven/core-integration-testing/trunk@795025 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Benjamin Bentmann 2009-07-17 10:02:33 +00:00
parent e8c89f8d06
commit b2e3158b07
1 changed files with 39 additions and 21 deletions

View File

@ -38,21 +38,27 @@ public class MavenITmng2576MakeLikeReactorTest
super( "[2.1.0,)" );
}
private void clean( Verifier verifier )
throws Exception
{
verifier.deleteDirectory( "target" );
verifier.deleteDirectory( "sub-a/target" );
verifier.deleteDirectory( "sub-b/target" );
verifier.deleteDirectory( "sub-c/target" );
verifier.deleteDirectory( "sub-d/target" );
}
/**
* Verify that project list by itself only builds specified projects.
*/
public void testitOnlyList()
public void testitMakeOnlyList()
throws Exception
{
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-2576" );
Verifier verifier = new Verifier( testDir.getAbsolutePath() );
verifier.setAutoclean( false );
verifier.deleteDirectory( "target" );
verifier.deleteDirectory( "sub-a/target" );
verifier.deleteDirectory( "sub-b/target" );
verifier.deleteDirectory( "sub-c/target" );
verifier.deleteDirectory( "sub-d/target" );
clean( verifier );
verifier.getCliOptions().add( "-pl" );
verifier.getCliOptions().add( "sub-b" );
verifier.setLogFileName( "log-only.txt" );
@ -77,11 +83,7 @@ public class MavenITmng2576MakeLikeReactorTest
Verifier verifier = new Verifier( testDir.getAbsolutePath() );
verifier.setAutoclean( false );
verifier.deleteDirectory( "target" );
verifier.deleteDirectory( "sub-a/target" );
verifier.deleteDirectory( "sub-b/target" );
verifier.deleteDirectory( "sub-c/target" );
verifier.deleteDirectory( "sub-d/target" );
clean( verifier );
verifier.getCliOptions().add( "-pl" );
verifier.getCliOptions().add( "sub-b" );
verifier.getCliOptions().add( "-am" );
@ -107,11 +109,7 @@ public class MavenITmng2576MakeLikeReactorTest
Verifier verifier = new Verifier( testDir.getAbsolutePath() );
verifier.setAutoclean( false );
verifier.deleteDirectory( "target" );
verifier.deleteDirectory( "sub-a/target" );
verifier.deleteDirectory( "sub-b/target" );
verifier.deleteDirectory( "sub-c/target" );
verifier.deleteDirectory( "sub-d/target" );
clean( verifier );
verifier.getCliOptions().add( "-pl" );
verifier.getCliOptions().add( "sub-b" );
verifier.getCliOptions().add( "-amd" );
@ -137,11 +135,7 @@ public class MavenITmng2576MakeLikeReactorTest
Verifier verifier = new Verifier( testDir.getAbsolutePath() );
verifier.setAutoclean( false );
verifier.deleteDirectory( "target" );
verifier.deleteDirectory( "sub-a/target" );
verifier.deleteDirectory( "sub-b/target" );
verifier.deleteDirectory( "sub-c/target" );
verifier.deleteDirectory( "sub-d/target" );
clean( verifier );
verifier.getCliOptions().add( "-pl" );
verifier.getCliOptions().add( "sub-b" );
verifier.getCliOptions().add( "-am" );
@ -158,4 +152,28 @@ public class MavenITmng2576MakeLikeReactorTest
verifier.assertFileNotPresent( "sub-d/target/touch.txt" );
}
/**
* Verify that reactor is resumed from specified project.
*/
public void testitResumeFrom()
throws Exception
{
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-2576" );
Verifier verifier = new Verifier( testDir.getAbsolutePath() );
verifier.setAutoclean( false );
clean( verifier );
verifier.getCliOptions().add( "-rf" );
verifier.getCliOptions().add( "sub-b" );
verifier.setLogFileName( "log-resume.txt" );
verifier.executeGoal( "validate" );
verifier.verifyErrorFreeLog();
verifier.resetStreams();
verifier.assertFileNotPresent( "target/touch.txt" );
verifier.assertFileNotPresent( "sub-a/target/touch.txt" );
verifier.assertFilePresent( "sub-b/target/touch.txt" );
verifier.assertFilePresent( "sub-c/target/touch.txt" );
}
}