diff options
Diffstat (limited to 'tests/base/test135/pack')
-rw-r--r-- | tests/base/test135/pack/JoinPointFields.java | 35 | ||||
-rw-r--r-- | tests/base/test135/pack/PackFoo.java | 6 | ||||
-rw-r--r-- | tests/base/test135/pack/PackJoinPointFields.java | 6 |
3 files changed, 47 insertions, 0 deletions
diff --git a/tests/base/test135/pack/JoinPointFields.java b/tests/base/test135/pack/JoinPointFields.java new file mode 100644 index 000000000..c541ba2a4 --- /dev/null +++ b/tests/base/test135/pack/JoinPointFields.java @@ -0,0 +1,35 @@ +package test135.pack; + +import org.aspectj.lang.*; +import org.aspectj.lang.reflect.*; + +// a first try at a library class in the test suite +public abstract aspect JoinPointFields { + public String className; + public String methodName; + public String[] parameterNames; + public Class[] parameterTypes; + public Object[] parameters; + + protected int protectedField = 42; + + abstract protected pointcut onTypes(); + + before(): call(!static * *(..)) && onTypes() && !within(JoinPointFields+) { + System.out.println(thisJoinPoint); + + Signature sig = thisJoinPoint.getSignature(); + CodeSignature codeSig = (CodeSignature) sig; + //ReceptionJoinPoint rjp = (ReceptionJoinPoint) thisJoinPoint; + + className = sig.getDeclaringType().getName(); + System.out.println(className); + + methodName = sig.getName(); + parameterNames = codeSig.getParameterNames(); + parameterTypes = codeSig.getParameterTypes(); + //parameters = rjp.getParameters(); + parameters = thisJoinPoint.getArgs(); + System.out.println("DONE: " + thisJoinPoint); + } +} diff --git a/tests/base/test135/pack/PackFoo.java b/tests/base/test135/pack/PackFoo.java new file mode 100644 index 000000000..f00eee490 --- /dev/null +++ b/tests/base/test135/pack/PackFoo.java @@ -0,0 +1,6 @@ +package test135.pack; + +public class PackFoo { + public void bar(int packIntParam, String packStringParam) { + } +} diff --git a/tests/base/test135/pack/PackJoinPointFields.java b/tests/base/test135/pack/PackJoinPointFields.java new file mode 100644 index 000000000..bd6bf46e3 --- /dev/null +++ b/tests/base/test135/pack/PackJoinPointFields.java @@ -0,0 +1,6 @@ +package test135.pack; + +public aspect PackJoinPointFields + extends JoinPointFields issingleton() { /*of eachJVM() {*/ + protected pointcut onTypes(): target(test135.pack.PackFoo); +} |