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.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
33 public class TestMultipleMethodsIT
34 extends SurefireJUnit4IntegrationTestCase
35 {
36
37 private static final String RUNNING_WITH_PROVIDER47 = "parallel='none', perCoreThreadCount=true, threadCount=0";
38
39 public OutputValidator multipleMethod( String projectName, String... goals )
40 throws Exception
41 {
42 SurefireLauncher launcher = unpack( projectName );
43 for ( String goal : goals )
44 {
45 launcher.addGoal( goal );
46 }
47 return launcher.showErrorStackTraces().debugLogging()
48 .executeTest()
49 .verifyErrorFreeLog().assertTestSuiteResults( 3, 0, 0, 0 );
50 }
51
52 @Test
53 public void testJunit44()
54 throws Exception
55 {
56 multipleMethod( "junit44-multiple-methods" );
57 }
58
59 @Test
60 public void testJunit48Provider4()
61 throws Exception
62 {
63 multipleMethod( "junit48-multiple-methods", "-P surefire-junit4" );
64 }
65
66 @Test
67 public void testJunit48Provider47()
68 throws Exception
69 {
70 multipleMethod( "junit48-multiple-methods", "-P surefire-junit47" )
71 .verifyTextInLog( RUNNING_WITH_PROVIDER47 );
72 }
73
74 }