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 *
15 * @author <a href="mailto:jboner@codehaus.org">Jonas Bonr </a>
16 */
17 public class ProceedTest extends TestCase {
18
19 public static String LOG = "";
20
21 public void test1() {
22 LOG = "";
23 adviseMe1();
24 assertEquals("advice1Pre adviseMe1 advice1Post ", LOG);
25 }
26
27 public void test2() {
28 LOG = "";
29 adviseMe2();
30 assertEquals("advice1Pre advice2Pre adviseMe2 advice2Post advice1Post ", LOG);
31 }
32
33 public void test3() {
34 LOG = "";
35 adviseMe3();
36 assertEquals("advice1Pre advice2Pre advice3Pre adviseMe3 advice3Post advice2Post advice1Post ", LOG);
37 }
38
39 public void adviseMe1() {
40 LOG += "adviseMe1 ";
41 }
42
43 public void adviseMe2() {
44 LOG += "adviseMe2 ";
45 }
46
47 public void adviseMe3() {
48 LOG += "adviseMe3 ";
49 }
50
51
52 public static void main(String[] args) {
53 junit.textui.TestRunner.run(suite());
54 }
55
56 public static junit.framework.Test suite() {
57 return new junit.framework.TestSuite(ProceedTest.class);
58 }
59 }