1 package org.apache.maven.it;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 import org.apache.maven.it.util.ResourceExtractor;
23
24 import java.io.File;
25 import java.util.Arrays;
26 import java.util.List;
27
28
29
30
31
32
33
34
35 public class MavenITmng6720FailFastTest
36 extends AbstractMavenIntegrationTestCase
37 {
38
39 public MavenITmng6720FailFastTest()
40 {
41 super( "[3.6.2,)" );
42 }
43
44 public void testItShouldWaitForConcurrentModulesToFinish()
45 throws Exception
46 {
47 File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-6720-fail-fast" );
48
49 Verifier verifier = newVerifier( testDir.getAbsolutePath(), false );
50 verifier.setMavenDebug( false );
51 verifier.setAutoclean( false );
52 verifier.addCliOption( "-T" );
53 verifier.addCliOption( "2" );
54 verifier.addCliOption( "-Dmaven.test.redirectTestOutputToFile=true" );
55
56 try
57 {
58 verifier.executeGoals( Arrays.asList( "clean", "test" ) );
59 } catch (VerificationException e)
60 {
61
62 }
63 verifier.resetStreams();
64
65 List<String> module1Lines = verifier.loadFile(
66 new File( testDir, "module-1/target/surefire-reports/Module1Test-output.txt" ), false );
67 assertTrue( module1Lines.contains( "Module1" ) );
68 List<String> module2Lines = verifier.loadFile(
69 new File( testDir, "module-2/target/surefire-reports/Module2Test-output.txt" ), false );
70 assertTrue(module2Lines.contains( "Module2" ) );
71 List<String> module3Lines = verifier.loadFile(
72 new File( testDir, "module-3/target/surefire-reports/Module3Test-output.txt" ), false );
73 assertTrue( module3Lines.isEmpty() );
74
75
76 }
77 }