diff options
author | aclement <aclement> | 2011-01-24 22:41:24 +0000 |
---|---|---|
committer | aclement <aclement> | 2011-01-24 22:41:24 +0000 |
commit | cd4d7e707121f719bc6f5625341b30c11c3d3bfe (patch) | |
tree | 92c85510db973fe57a3f5ada5161efab8f8026a4 | |
parent | d15ad6f11f9beb58de925f812bf7506127d27e27 (diff) | |
download | aspectj-cd4d7e707121f719bc6f5625341b30c11c3d3bfe.tar.gz aspectj-cd4d7e707121f719bc6f5625341b30c11c3d3bfe.zip |
333274: testcode
-rw-r--r-- | tests/bugs1611/pr333274/ma/Annotation1.java | 9 | ||||
-rw-r--r-- | tests/bugs1611/pr333274/ma/Main.java | 16 | ||||
-rw-r--r-- | tests/bugs1611/pr333274/ma/Precedence.java | 10 | ||||
-rw-r--r-- | tests/bugs1611/pr333274/ma/aspect1/Aspect1.java | 25 | ||||
-rw-r--r-- | tests/bugs1611/pr333274/ma/aspect3/Aspect3.java | 22 | ||||
-rw-r--r-- | tests/bugs1611/pr333274/ma2/Annotation1.java | 9 | ||||
-rw-r--r-- | tests/bugs1611/pr333274/ma2/Main.java | 16 | ||||
-rw-r--r-- | tests/bugs1611/pr333274/ma2/Precedence.java | 10 | ||||
-rw-r--r-- | tests/bugs1611/pr333274/ma2/aspect1/Aspect1.java | 23 | ||||
-rw-r--r-- | tests/bugs1611/pr333274/ma2/aspect3/Aspect3.java | 20 |
10 files changed, 160 insertions, 0 deletions
diff --git a/tests/bugs1611/pr333274/ma/Annotation1.java b/tests/bugs1611/pr333274/ma/Annotation1.java new file mode 100644 index 000000000..67e06ae54 --- /dev/null +++ b/tests/bugs1611/pr333274/ma/Annotation1.java @@ -0,0 +1,9 @@ +package ma; + +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; + +@Retention(RetentionPolicy.RUNTIME) +public @interface Annotation1 { + +} diff --git a/tests/bugs1611/pr333274/ma/Main.java b/tests/bugs1611/pr333274/ma/Main.java new file mode 100644 index 000000000..543e39e60 --- /dev/null +++ b/tests/bugs1611/pr333274/ma/Main.java @@ -0,0 +1,16 @@ +package ma; + + +public class Main { + + @Annotation1 + public int retryTranslateAndTimeLimited() { + System.out.println("Method call"); + return 1; + } + + public static void main(String[] args) { + new Main().retryTranslateAndTimeLimited(); + } + +} diff --git a/tests/bugs1611/pr333274/ma/Precedence.java b/tests/bugs1611/pr333274/ma/Precedence.java new file mode 100644 index 000000000..bc5263757 --- /dev/null +++ b/tests/bugs1611/pr333274/ma/Precedence.java @@ -0,0 +1,10 @@ +package ma; + +import org.aspectj.lang.annotation.Aspect; +import org.aspectj.lang.annotation.DeclarePrecedence; + +@Aspect +@DeclarePrecedence("ma.aspect1.Aspect1, ma.aspect3.Aspect3") +class Precedence { + +} diff --git a/tests/bugs1611/pr333274/ma/aspect1/Aspect1.java b/tests/bugs1611/pr333274/ma/aspect1/Aspect1.java new file mode 100644 index 000000000..b76a0ca8f --- /dev/null +++ b/tests/bugs1611/pr333274/ma/aspect1/Aspect1.java @@ -0,0 +1,25 @@ +package ma.aspect1; + +import org.aspectj.lang.ProceedingJoinPoint; +import org.aspectj.lang.annotation.Around; +import org.aspectj.lang.annotation.Aspect; + + +@Aspect +public class Aspect1 { + + @Around("execution(@ma.Annotation1 * *(..))") + public Object inRetryAspect(ProceedingJoinPoint pjp) throws Throwable { + new InternalClass(); + System.out.println(">In Aspect1"); + pjp.proceed(); + System.out.println("=In Aspect1"); + Object o = pjp.proceed(); + System.out.println("<In Aspect1"); + return o; + } + + private static class InternalClass { + } + +} diff --git a/tests/bugs1611/pr333274/ma/aspect3/Aspect3.java b/tests/bugs1611/pr333274/ma/aspect3/Aspect3.java new file mode 100644 index 000000000..93c17cee8 --- /dev/null +++ b/tests/bugs1611/pr333274/ma/aspect3/Aspect3.java @@ -0,0 +1,22 @@ +package ma.aspect3; + +import org.aspectj.lang.ProceedingJoinPoint; +import org.aspectj.lang.annotation.Around; +import org.aspectj.lang.annotation.Aspect; + +@Aspect +public class Aspect3 { + + @Around("execution(@ma.Annotation1 * *(..))") + public Object inTimeLimiterAspect(ProceedingJoinPoint pjp) throws Throwable { + new InnerClass2(); + System.out.println(">In Aspect3"); + Object returnedObject = pjp.proceed(); + System.out.println("<In Aspect3"); + return returnedObject; + } + + private static class InnerClass2 { + + } +} diff --git a/tests/bugs1611/pr333274/ma2/Annotation1.java b/tests/bugs1611/pr333274/ma2/Annotation1.java new file mode 100644 index 000000000..1c8ab25bd --- /dev/null +++ b/tests/bugs1611/pr333274/ma2/Annotation1.java @@ -0,0 +1,9 @@ +package ma2; + +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; + +@Retention(RetentionPolicy.RUNTIME) +public @interface Annotation1 { + +} diff --git a/tests/bugs1611/pr333274/ma2/Main.java b/tests/bugs1611/pr333274/ma2/Main.java new file mode 100644 index 000000000..52e93f212 --- /dev/null +++ b/tests/bugs1611/pr333274/ma2/Main.java @@ -0,0 +1,16 @@ +package ma2; + + +public class Main { + + @Annotation1 + public int retryTranslateAndTimeLimited() { + System.out.println("Method call"); + return 1; + } + + public static void main(String[] args) { + new Main().retryTranslateAndTimeLimited(); + } + +} diff --git a/tests/bugs1611/pr333274/ma2/Precedence.java b/tests/bugs1611/pr333274/ma2/Precedence.java new file mode 100644 index 000000000..bdfd1565e --- /dev/null +++ b/tests/bugs1611/pr333274/ma2/Precedence.java @@ -0,0 +1,10 @@ +package ma2; + +import org.aspectj.lang.annotation.Aspect; +import org.aspectj.lang.annotation.DeclarePrecedence; + +@Aspect +@DeclarePrecedence("ma2.aspect1.Aspect1, ma2.aspect3.Aspect3") +class Precedence { + +} diff --git a/tests/bugs1611/pr333274/ma2/aspect1/Aspect1.java b/tests/bugs1611/pr333274/ma2/aspect1/Aspect1.java new file mode 100644 index 000000000..e035967bb --- /dev/null +++ b/tests/bugs1611/pr333274/ma2/aspect1/Aspect1.java @@ -0,0 +1,23 @@ +package ma2.aspect1; + +import org.aspectj.lang.ProceedingJoinPoint; +import org.aspectj.lang.annotation.Around; +import org.aspectj.lang.annotation.Aspect; + + +public aspect Aspect1 { + + Object around(): execution(@ma2.Annotation1 * *(..)) { + new InternalClass(); + System.out.println(">In Aspect1"); + proceed(); + System.out.println("=In Aspect1"); + Object o = proceed(); + System.out.println("<In Aspect1"); + return o; + } + + private static class InternalClass { + } + +} diff --git a/tests/bugs1611/pr333274/ma2/aspect3/Aspect3.java b/tests/bugs1611/pr333274/ma2/aspect3/Aspect3.java new file mode 100644 index 000000000..06280ae99 --- /dev/null +++ b/tests/bugs1611/pr333274/ma2/aspect3/Aspect3.java @@ -0,0 +1,20 @@ +package ma2.aspect3; + +import org.aspectj.lang.ProceedingJoinPoint; +import org.aspectj.lang.annotation.Around; +import org.aspectj.lang.annotation.Aspect; + +public aspect Aspect3 { + + Object around(): execution(@ma2.Annotation1 * *(..)) { + new InnerClass2(); + System.out.println(">In Aspect3"); + Object returnedObject = proceed(); + System.out.println("<In Aspect3"); + return returnedObject; + } + + private static class InnerClass2 { + + } +} |