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.spring;
08:
09: import junit.framework.TestCase;
10:
11: /**
12: * @author <a href="mailto:jboner@codehaus.org">Jonas BonŽr </a>
13: */
14: public class Test extends TestCase {
15:
16: private static String s_logString = "";
17:
18: public Test(String name) {
19: super (name);
20: }
21:
22: public void testBefore() throws Exception {
23: s_logString = "";
24: adviseBefore();
25: assertEquals("before adviseBefore ", s_logString);
26: }
27:
28: public void testAfterReturning() throws Exception {
29: s_logString = "";
30: adviseAfterReturning();
31: assertEquals("adviseAfterReturning afterReturning ",
32: s_logString);
33: }
34:
35: public static void main(String[] args) {
36: junit.textui.TestRunner.run(suite());
37: }
38:
39: public static junit.framework.Test suite() {
40: return new junit.framework.TestSuite(Test.class);
41: }
42:
43: public static void log(final String wasHere) {
44: s_logString += wasHere;
45: }
46:
47: public long adviseAfterReturning() {
48: log("adviseAfterReturning ");
49: return 0x1L;
50: }
51:
52: public long adviseBefore() {
53: log("adviseBefore ");
54: return 0x1L;
55: }
56: }
|