Package: junit4 / 4.11-3

java8-compatibility.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
Description: Fixes the build with Java 8
Origin: upstream, https://github.com/junit-team/junit/commit/88f7a12
Bug: https://github.com/junit-team/junit/issues/749
--- a/src/main/java/org/junit/runners/model/FrameworkMethod.java
+++ b/src/main/java/org/junit/runners/model/FrameworkMethod.java
@@ -87,9 +87,6 @@
             String state = isStatic ? "should" : "should not";
             errors.add(new Exception("Method " + fMethod.getName() + "() " + state + " be static"));
         }
-        if (!Modifier.isPublic(fMethod.getDeclaringClass().getModifiers())) {
-            errors.add(new Exception("Class " + fMethod.getDeclaringClass().getName() + " should be public"));
-        }
         if (!Modifier.isPublic(fMethod.getModifiers())) {
             errors.add(new Exception("Method " + fMethod.getName() + "() should be public"));
         }
--- a/src/test/java/org/junit/tests/AllTests.java
+++ b/src/test/java/org/junit/tests/AllTests.java
@@ -77,7 +77,6 @@
 import org.junit.tests.running.methods.TimeoutTest;
 import org.junit.tests.validation.BadlyFormedClassesTest;
 import org.junit.tests.validation.FailedConstructionTest;
-import org.junit.tests.validation.InaccessibleBaseClassTest;
 import org.junit.tests.validation.ValidationTest;
 
 // These test files need to be cleaned. See
@@ -118,7 +117,6 @@
         JUnit38ClassRunnerTest.class,
         SystemExitTest.class,
         JUnitCoreReturnsCorrectExitCodeTest.class,
-        InaccessibleBaseClassTest.class,
         SuiteMethodTest.class,
         BadlyFormedClassesTest.class,
         IgnoreClassTest.class,
--- a/src/test/java/org/junit/tests/validation/InaccessibleBaseClassTest.java
+++ /dev/null
@@ -1,13 +0,0 @@
-package org.junit.tests.validation;
-
-import org.junit.Test;
-import org.junit.runners.BlockJUnit4ClassRunner;
-import org.junit.runners.model.InitializationError;
-import org.junit.tests.validation.anotherpackage.Sub;
-
-public class InaccessibleBaseClassTest {
-    @Test(expected = InitializationError.class)
-    public void inaccessibleBaseClassIsCaughtAtValidation() throws InitializationError {
-        new BlockJUnit4ClassRunner(Sub.class);
-    }
-}