diff options
author | acolyer <acolyer> | 2005-11-19 17:08:48 +0000 |
---|---|---|
committer | acolyer <acolyer> | 2005-11-19 17:08:48 +0000 |
commit | 522911ec81aeb3ec5b600939d3a2ee6e6297fd0c (patch) | |
tree | 311498b219cf1905e36eb022efedbcfdff785651 /tests/java5/reflection | |
parent | 99504bc120db0049fb441bb69b0f37a4a4f29cd9 (diff) | |
download | aspectj-522911ec81aeb3ec5b600939d3a2ee6e6297fd0c.tar.gz aspectj-522911ec81aeb3ec5b600939d3a2ee6e6297fd0c.zip |
tests and fix for pr116229 and pr116755. Also adds support and tests for parseTypePattern in PointcutParser.
Diffstat (limited to 'tests/java5/reflection')
-rw-r--r-- | tests/java5/reflection/PointcutLibrary.aj | 14 | ||||
-rw-r--r-- | tests/java5/reflection/ReflectOnAjcCompiledPointcuts.java | 22 |
2 files changed, 36 insertions, 0 deletions
diff --git a/tests/java5/reflection/PointcutLibrary.aj b/tests/java5/reflection/PointcutLibrary.aj new file mode 100644 index 000000000..f3e59e21c --- /dev/null +++ b/tests/java5/reflection/PointcutLibrary.aj @@ -0,0 +1,14 @@ +// random collection of pointcuts to check that +// reflective world and PointcutParser can interpret +// them correctly. + +public aspect PointcutLibrary { + + public pointcut propertyAccess() : get(* *); + public pointcut propertyUpdate() : set(* *); + public pointcut methodExecution() : execution(* *(..)); + public pointcut propertyGet() : execution(!void get*(..)); + public pointcut propertySet(Object newValue) + : execution(void set*(..)) && args(newValue); + +}
\ No newline at end of file diff --git a/tests/java5/reflection/ReflectOnAjcCompiledPointcuts.java b/tests/java5/reflection/ReflectOnAjcCompiledPointcuts.java new file mode 100644 index 000000000..9dc9927be --- /dev/null +++ b/tests/java5/reflection/ReflectOnAjcCompiledPointcuts.java @@ -0,0 +1,22 @@ +import org.aspectj.weaver.tools.*; + +public class ReflectOnAjcCompiledPointcuts { + + public static void main(String[] args) { + PointcutParser p = new PointcutParser(); + PointcutExpression pe = null; + pe = p.parsePointcutExpression("PointcutLibrary.propertyAccess()"); + pe = p.parsePointcutExpression("PointcutLibrary.propertyUpdate()"); + pe = p.parsePointcutExpression("PointcutLibrary.methodExecution()"); + pe = p.parsePointcutExpression("PointcutLibrary.propertyGet()"); + pe = p.parsePointcutExpression("PointcutLibrary.propertySet(Object)"); + + PointcutParameter pp = p.createPointcutParameter("foo",String.class); + p.parsePointcutExpression("execution(* *(..)) && PointcutLibrary.propertySet(foo)", + Object.class, + new PointcutParameter[] {pp}); + + } + + +}
\ No newline at end of file |