1 package org.apache.maven.surefire.its;
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.surefire.its.fixture.SurefireJUnit4IntegrationTestCase;
23 import org.apache.maven.surefire.its.fixture.SurefireLauncher;
24 import org.junit.Test;
25
26
27
28
29
30
31
32
33 public class ForkConsoleOutputIT
34 extends SurefireJUnit4IntegrationTestCase
35 {
36 @Test
37 public void printSummaryTrueWithRedirect()
38 {
39 unpack().setForkJvm()
40 .redirectToFile( true )
41 .printSummary( true )
42 .executeTest()
43 .getSurefireReportsFile( "forkConsoleOutput.Test1-output.txt" )
44 .assertFileExists();
45 }
46
47 @Test
48 public void printSummaryTrueWithoutRedirect()
49 {
50 unpack().setForkJvm()
51 .redirectToFile( false )
52 .printSummary( true )
53 .executeTest()
54 .getSurefireReportsFile( "forkConsoleOutput.Test1-output.txt" )
55 .assertFileNotExists();
56 }
57
58 @Test
59 public void printSummaryFalseWithRedirect()
60 {
61 unpack().setForkJvm()
62 .redirectToFile( true )
63 .printSummary( false )
64 .debugLogging()
65 .showErrorStackTraces()
66 .executeTest()
67 .getSurefireReportsFile( "forkConsoleOutput.Test1-output.txt" )
68 .assertFileExists();
69 }
70
71 @Test
72 public void printSummaryFalseWithoutRedirect()
73 {
74 unpack().setForkJvm()
75 .redirectToFile( false )
76 .printSummary( false )
77 .executeTest()
78 .getSurefireReportsFile( "forkConsoleOutput.Test1-output.txt" )
79 .assertFileNotExists();
80 }
81
82
83 private SurefireLauncher unpack()
84 {
85 return unpack( "/fork-consoleOutput" );
86 }
87 }