junit/junit-jdk8.patch

42 lines
2.2 KiB
Diff

Index: junit-r4.11/src/main/java/org/junit/runners/model/FrameworkMethod.java
===================================================================
--- junit-r4.11.orig/src/main/java/org/junit/runners/model/FrameworkMethod.java
+++ junit-r4.11/src/main/java/org/junit/runners/model/FrameworkMethod.java
@@ -83,14 +83,11 @@ public class FrameworkMethod extends Fra
* <li>is not static (given {@code isStatic is true}).
*/
public void validatePublicVoid(boolean isStatic, List<Throwable> errors) {
- if (Modifier.isStatic(fMethod.getModifiers()) != isStatic) {
+ if (isStatic() != isStatic) {
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())) {
+ if (!isPublic()) {
errors.add(new Exception("Method " + fMethod.getName() + "() should be public"));
}
if (fMethod.getReturnType() != Void.TYPE) {
Index: junit-r4.11/src/test/java/org/junit/tests/AllTests.java
===================================================================
--- junit-r4.11.orig/src/test/java/org/junit/tests/AllTests.java
+++ junit-r4.11/src/test/java/org/junit/tests/AllTests.java
@@ -77,7 +77,6 @@ import org.junit.tests.running.methods.T
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 @@ import org.junit.tests.validation.Valida
JUnit38ClassRunnerTest.class,
SystemExitTest.class,
JUnitCoreReturnsCorrectExitCodeTest.class,
- InaccessibleBaseClassTest.class,
SuiteMethodTest.class,
BadlyFormedClassesTest.class,
IgnoreClassTest.class,