01: package test.aspectutilmethodbug;
02:
03: import junit.framework.TestCase;
04:
05: public class Test extends TestCase {
06: private static String s_logString;
07:
08: public void test1() {
09: s_logString = "";
10: invoke();
11: assertEquals("before invoke after ", s_logString);
12: }
13:
14: public void invoke() {
15: Test.log("invoke ");
16: }
17:
18: public static void log(String msg) {
19: s_logString += msg;
20: }
21:
22: public static void main(String[] args) {
23: new Test().test1();
24: junit.textui.TestRunner.run(suite());
25: }
26:
27: public static junit.framework.Test suite() {
28: return new junit.framework.TestSuite(Test.class);
29: }
30: }
|