01: /**************************************************************************************
02: * Copyright (c) Jonas BonŽr, Alexandre Vasseur. All rights reserved. *
03: * http://aspectwerkz.codehaus.org *
04: * ---------------------------------------------------------------------------------- *
05: * The software in this package is published under the terms of the LGPL license *
06: * a copy of which has been included with this distribution in the license.txt file. *
07: **************************************************************************************/package test.proceedinnewthread;
08:
09: import junit.framework.TestCase;
10:
11: /**
12: * @author <a href="mailto:jboner@codehaus.org">Jonas BonŽr </a>
13: */
14: public class ProceedTest extends TestCase {
15:
16: public static String LOG = "";
17:
18: public void test1() {
19: LOG = "";
20: adviseMe1();
21: assertEquals("advice1Pre adviseMe1 advice1Post ", LOG);
22: }
23:
24: public void test2() {
25: LOG = "";
26: adviseMe2();
27: assertEquals(
28: "advice1Pre advice2Pre adviseMe2 advice2Post advice1Post ",
29: LOG);
30: }
31:
32: public void test3() {
33: LOG = "";
34: adviseMe3();
35: assertEquals(
36: "advice1Pre advice2Pre advice3Pre adviseMe3 advice3Post advice2Post advice1Post ",
37: LOG);
38: }
39:
40: public void adviseMe1() {
41: LOG += "adviseMe1 ";
42: }
43:
44: public void adviseMe2() {
45: LOG += "adviseMe2 ";
46: }
47:
48: public void adviseMe3() {
49: LOG += "adviseMe3 ";
50: }
51:
52: // -- JUnit
53: public static void main(String[] args) {
54: junit.textui.TestRunner.run(suite());
55: }
56:
57: public static junit.framework.Test suite() {
58: return new junit.framework.TestSuite(ProceedTest.class);
59: }
60: }
|