KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > test > aspectutilmethodbug > Test


1 package test.aspectutilmethodbug;
2
3 import junit.framework.TestCase;
4
5 public class Test extends TestCase {
6     private static String JavaDoc s_logString;
7
8     public void test1() {
9         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 JavaDoc msg) {
19         s_logString += msg;
20     }
21
22     public static void main(String JavaDoc[] 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 }
31
Popular Tags