1 8 package test.proceedinnewthread; 9 10 import junit.framework.TestCase; 11 12 13 16 public class ProceedTest extends TestCase { 17 18 public static String LOG = ""; 19 20 public void test1() { 21 LOG = ""; 22 adviseMe1(); 23 assertEquals("advice1Pre adviseMe1 advice1Post ", LOG); 24 } 25 26 public void test2() { 27 LOG = ""; 28 adviseMe2(); 29 assertEquals("advice1Pre advice2Pre adviseMe2 advice2Post advice1Post ", LOG); 30 } 31 32 public void test3() { 33 LOG = ""; 34 adviseMe3(); 35 assertEquals("advice1Pre advice2Pre advice3Pre adviseMe3 advice3Post advice2Post advice1Post ", LOG); 36 } 37 38 public void adviseMe1() { 39 LOG += "adviseMe1 "; 40 } 41 42 public void adviseMe2() { 43 LOG += "adviseMe2 "; 44 } 45 46 public void adviseMe3() { 47 LOG += "adviseMe3 "; 48 } 49 50 public static void main(String [] args) { 52 junit.textui.TestRunner.run(suite()); 53 } 54 55 public static junit.framework.Test suite() { 56 return new junit.framework.TestSuite(ProceedTest.class); 57 } 58 } 59 | Popular Tags |