diff options
author | aclement <aclement> | 2007-10-18 11:02:00 +0000 |
---|---|---|
committer | aclement <aclement> | 2007-10-18 11:02:00 +0000 |
commit | 499b8bcb0e89b39a63008fc68b44df9ed39d0750 (patch) | |
tree | 748080f3a5b8f4915cc5b1014bbac41ce4d8236f /tests/bugs154/pr197719 | |
parent | 7d21be99acce64728f70e3f4b26bc5390a658672 (diff) | |
download | aspectj-499b8bcb0e89b39a63008fc68b44df9ed39d0750.tar.gz aspectj-499b8bcb0e89b39a63008fc68b44df9ed39d0750.zip |
these tests are now for 1.5.4, not 1.6.0
Diffstat (limited to 'tests/bugs154/pr197719')
-rw-r--r-- | tests/bugs154/pr197719/test/aspects/C1.java | 14 | ||||
-rw-r--r-- | tests/bugs154/pr197719/test/aspects/C3.java | 43 | ||||
-rw-r--r-- | tests/bugs154/pr197719/test/aspects/MyAnn.java | 13 | ||||
-rw-r--r-- | tests/bugs154/pr197719/test/aspects/MyAnnAspect.java | 24 | ||||
-rw-r--r-- | tests/bugs154/pr197719/test/aspects2/C2.java | 34 |
5 files changed, 128 insertions, 0 deletions
diff --git a/tests/bugs154/pr197719/test/aspects/C1.java b/tests/bugs154/pr197719/test/aspects/C1.java new file mode 100644 index 000000000..363c79a93 --- /dev/null +++ b/tests/bugs154/pr197719/test/aspects/C1.java @@ -0,0 +1,14 @@ +package test.aspects;
+
+public class C1 {
+
+ @MyAnn
+ protected void aMethod() {
+ System.out.println("Calling aMethod");
+ }
+
+ public void callAMethod() {
+ aMethod(); // Should be a marker here...
+ }
+
+}
diff --git a/tests/bugs154/pr197719/test/aspects/C3.java b/tests/bugs154/pr197719/test/aspects/C3.java new file mode 100644 index 000000000..abcde9b58 --- /dev/null +++ b/tests/bugs154/pr197719/test/aspects/C3.java @@ -0,0 +1,43 @@ +package test.aspects;
+
+import test.aspects2.C2;
+
+
+public class C3 {
+ /*
+ public void callAMethodC2() {
+ C1 c1 = new C1();
+ c1.aMethod(); // Should be a marker here...
+
+ C2 c2 = new C2();
+ c2.aMethod(); // Should be a marker here...
+ }
+
+ public void innerClassCall() {
+ InnerClass ic = new InnerClass();
+
+ ic.foo();
+ }
+ protected class InnerClass {
+ public void foo() {
+ C1 c1 = new C1();
+ c1.aMethod(); // Should be a marker here...
+
+ C2 c2 = new C2();
+ c2.aMethod(); // Should be a marker here...
+ }
+ }
+
+ public static void main(String [] args) {
+ C1 c1 = new C1();
+
+ c1.aMethod(); // Should be a marker here...
+ c1.callAMethod();
+
+ C3 c2 = new C3();
+
+ c2.callAMethodC2();
+ c2.innerClassCall();
+ }
+ */
+}
diff --git a/tests/bugs154/pr197719/test/aspects/MyAnn.java b/tests/bugs154/pr197719/test/aspects/MyAnn.java new file mode 100644 index 000000000..6610201b8 --- /dev/null +++ b/tests/bugs154/pr197719/test/aspects/MyAnn.java @@ -0,0 +1,13 @@ +package test.aspects;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Inherited;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+@Inherited
+@Retention(RetentionPolicy.RUNTIME)
+@Target(ElementType.METHOD)
+public @interface MyAnn {
+}
diff --git a/tests/bugs154/pr197719/test/aspects/MyAnnAspect.java b/tests/bugs154/pr197719/test/aspects/MyAnnAspect.java new file mode 100644 index 000000000..e29619767 --- /dev/null +++ b/tests/bugs154/pr197719/test/aspects/MyAnnAspect.java @@ -0,0 +1,24 @@ +package test.aspects;
+
+import org.aspectj.lang.ProceedingJoinPoint;
+import org.aspectj.lang.annotation.Around;
+import org.aspectj.lang.annotation.Aspect;
+import org.aspectj.lang.annotation.Pointcut;
+
+@Aspect
+public class MyAnnAspect {
+
+ @Pointcut("call(@MyAnn * *(..))")
+ void validatedMethod() {}
+
+
+ @Around("validatedMethod()")
+ public Object validateMethodImpl(ProceedingJoinPoint thisJoinPoint) throws Throwable {
+ return doInvoke(thisJoinPoint);
+ }
+
+ private Object doInvoke(final ProceedingJoinPoint thisJoinPoint) throws Throwable {
+ System.out.println("Invoking : " + thisJoinPoint);
+ return thisJoinPoint.proceed();
+ }
+}
diff --git a/tests/bugs154/pr197719/test/aspects2/C2.java b/tests/bugs154/pr197719/test/aspects2/C2.java new file mode 100644 index 000000000..799e7ac75 --- /dev/null +++ b/tests/bugs154/pr197719/test/aspects2/C2.java @@ -0,0 +1,34 @@ +package test.aspects2;
+
+import test.aspects.C1;
+
+
+public class C2 extends C1 {
+ public void callAMethodC2() {
+ aMethod(); // Should be a marker here...
+ }
+
+ public void innerClassCall() {
+ InnerClass ic = new InnerClass();
+
+ ic.foo();
+ }
+ protected class InnerClass {
+ public void foo() {
+ aMethod(); // Should be a marker here...
+ }
+ }
+
+ public static void main(String [] args) {
+ C1 c1 = new C1();
+
+ c1.callAMethod();
+
+ C2 c2 = new C2();
+
+ c2.aMethod(); // Should be a marker here...
+ c2.callAMethod();
+ c2.callAMethodC2();
+ c2.innerClassCall();
+ }
+}
|