1 package org.apache.maven.surefire.its.jiras;
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.OutputValidator;
23 import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase;
24 import org.apache.maven.surefire.its.fixture.SurefireLauncher;
25 import org.junit.Test;
26
27
28
29
30
31
32 public class Surefire1152RerunFailingTestsInSuiteIT
33 extends SurefireJUnit4IntegrationTestCase
34 {
35 private static final String RUNNING_WITH_PROVIDER47 =
36 "Using configured provider org.apache.maven.surefire.junitcore.JUnitCoreProvider";
37
38 public OutputValidator runMethodPattern( String projectName, String... goals )
39 {
40 SurefireLauncher launcher = unpack( projectName );
41 for ( String goal : goals )
42 {
43 launcher.addGoal( goal );
44 }
45 OutputValidator outputValidator = launcher.showErrorStackTraces().debugLogging().executeVerify();
46 outputValidator.assertTestSuiteResults( 3, 0, 0, 0, 3 );
47 outputValidator.assertIntegrationTestSuiteResults( 1, 0, 0, 0 );
48 return outputValidator;
49 }
50
51 @Test
52 public void testJUnit48Provider4()
53 {
54 runMethodPattern( "surefire-1152-rerunFailingTestsCount-suite", "-P surefire-junit4" );
55 }
56
57 @Test
58 public void testJUnit48Provider47()
59 {
60 runMethodPattern( "surefire-1152-rerunFailingTestsCount-suite", "-P surefire-junit47" )
61 .verifyTextInLog( RUNNING_WITH_PROVIDER47 );
62 }
63
64 }