1 package org.apache.maven.surefire.common.junit48;
2
3 import org.junit.Test;
4 import org.junit.experimental.runners.Enclosed;
5 import org.junit.runner.RunWith;
6 import org.junit.runners.Parameterized;
7
8 import static org.junit.Assert.assertFalse;
9 import static org.junit.Assert.assertTrue;
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33 public class JUnit48TestCheckerTest
34 {
35 @Test
36 public void valid48Class()
37 throws Exception
38 {
39 JUnit48TestChecker tc = new JUnit48TestChecker( this.getClass().getClassLoader() );
40 assertTrue( tc.accept( BasicTest.class ) );
41 }
42
43 @Test
44 public void notValid48Class()
45 throws Exception
46 {
47 JUnit48TestChecker tc = new JUnit48TestChecker( this.getClass().getClassLoader() );
48 assertFalse( tc.accept( BasicTest2.class ) );
49 }
50
51
52 @RunWith( Enclosed.class )
53 public abstract static class BasicTest
54 {
55 public static class InnerTest
56 {
57 @Test
58 public void testSomething()
59 {
60 }
61 }
62 }
63
64 @RunWith( Parameterized.class )
65 public abstract static class BasicTest2
66 {
67 public static class InnerTest
68 {
69 @Test
70 public void testSomething()
71 {
72 }
73 }
74 }
75 }