diff options
author | aclement <aclement> | 2005-11-11 11:23:43 +0000 |
---|---|---|
committer | aclement <aclement> | 2005-11-11 11:23:43 +0000 |
commit | 1cd86ff91ecff7901d5984758821b89df1acd3bc (patch) | |
tree | 9f9086df760bd89aaac20dffa367fd005586d2a7 /tests/bugs150 | |
parent | ed1585ae59552692c892bca34bd61e47b5da7f3e (diff) | |
download | aspectj-1cd86ff91ecff7901d5984758821b89df1acd3bc.tar.gz aspectj-1cd86ff91ecff7901d5984758821b89df1acd3bc.zip |
tests for pr113447 from Helen Hawkins.
Diffstat (limited to 'tests/bugs150')
-rw-r--r-- | tests/bugs150/pr113447/PR113447.java (renamed from tests/bugs150/PR113447.java) | 6 | ||||
-rw-r--r-- | tests/bugs150/pr113447/PR113447a.java | 65 | ||||
-rw-r--r-- | tests/bugs150/pr113447/PR113447b.java | 27 | ||||
-rw-r--r-- | tests/bugs150/pr113447/PR113447c.java | 27 | ||||
-rw-r--r-- | tests/bugs150/pr113447/PR113447d.java | 25 | ||||
-rw-r--r-- | tests/bugs150/pr113447/PR113447e.java | 36 |
6 files changed, 184 insertions, 2 deletions
diff --git a/tests/bugs150/PR113447.java b/tests/bugs150/pr113447/PR113447.java index 8fd45ed06..074f8037f 100644 --- a/tests/bugs150/PR113447.java +++ b/tests/bugs150/pr113447/PR113447.java @@ -15,12 +15,13 @@ aspect Super { // second method doesn't exist pointcut pc1(PR113447 s) : - (this(s) && execution(void method1())) - || (this(s) && execution(void method2())); + (this(PR113447) && this(s) && execution(void method1()) && this(PR113447)) + || (this(s) && execution(void method2()) && this(PR113447)); before(PR113447 s) : pc1(s) { } +/* // second method does exist pointcut pc2(PR113447 s) : (this(s) && execution(void method1())) @@ -36,5 +37,6 @@ aspect Super { before(PR113447 s) : pc3(s) { } +*/ } diff --git a/tests/bugs150/pr113447/PR113447a.java b/tests/bugs150/pr113447/PR113447a.java new file mode 100644 index 000000000..d720c5244 --- /dev/null +++ b/tests/bugs150/pr113447/PR113447a.java @@ -0,0 +1,65 @@ +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; + +@Retention(RetentionPolicy.RUNTIME) +@interface Annotation{}; + +@Annotation +public class PR113447a { + + public static void main(String[] args) { + PR113447a me = new PR113447a(); + me.method1(); + me.method3(); + me.method4(2); + } + + public void method1(){} + + public void method3(){} + + public void method4(int i){} + public void method5(int i){} +} + +aspect Super { + + // second method doesn't exist + pointcut pc1(Annotation a) : + (@this(a) && execution(void method1())) + || (@this(a) && execution(void method2())); + + before(Annotation a) : pc1(a) {} + + // second method does exist + pointcut pc2(Annotation a) : + (@this(a) && execution(void method1())) + || (@this(a) && execution(void method3())); + + before(Annotation a) : pc2(a) {} + + // second method doesn't exist + pointcut pc3(Annotation a) : + (@target(a) && call(void method1())) + || (@target(a) && call(void method2())); + + before(Annotation a) : pc3(a) { + } + + // second method does exist + pointcut pc4(Annotation a) : + (@target(a) && call(void method1())) + || (@target(a) && call(void method3())); + + before(Annotation a) : pc4(a) { + } + + // @this equivalent of BaseTests.test024 which was affected by + // the fix for the non annotation version + pointcut p(Annotation a) : + @target(a) && (call(void method4(int)) + || call(void method5(int))); + + before(Annotation a) : p(a) {} + after(Annotation a): p(a) {} +} diff --git a/tests/bugs150/pr113447/PR113447b.java b/tests/bugs150/pr113447/PR113447b.java new file mode 100644 index 000000000..baa0abaa6 --- /dev/null +++ b/tests/bugs150/pr113447/PR113447b.java @@ -0,0 +1,27 @@ +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; + +@Retention(RetentionPolicy.RUNTIME) +@interface Annotation{}; + +@Annotation +public class PR113447b { + + public static void main(String[] args) { + PR113447b me = new PR113447b(); + me.method4(1); + } + + public void method4(int i){} + public void method5(int i){} +} + +aspect Super { + + pointcut p(Annotation a) : + @within(a) && (call(void method4(int)) + || call(void method5(int))); + + before(Annotation a) : p(a) {} + +} diff --git a/tests/bugs150/pr113447/PR113447c.java b/tests/bugs150/pr113447/PR113447c.java new file mode 100644 index 000000000..d903dbb29 --- /dev/null +++ b/tests/bugs150/pr113447/PR113447c.java @@ -0,0 +1,27 @@ +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; + +@Retention(RetentionPolicy.RUNTIME) +@interface Annotation{}; + +public class PR113447c { + + @Annotation + public static void main(String[] args) { + PR113447c me = new PR113447c(); + me.method4(1); + } + + public void method4(int i){} + public void method5(int i){} +} + +aspect Super { + + pointcut p(Annotation a) : + @withincode(a) && (call(void method4(int)) + || call(void method5(int))); + + before(Annotation a) : p(a) {} + +} diff --git a/tests/bugs150/pr113447/PR113447d.java b/tests/bugs150/pr113447/PR113447d.java new file mode 100644 index 000000000..bf7520d28 --- /dev/null +++ b/tests/bugs150/pr113447/PR113447d.java @@ -0,0 +1,25 @@ +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; + +@Retention(RetentionPolicy.RUNTIME) +@interface Annotation{}; + +public class PR113447d { + + public static void main(String[] args) { + PR113447d me = new PR113447d(); + me.method4(1); + } + + @Annotation public void method4(int i){} + @Annotation public void method5(int i){} +} + +aspect Super { + + pointcut p(Annotation a) : + @annotation(a) && (call(void method4(int)) + || call(void method5(int))); + + before(Annotation a) : p(a) {} +} diff --git a/tests/bugs150/pr113447/PR113447e.java b/tests/bugs150/pr113447/PR113447e.java new file mode 100644 index 000000000..424089d7c --- /dev/null +++ b/tests/bugs150/pr113447/PR113447e.java @@ -0,0 +1,36 @@ +public class PR113447e { + + public static void main(String[] args) { + PR113447e me = new PR113447e(); + me.method1(1); + me.method3(2); + } + + public void method1(int i){} + + public void method3(int i){} +} + +aspect Super { + + // second method doesn't exist + pointcut pc1(int i) : + (args(i) && call(void method1(int))) + || (args(i) && call(void method2(int))); + + before(int i) : pc1(i) {} + + // second method does exist + pointcut pc2(int i) : + (args(i) && call(void method1(int))) + || (args(i) && call(void method3(int))); + + before(int i) : pc2(i) {} + + // ensure this still works + pointcut pc3(int i) : + args(i) && (call(void method1(int)) || call(void method2(int))); + + before(int i) : pc3(i) {} + after(int i) : pc3(i) {} +} |