From 51ae071927ae140c68e125ca283b3f625bd9fc63 Mon Sep 17 00:00:00 2001 From: Benjamin Bentmann Date: Wed, 8 Jul 2009 12:54:31 +0000 Subject: [PATCH] o Strengthened IT to check inter-module dependency, too git-svn-id: https://svn.apache.org/repos/asf/maven/core-integration-testing/trunk@792124 13f79535-47bb-0310-9956-ffa450edef68 --- ...enITmng0095ReactorFailureBehaviorTest.java | 25 ++++++++++++------- .../src/test/resources/mng-0095/pom.xml | 19 ++++++++------ .../{subproject => subproject1}/pom.xml | 11 +++++--- .../resources/mng-0095/subproject2/pom.xml | 10 ++++++-- .../resources/mng-0095/subproject3/pom.xml | 23 +++++++++++++++++ 5 files changed, 67 insertions(+), 21 deletions(-) rename its/core-it-suite/src/test/resources/mng-0095/{subproject => subproject1}/pom.xml (69%) create mode 100644 its/core-it-suite/src/test/resources/mng-0095/subproject3/pom.xml diff --git a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0095ReactorFailureBehaviorTest.java b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0095ReactorFailureBehaviorTest.java index f0833f39e2..fef5d8a685 100644 --- a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0095ReactorFailureBehaviorTest.java +++ b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0095ReactorFailureBehaviorTest.java @@ -40,7 +40,7 @@ public class MavenITmng0095ReactorFailureBehaviorTest /** * Test fail-fast reactor behavior. Forces an exception to be thrown in - * the first module and checks that the second module is not built and the overall build fails, too. + * the first module and checks that the second & third module is not built and the overall build fails, too. */ public void testitFailFast() throws Exception @@ -50,8 +50,9 @@ public class MavenITmng0095ReactorFailureBehaviorTest Verifier verifier = new Verifier( testDir.getAbsolutePath() ); verifier.setAutoclean( false ); verifier.deleteDirectory( "target" ); - verifier.deleteDirectory( "subproject/target" ); + verifier.deleteDirectory( "subproject1/target" ); verifier.deleteDirectory( "subproject2/target" ); + verifier.deleteDirectory( "subproject3/target" ); verifier.getCliOptions().add( "--fail-fast" ); verifier.setLogFileName( "log-ff.txt" ); try @@ -66,13 +67,14 @@ public class MavenITmng0095ReactorFailureBehaviorTest verifier.resetStreams(); verifier.assertFilePresent( "target/touch.txt" ); - verifier.assertFileNotPresent( "subproject/target/touch.txt" ); + verifier.assertFileNotPresent( "subproject1/target/touch.txt" ); verifier.assertFileNotPresent( "subproject2/target/touch.txt" ); + verifier.assertFileNotPresent( "subproject3/target/touch.txt" ); } /** * Test fail-never reactor behavior. Forces an exception to be thrown in - * the first module, but checks that the second module is built and the overall build succeeds. + * the first module, but checks that the second & third module is built and the overall build succeeds. */ public void testitFailNever() throws Exception @@ -82,8 +84,9 @@ public class MavenITmng0095ReactorFailureBehaviorTest Verifier verifier = new Verifier( testDir.getAbsolutePath() ); verifier.setAutoclean( false ); verifier.deleteDirectory( "target" ); - verifier.deleteDirectory( "subproject/target" ); + verifier.deleteDirectory( "subproject1/target" ); verifier.deleteDirectory( "subproject2/target" ); + verifier.deleteDirectory( "subproject3/target" ); verifier.getCliOptions().add( "--fail-never" ); verifier.setLogFileName( "log-fn.txt" ); verifier.executeGoal( "org.apache.maven.its.plugins:maven-it-plugin-touch:touch" ); @@ -91,13 +94,15 @@ public class MavenITmng0095ReactorFailureBehaviorTest verifier.resetStreams(); verifier.assertFilePresent( "target/touch.txt" ); - verifier.assertFileNotPresent( "subproject/target/touch.txt" ); + verifier.assertFileNotPresent( "subproject1/target/touch.txt" ); verifier.assertFilePresent( "subproject2/target/touch.txt" ); + verifier.assertFilePresent( "subproject3/target/touch.txt" ); } /** * Test fail-at-end reactor behavior. Forces an exception to be thrown in - * the first module and checks that the second module is still built but the overall build finally fails. + * the first module and checks that the second module is still built but the overall build finally fails + * and the third module (which depends on the failed module) is skipped. */ public void testitFailAtEnd() throws Exception @@ -107,8 +112,9 @@ public class MavenITmng0095ReactorFailureBehaviorTest Verifier verifier = new Verifier( testDir.getAbsolutePath() ); verifier.setAutoclean( false ); verifier.deleteDirectory( "target" ); - verifier.deleteDirectory( "subproject/target" ); + verifier.deleteDirectory( "subproject1/target" ); verifier.deleteDirectory( "subproject2/target" ); + verifier.deleteDirectory( "subproject3/target" ); verifier.getCliOptions().add( "--fail-at-end" ); verifier.setLogFileName( "log-fae.txt" ); try @@ -123,8 +129,9 @@ public class MavenITmng0095ReactorFailureBehaviorTest verifier.resetStreams(); verifier.assertFilePresent( "target/touch.txt" ); - verifier.assertFileNotPresent( "subproject/target/touch.txt" ); + verifier.assertFileNotPresent( "subproject1/target/touch.txt" ); verifier.assertFilePresent( "subproject2/target/touch.txt" ); + verifier.assertFileNotPresent( "subproject3/target/touch.txt" ); } } diff --git a/its/core-it-suite/src/test/resources/mng-0095/pom.xml b/its/core-it-suite/src/test/resources/mng-0095/pom.xml index 6835586fb8..6a9d58b0c7 100644 --- a/its/core-it-suite/src/test/resources/mng-0095/pom.xml +++ b/its/core-it-suite/src/test/resources/mng-0095/pom.xml @@ -1,12 +1,16 @@ 4.0.0 - Maven Integration Test :: it0046 - org.apache.maven.its.it0046 - maven-it-it0046 - Test fail-never reactor behavior. Forces an exception to be thrown in - the first module, but checks that the second modules is built. - pom + + org.apache.maven.its.mng0095 + parent 1.0 + pom + + Maven Integration Test :: MNG-95 + + Test reactor failure modes fail-fast, fail-at-end and fail-never by forcing an exception in the first module and + checking the build output of the other modules. + @@ -21,7 +25,8 @@ - subproject + subproject1 subproject2 + subproject3 diff --git a/its/core-it-suite/src/test/resources/mng-0095/subproject/pom.xml b/its/core-it-suite/src/test/resources/mng-0095/subproject1/pom.xml similarity index 69% rename from its/core-it-suite/src/test/resources/mng-0095/subproject/pom.xml rename to its/core-it-suite/src/test/resources/mng-0095/subproject1/pom.xml index 9e2e64c33e..8329229dd6 100644 --- a/its/core-it-suite/src/test/resources/mng-0095/subproject/pom.xml +++ b/its/core-it-suite/src/test/resources/mng-0095/subproject1/pom.xml @@ -1,12 +1,17 @@ 4.0.0 + - org.apache.maven.its.it0046 - maven-it-it0046 + org.apache.maven.its.mng0095 + parent 1.0 - subproject + + subproject1 jar + + Maven Integration Test :: MNG-95 : Project 1 + diff --git a/its/core-it-suite/src/test/resources/mng-0095/subproject2/pom.xml b/its/core-it-suite/src/test/resources/mng-0095/subproject2/pom.xml index ee041510c1..9832268392 100644 --- a/its/core-it-suite/src/test/resources/mng-0095/subproject2/pom.xml +++ b/its/core-it-suite/src/test/resources/mng-0095/subproject2/pom.xml @@ -1,10 +1,16 @@ 4.0.0 + - org.apache.maven.its.it0046 - maven-it-it0046 + org.apache.maven.its.mng0095 + parent 1.0 + subproject2 jar + + Maven Integration Test :: MNG-95 : Project 2 + + diff --git a/its/core-it-suite/src/test/resources/mng-0095/subproject3/pom.xml b/its/core-it-suite/src/test/resources/mng-0095/subproject3/pom.xml new file mode 100644 index 0000000000..2d568092ae --- /dev/null +++ b/its/core-it-suite/src/test/resources/mng-0095/subproject3/pom.xml @@ -0,0 +1,23 @@ + + 4.0.0 + + + org.apache.maven.its.mng0095 + parent + 1.0 + + + subproject3 + jar + + Maven Integration Test :: MNG-95 : Project 3 + + + + + org.apache.maven.its.mng0095 + subproject1 + 1.0 + + +