1515
1616public class ExceptionFactoryTest {
1717
18- private static ClassLoader classLoaderWithoutJUnitOrOpenTest =
18+ private static final ClassLoader classLoaderWithoutJUnitOrOpenTest =
1919 excludingClassLoader ()
2020 .withCodeSourceUrlOf (ExceptionFactory .class )
2121 .without ("org.junit" , "junit" , "org.opentest4j" )
2222 .build ();
23- private static ClassLoader classLoaderWithoutOpenTest =
24- excludingClassLoader ()
25- .withCodeSourceUrlOf (ExceptionFactory .class , org .junit .ComparisonFailure .class )
26- .without ("org.opentest4j" )
27- .build ();
28- private static ClassLoader currentClassLoader = ExceptionFactoryTest .class .getClassLoader ();
23+ private static final ClassLoader currentClassLoader =
24+ ExceptionFactoryTest .class .getClassLoader ();
2925
3026 /** loaded by the current classloader */
3127 private static Class <?> opentestComparisonFailure ;
3228
3329 private static Class <?> opentestArgumentsAreDifferent ;
3430
35- /** loaded by the classloader {@value #classLoaderWithoutOpenTest}, which excludes OpenTest4J classes */
36- private static Class <?> junit3ComparisonFailure ;
37-
38- private static Class <?> junit3ArgumentsAreDifferent ;
39-
4031 /** loaded by the custom classloader {@value #classLoaderWithoutJUnitOrOpenTest}, which excludes JUnit and OpenTest4J classes */
4132 private static Class <?> nonJunitArgumentsAreDifferent ;
4233
4334 @ BeforeClass
4435 public static void init () throws ClassNotFoundException {
4536 nonJunitArgumentsAreDifferent =
4637 classLoaderWithoutJUnitOrOpenTest .loadClass (ArgumentsAreDifferent .class .getName ());
47- junit3ComparisonFailure =
48- classLoaderWithoutOpenTest .loadClass (
49- junit .framework .ComparisonFailure .class .getName ());
50- junit3ArgumentsAreDifferent =
51- classLoaderWithoutOpenTest .loadClass (
52- org .mockito .exceptions .verification .junit .ArgumentsAreDifferent .class
53- .getName ());
5438 opentestComparisonFailure = org .opentest4j .AssertionFailedError .class ;
5539 opentestArgumentsAreDifferent =
5640 org .mockito .exceptions .verification .opentest4j .ArgumentsAreDifferent .class ;
@@ -63,15 +47,6 @@ public void createArgumentsAreDifferentException_withoutJUnitOrOpenTest() throws
6347 assertThat (e ).isExactlyInstanceOf (nonJunitArgumentsAreDifferent );
6448 }
6549
66- @ Test
67- public void createArgumentsAreDifferentException_withJUnit3_butNotOpenTest () throws Exception {
68- AssertionError e = invokeFactoryThroughLoader (classLoaderWithoutOpenTest );
69-
70- assertThat (e )
71- .isExactlyInstanceOf (junit3ArgumentsAreDifferent )
72- .isInstanceOf (junit3ComparisonFailure );
73- }
74-
7550 @ Test
7651 public void createArgumentsAreDifferentException_withOpenTest () throws Exception {
7752 AssertionError e = invokeFactoryThroughLoader (currentClassLoader );
@@ -92,17 +67,6 @@ public void createArgumentsAreDifferentException_withoutJUnitOrOpenTest_2x() thr
9267 assertThat (e ).isExactlyInstanceOf (nonJunitArgumentsAreDifferent );
9368 }
9469
95- @ Test
96- public void createArgumentsAreDifferentException_withJUnit3_2x () throws Exception {
97- AssertionError e ;
98-
99- e = invokeFactoryThroughLoader (classLoaderWithoutOpenTest );
100- assertThat (e ).isExactlyInstanceOf (junit3ArgumentsAreDifferent );
101-
102- e = invokeFactoryThroughLoader (classLoaderWithoutOpenTest );
103- assertThat (e ).isExactlyInstanceOf (junit3ArgumentsAreDifferent );
104- }
105-
10670 @ Test
10771 public void createArgumentsAreDifferentException_withOpenTest_2x () throws Exception {
10872 AssertionError e ;
0 commit comments