1 /***************************************************************************************
2 * Copyright (c) Jonas BonŽr, Alexandre Vasseur. All rights reserved. *
3 * http://aspectwerkz.codehaus.org *
4 * ---------------------------------------------------------------------------------- *
5 * The software in this package is published under the terms of the LGPL license *
6 * a copy of which has been included with this distribution in the license.txt file. *
7 **************************************************************************************/
8 package test.proceedinnewthread;
9
10 import junit.framework.TestCase;
11
12
13 /***
14 * @author <a href="mailto:jboner@codehaus.org">Jonas BonŽr </a>
15 */
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
51 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 }