KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > junit > tests > runner > BaseTestRunnerTest


1
2 package junit.tests.runner;
3
4 import junit.framework.Test;
5 import junit.framework.TestCase;
6 import junit.runner.BaseTestRunner;
7
8 public class BaseTestRunnerTest extends TestCase {
9     
10     public class MockRunner extends BaseTestRunner {
11         protected void runFailed(String JavaDoc message) {
12         }
13
14         public void testEnded(String JavaDoc testName) {
15         }
16
17         public void testFailed(int status, Test test, Throwable JavaDoc t) {
18         }
19
20         public void testStarted(String JavaDoc testName) {
21         }
22     }
23     
24     public static class NonStatic {
25         public Test suite() {
26             return null;
27         }
28     }
29
30     
31     public void testInvokeNonStaticSuite() {
32         BaseTestRunner runner= new MockRunner();
33         runner.getTest("junit.tests.runner.BaseTestRunnerTest$NonStatic"); // Used to throw NullPointerException
34
}
35 }
36
Popular Tags