From: aclement Date: Wed, 7 Sep 2011 18:35:05 +0000 (+0000) Subject: pointcuts and annotations - testcode X-Git-Tag: V1_6_12~27 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=e5ed164a438cc11f4ec55a68f28f62fc14ade0ac;p=aspectj.git pointcuts and annotations - testcode --- diff --git a/tests/bugs1612/prx/C.java b/tests/bugs1612/prx/C.java new file mode 100644 index 000000000..e82f44ad5 --- /dev/null +++ b/tests/bugs1612/prx/C.java @@ -0,0 +1,24 @@ +import java.lang.annotation.*; + +@Retention(RetentionPolicy.RUNTIME) +@interface Anno { + Class value(); +//int i(); +} + +public class C { + + @Anno(String.class) + //@Anno(i=3) + public int i; + + public static void main(String []argv) { + System.out.println(new C().i); + } +} + +aspect X { + //before(): get(@Anno(String.class) * *(..)) {} + before(): get(@Anno(value=String.class) * *) {} + //before(): get(@Anno(i=3) * *) {} +} diff --git a/tests/bugs1612/prx/D.java b/tests/bugs1612/prx/D.java new file mode 100644 index 000000000..058bf8c3c --- /dev/null +++ b/tests/bugs1612/prx/D.java @@ -0,0 +1,20 @@ +import java.lang.annotation.*; + +@Retention(RetentionPolicy.RUNTIME) +@interface Anno { +int i(); +} + +public class C { + + @Anno(i=3) + public int i; + + public static void main(String []argv) { + System.out.println(new C().i); + } +} + +aspect X { + before(): get(@Anno(i!=3) * *) {} +} diff --git a/tests/src/org/aspectj/systemtest/ajc1612/Ajc1612Tests.java b/tests/src/org/aspectj/systemtest/ajc1612/Ajc1612Tests.java index 4667d617a..a6182f18e 100644 --- a/tests/src/org/aspectj/systemtest/ajc1612/Ajc1612Tests.java +++ b/tests/src/org/aspectj/systemtest/ajc1612/Ajc1612Tests.java @@ -35,6 +35,14 @@ public class Ajc1612Tests extends org.aspectj.testing.XMLBasedAjcTestCase { // runTest("itd split compilation"); // } + public void testClassRef() throws Exception { + runTest("class reference in annotation value"); + } + + public void testClassRef2() throws Exception { + runTest("class reference in annotation value 2"); + } + public void testAnnotationFieldBindingOptimization_356612() throws Exception { runTest("annotation field binding optimization"); } diff --git a/tests/src/org/aspectj/systemtest/ajc1612/ajc1612.xml b/tests/src/org/aspectj/systemtest/ajc1612/ajc1612.xml index 07b5a9993..60ba01244 100644 --- a/tests/src/org/aspectj/systemtest/ajc1612/ajc1612.xml +++ b/tests/src/org/aspectj/systemtest/ajc1612/ajc1612.xml @@ -2,13 +2,24 @@ + + + + + + + + + + + + -