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 java.util.Collection;
23
24 import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase;
25 import org.apache.maven.surefire.its.fixture.SurefireLauncher;
26 import org.junit.Test;
27 import org.junit.runner.RunWith;
28 import org.junit.runners.Parameterized;
29 import org.junit.runners.Parameterized.Parameter;
30
31 import static java.util.Arrays.asList;
32 import static org.apache.maven.surefire.its.JUnitVersion.JUNIT_4_10;
33 import static org.apache.maven.surefire.its.JUnitVersion.JUNIT_4_11;
34 import static org.apache.maven.surefire.its.JUnitVersion.JUNIT_4_12;
35 import static org.apache.maven.surefire.its.JUnitVersion.JUNIT_4_8;
36 import static org.apache.maven.surefire.its.JUnitVersion.JUNIT_4_8_1;
37 import static org.apache.maven.surefire.its.JUnitVersion.JUNIT_4_8_2;
38 import static org.apache.maven.surefire.its.JUnitVersion.JUNIT_4_9;
39 import static org.junit.runners.Parameterized.*;
40
41 import static org.apache.maven.surefire.its.JUnitVersion.JUNIT_4_0;
42 import static org.apache.maven.surefire.its.JUnitVersion.JUNIT_4_1;
43 import static org.apache.maven.surefire.its.JUnitVersion.JUNIT_4_2;
44 import static org.apache.maven.surefire.its.JUnitVersion.JUNIT_4_3;
45 import static org.apache.maven.surefire.its.JUnitVersion.JUNIT_4_3_1;
46 import static org.apache.maven.surefire.its.JUnitVersion.JUNIT_4_4;
47 import static org.apache.maven.surefire.its.JUnitVersion.JUNIT_4_5;
48 import static org.apache.maven.surefire.its.JUnitVersion.JUNIT_4_6;
49 import static org.apache.maven.surefire.its.JUnitVersion.JUNIT_4_7;
50
51
52
53
54
55
56 @RunWith( Parameterized.class )
57 public class JUnit4VersionsIT
58 extends SurefireJUnit4IntegrationTestCase
59 {
60
61 @Parameters( name = "{index}: JUnit {0}" )
62 public static Collection<Object[]> junitVersions()
63 {
64 return asList( new Object[][] {
65 { JUNIT_4_0 },
66 { JUNIT_4_1 },
67 { JUNIT_4_2 },
68 { JUNIT_4_3 },
69 { JUNIT_4_3_1 },
70 { JUNIT_4_4 },
71 { JUNIT_4_5 },
72 { JUNIT_4_6 },
73 { JUNIT_4_7 },
74 { JUNIT_4_8 },
75 { JUNIT_4_8_1 },
76 { JUNIT_4_8_2 },
77 { JUNIT_4_9 },
78 { JUNIT_4_10 },
79 { JUNIT_4_11 },
80 { JUNIT_4_12 }
81 } );
82 }
83
84 @Parameter
85 public JUnitVersion version;
86
87 @Test
88 public void testJunit()
89 {
90 version.configure( unpack() )
91 .executeTest()
92 .verifyErrorFree( 1 );
93 }
94
95 private SurefireLauncher unpack()
96 {
97 return unpack( "/junit4", version.toString() );
98 }
99 }