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 | |
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')
-rw-r--r-- | tests/java5/ataspectj/annotationGen/RuntimePointcuts.java | 1 | ||||
-rw-r--r-- | tests/java5/reflection/PointcutLibrary.aj | 14 | ||||
-rw-r--r-- | tests/java5/reflection/ReflectOnAjcCompiledPointcuts.java | 22 |
3 files changed, 37 insertions, 0 deletions
diff --git a/tests/java5/ataspectj/annotationGen/RuntimePointcuts.java b/tests/java5/ataspectj/annotationGen/RuntimePointcuts.java index 8f9e530d5..171239cd5 100644 --- a/tests/java5/ataspectj/annotationGen/RuntimePointcuts.java +++ b/tests/java5/ataspectj/annotationGen/RuntimePointcuts.java @@ -6,6 +6,7 @@ public class RuntimePointcuts { public static void main(String[] args) throws Exception { PointcutParser parser = new PointcutParser(); + parser.setClassLoader(RuntimePointcuts.class.getClassLoader()); PointcutExpression pc1 = parser.parsePointcutExpression("PCLib.anyMethodExecution()"); PointcutParameter param = parser.createPointcutParameter("s",String.class); PointcutExpression pc2 = parser.parsePointcutExpression("PCLib.joinPointWithStringArg(s)",RuntimePointcuts.class,new PointcutParameter[] {param}); 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 |