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.junit.Test;
24
25 import static org.hamcrest.Matchers.containsString;
26 import static org.hamcrest.Matchers.is;
27
28
29
30
31
32
33 public class CheckTestNgReportTestIT
34 extends SurefireJUnit4IntegrationTestCase
35 {
36 @Test
37 public void testNgReport()
38 throws Exception
39 {
40 unpack( "/testng-simple" )
41 .sysProp( "testNgVersion", "5.7" )
42 .sysProp( "testNgClassifier", "jdk15" )
43 .addSurefireReportGoal()
44 .executeCurrentGoals()
45 .verifyErrorFree( 3 )
46 .getSiteFile( "surefire-report.html" )
47 .assertFileExists();
48 }
49
50 @Test
51 public void shouldNotBeVerbose()
52 throws Exception
53 {
54 unpack( "/testng-simple" )
55 .sysProp( "testNgVersion", "5.10" )
56 .sysProp( "testNgClassifier", "jdk15" )
57 .executeTest()
58 .verifyErrorFreeLog()
59 .assertThatLogLine( containsString( "[Parser] Running:" ), is( 0 ) );
60 }
61
62 @Test
63 public void shouldBeVerbose()
64 throws Exception
65 {
66 unpack( "/testng-simple" )
67 .sysProp( "testNgVersion", "5.10" )
68 .sysProp( "testNgClassifier", "jdk15" )
69 .sysProp( "surefire.testng.verbose", "10" )
70 .executeTest()
71 .verifyErrorFreeLog()
72 .assertThatLogLine( containsString( "[Parser] Running:" ), is( 1 ) );
73 }
74 }