View | Details | Raw Unified | Return to bug 192575 | Differences between
and this patch

Collapse All | Expand All

(-)src/main/java/org/junit/runners/model/FrameworkMethod.java (-3 lines)
Lines 87-95 Link Here
87
            String state = isStatic ? "should" : "should not";
86
            String state = isStatic ? "should" : "should not";
88
            errors.add(new Exception("Method " + fMethod.getName() + "() " + state + " be static"));
87
            errors.add(new Exception("Method " + fMethod.getName() + "() " + state + " be static"));
89
        }
88
        }
90
        if (!Modifier.isPublic(fMethod.getDeclaringClass().getModifiers())) {
91
            errors.add(new Exception("Class " + fMethod.getDeclaringClass().getName() + " should be public"));
92
        }
93
        if (!Modifier.isPublic(fMethod.getModifiers())) {
89
        if (!Modifier.isPublic(fMethod.getModifiers())) {
94
            errors.add(new Exception("Method " + fMethod.getName() + "() should be public"));
90
            errors.add(new Exception("Method " + fMethod.getName() + "() should be public"));
95
        }
91
        }
(-)src/test/java/org/junit/tests/AllTests.java (-2 lines)
Lines 77-83 Link Here
77
import org.junit.tests.running.methods.TimeoutTest;
77
import org.junit.tests.running.methods.TimeoutTest;
78
import org.junit.tests.validation.BadlyFormedClassesTest;
78
import org.junit.tests.validation.BadlyFormedClassesTest;
79
import org.junit.tests.validation.FailedConstructionTest;
79
import org.junit.tests.validation.FailedConstructionTest;
80
import org.junit.tests.validation.InaccessibleBaseClassTest;
81
import org.junit.tests.validation.ValidationTest;
80
import org.junit.tests.validation.ValidationTest;
82
81
83
// These test files need to be cleaned. See
82
// These test files need to be cleaned. See
Lines 118-124 Link Here
118
        JUnit38ClassRunnerTest.class,
117
        JUnit38ClassRunnerTest.class,
119
        SystemExitTest.class,
118
        SystemExitTest.class,
120
        JUnitCoreReturnsCorrectExitCodeTest.class,
119
        JUnitCoreReturnsCorrectExitCodeTest.class,
121
        InaccessibleBaseClassTest.class,
122
        SuiteMethodTest.class,
120
        SuiteMethodTest.class,
123
        BadlyFormedClassesTest.class,
121
        BadlyFormedClassesTest.class,
124
        IgnoreClassTest.class,
122
        IgnoreClassTest.class,
(-)src/test/java/org/junit/tests/validation/InaccessibleBaseClassTest.java (-13 lines)
Lines 1-13 Link Here
1
package org.junit.tests.validation;
2
3
import org.junit.Test;
4
import org.junit.runners.BlockJUnit4ClassRunner;
5
import org.junit.runners.model.InitializationError;
6
import org.junit.tests.validation.anotherpackage.Sub;
7
8
public class InaccessibleBaseClassTest {
9
    @Test(expected = InitializationError.class)
10
    public void inaccessibleBaseClassIsCaughtAtValidation() throws InitializationError {
11
        new BlockJUnit4ClassRunner(Sub.class);
12
    }
13
}

Return to bug 192575