01: package junit.tests.runner;
02:
03: import junit.framework.Test;
04: import junit.framework.TestCase;
05: import junit.runner.BaseTestRunner;
06:
07: public class BaseTestRunnerTest extends TestCase {
08:
09: public static class MockRunner extends BaseTestRunner {
10: @Override
11: protected void runFailed(String message) {
12: }
13:
14: @Override
15: public void testEnded(String testName) {
16: }
17:
18: @Override
19: public void testFailed(int status, Test test, Throwable t) {
20: }
21:
22: @Override
23: public void testStarted(String testName) {
24: }
25: }
26:
27: public static class NonStatic {
28: public Test suite() {
29: return null;
30: }
31: }
32:
33: public void testInvokeNonStaticSuite() {
34: BaseTestRunner runner = new MockRunner();
35: runner
36: .getTest("junit.tests.runner.BaseTestRunnerTest$NonStatic"); // Used to throw NullPointerException
37: }
38: }
|