01: /*******************************************************************************************
02: * Copyright (c) Jonas Bonér, Alexandre Vasseur. All rights reserved. *
03: * http://backport175.codehaus.org *
04: * --------------------------------------------------------------------------------------- *
05: * The software in this package is published under the terms of Apache License Version 2.0 *
06: * a copy of which has been included with this distribution in the license.txt file. *
07: *******************************************************************************************/package test.customproceed.aw438;
08:
09: import junit.framework.TestCase;
10: import org.codehaus.aspectwerkz.joinpoint.JoinPoint;
11:
12: /**
13: * @author <a href="mailto:alex AT gnilux DOT com">Alexandre Vasseur</a>
14: */
15: public class ArrayInCustomProceedTest extends TestCase {
16: private static String LOG = "";
17:
18: public static void log(String msg) {
19: LOG += msg;
20: }
21:
22: public void target(Integer i, String[] ss) {
23: log("target");
24: }
25:
26: public void testTarget() {
27: LOG = "";
28: target(new Integer(1), new String[] { "a", "b" });
29: assertEquals("AOP target", LOG);
30: }
31:
32: public static void main(String[] args) {
33: junit.textui.TestRunner.run(suite());
34: }
35:
36: public static junit.framework.Test suite() {
37: return new junit.framework.TestSuite(
38: ArrayInCustomProceedTest.class);
39: }
40:
41: public static class Aspect {
42:
43: public static interface MyJoinPoint extends JoinPoint {
44: Object proceed(Integer i, String[] objs);
45: }
46:
47: public Object addRequestTag(MyJoinPoint jp, Integer i,
48: String[] objs) throws Throwable {
49: log("AOP ");
50: return jp.proceed(i, objs);
51: }
52:
53: }
54:
55: }
|