]> source.dussan.org Git - aspectj.git/commitdiff
pointcuts and annotations - testcode
authoraclement <aclement>
Wed, 7 Sep 2011 18:35:05 +0000 (18:35 +0000)
committeraclement <aclement>
Wed, 7 Sep 2011 18:35:05 +0000 (18:35 +0000)
tests/bugs1612/prx/C.java [new file with mode: 0644]
tests/bugs1612/prx/D.java [new file with mode: 0644]
tests/src/org/aspectj/systemtest/ajc1612/Ajc1612Tests.java
tests/src/org/aspectj/systemtest/ajc1612/ajc1612.xml

diff --git a/tests/bugs1612/prx/C.java b/tests/bugs1612/prx/C.java
new file mode 100644 (file)
index 0000000..e82f44a
--- /dev/null
@@ -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 (file)
index 0000000..058bf8c
--- /dev/null
@@ -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) * *) {}
+}
index 4667d617aaae5215dfbb29e153ce7de09f39d408..a6182f18ecba490669e29a98c92f3f18212ed12f 100644 (file)
@@ -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");
        }
index 07b5a9993af435d108e984d6275c919e50cadefd..60ba012448aa0b5b4915c24e218d13f84afec593 100644 (file)
@@ -2,13 +2,24 @@
 
 <suite>
 
+<ajc-test dir="bugs1612/prx" title="class reference in annotation value">
+<compile files="C.java" options="-1.5"/>
+<run class="C">
+</run>
+</ajc-test>
+
+<ajc-test dir="bugs1612/prx" title="class reference in annotation value 2">
+<compile files="D.java" options="-1.5"/>
+<run class="D">
+</run>
+</ajc-test>
+
 <ajc-test dir="bugs1612/pr356612" title="annotation field binding optimization">
 <compile files="AnnoBinding.java" options="-1.5"/>
 <run class="AnnoBinding">
 </run>
 </ajc-test>
 
-
 <ajc-test dir="bugs1612/pr356612" title="annotation field binding optimization - 2">
 <compile files="AnnoBinding2.java" options="-1.5"/>
 <run class="AnnoBinding2">