mirror of https://github.com/apache/maven.git
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
This commit is contained in:
parent
6b970f4344
commit
51ae071927
|
@ -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" );
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,12 +1,16 @@
|
|||
<project>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<name>Maven Integration Test :: it0046</name>
|
||||
<groupId>org.apache.maven.its.it0046</groupId>
|
||||
<artifactId>maven-it-it0046</artifactId>
|
||||
<description>Test fail-never reactor behavior. Forces an exception to be thrown in
|
||||
the first module, but checks that the second modules is built.</description>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
<groupId>org.apache.maven.its.mng0095</groupId>
|
||||
<artifactId>parent</artifactId>
|
||||
<version>1.0</version>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
<name>Maven Integration Test :: MNG-95</name>
|
||||
<description>
|
||||
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.
|
||||
</description>
|
||||
|
||||
<build>
|
||||
<pluginManagement>
|
||||
|
@ -21,7 +25,8 @@
|
|||
</build>
|
||||
|
||||
<modules>
|
||||
<module>subproject</module>
|
||||
<module>subproject1</module>
|
||||
<module>subproject2</module>
|
||||
<module>subproject3</module>
|
||||
</modules>
|
||||
</project>
|
||||
|
|
|
@ -1,12 +1,17 @@
|
|||
<project>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<parent>
|
||||
<groupId>org.apache.maven.its.it0046</groupId>
|
||||
<artifactId>maven-it-it0046</artifactId>
|
||||
<groupId>org.apache.maven.its.mng0095</groupId>
|
||||
<artifactId>parent</artifactId>
|
||||
<version>1.0</version>
|
||||
</parent>
|
||||
<artifactId>subproject</artifactId>
|
||||
|
||||
<artifactId>subproject1</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>Maven Integration Test :: MNG-95 : Project 1</name>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
|
@ -1,10 +1,16 @@
|
|||
<project>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<parent>
|
||||
<groupId>org.apache.maven.its.it0046</groupId>
|
||||
<artifactId>maven-it-it0046</artifactId>
|
||||
<groupId>org.apache.maven.its.mng0095</groupId>
|
||||
<artifactId>parent</artifactId>
|
||||
<version>1.0</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>subproject2</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>Maven Integration Test :: MNG-95 : Project 2</name>
|
||||
|
||||
<!-- NOTE: This project does not depend on the failing project -->
|
||||
</project>
|
||||
|
|
|
@ -0,0 +1,23 @@
|
|||
<project>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<parent>
|
||||
<groupId>org.apache.maven.its.mng0095</groupId>
|
||||
<artifactId>parent</artifactId>
|
||||
<version>1.0</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>subproject3</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>Maven Integration Test :: MNG-95 : Project 3</name>
|
||||
|
||||
<!-- NOTE: This project depends on the failing project -->
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven.its.mng0095</groupId>
|
||||
<artifactId>subproject1</artifactId>
|
||||
<version>1.0</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
Loading…
Reference in New Issue