]> source.dussan.org Git - aspectj.git/commitdiff
357012/357013
authoraclement <aclement>
Wed, 7 Sep 2011 22:00:30 +0000 (22:00 +0000)
committeraclement <aclement>
Wed, 7 Sep 2011 22:00:30 +0000 (22:00 +0000)
tests/bugs1612/prx/C.java
tests/bugs1612/prx/D.java
tests/bugs1612/prx/E.java [new file with mode: 0644]
tests/bugs1612/prx/F.java [new file with mode: 0644]
tests/bugs1612/prx/G.java [new file with mode: 0644]
tests/src/org/aspectj/systemtest/ajc1612/Ajc1612Tests.java
tests/src/org/aspectj/systemtest/ajc1612/ajc1612.xml

index e82f44ad5e2e2ea8a2aaf9f2602a04cfa140ad40..6b8c336b3b50e2c80c95b7e63ade9af115067d46 100644 (file)
@@ -3,22 +3,21 @@ 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;
 
+  @Anno(Integer.class)
+  public int j;
+
   public static void main(String []argv) {
     System.out.println(new C().i);
+    System.out.println(new C().j);
   }
 }
-
 aspect X {
-  //before(): get(@Anno(String.class) * *(..)) {}
   before(): get(@Anno(value=String.class) * *) {}
-  //before(): get(@Anno(i=3) * *) {}
 }
index 058bf8c3c8d5163aa95869470a6e6705c91964c6..028022b264da181ae7daf4725e1717b6ac0fbb4d 100644 (file)
@@ -5,16 +5,23 @@ import java.lang.annotation.*;
 int i();
 }
 
-public class C {
+public class D {
 
   @Anno(i=3)
   public int i;
 
+  @Anno(i=4)
+  public int j;
+
+  @Anno(i=5)
+  public int k;
+
   public static void main(String []argv) {
-    System.out.println(new C().i);
+    System.out.println(new D().i);
+    System.out.println(new D().j);
+    System.out.println(new D().k);
   }
 }
-
 aspect X {
-  before(): get(@Anno(i!=3) * *) {}
+  before(): get(@Anno(i!=5) * *) {}
 }
diff --git a/tests/bugs1612/prx/E.java b/tests/bugs1612/prx/E.java
new file mode 100644 (file)
index 0000000..bf9584b
--- /dev/null
@@ -0,0 +1,23 @@
+import java.lang.annotation.*;
+
+@Retention(RetentionPolicy.RUNTIME)
+@interface Anno {
+  Class value() default String.class;
+}
+
+public class E {
+
+  @Anno
+  public int i;
+
+  @Anno(Integer.class)
+  public int j;
+
+  public static void main(String []argv) {
+    System.out.println(new E().i);
+    System.out.println(new E().j);
+  }
+}
+aspect X {
+  before(): get(@Anno(value=String.class) * *) {}
+}
diff --git a/tests/bugs1612/prx/F.java b/tests/bugs1612/prx/F.java
new file mode 100644 (file)
index 0000000..6945024
--- /dev/null
@@ -0,0 +1,27 @@
+import java.lang.annotation.*;
+
+@Retention(RetentionPolicy.RUNTIME)
+@interface Anno {
+Class i() default Number.class;
+}
+
+public class F {
+
+  @Anno(i=Integer.class)
+  public int i;
+
+  @Anno
+  public int j;
+
+  @Anno(i=String.class)
+  public int k;
+
+  public static void main(String []argv) {
+    System.out.println(new F().i);
+    System.out.println(new F().j);
+    System.out.println(new F().k);
+  }
+}
+aspect X {
+  before(): get(@Anno(i!=String.class) * *) {}
+}
diff --git a/tests/bugs1612/prx/G.java b/tests/bugs1612/prx/G.java
new file mode 100644 (file)
index 0000000..8158d6b
--- /dev/null
@@ -0,0 +1,23 @@
+import java.lang.annotation.*;
+
+@Retention(RetentionPolicy.RUNTIME)
+@interface Anno {
+  Class value();
+}
+
+public class G {
+
+  @Anno(String.class)
+  public int i;
+
+  @Anno(Integer.class)
+  public int j;
+
+  public static void main(String []argv) {
+    System.out.println(new G().i);
+    System.out.println(new G().j);
+  }
+}
+aspect X {
+  before(): get(@Anno(value=Foo.class) * *) {}
+}
index a6182f18ecba490669e29a98c92f3f18212ed12f..27f6c58ae3bad66ffd9fa2de66de66d062a98366 100644 (file)
@@ -35,12 +35,24 @@ public class Ajc1612Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
        // runTest("itd split compilation");
        // }
 
-       public void testClassRef() throws Exception {
+       public void testNotEqualWithAnnotationValues_357013() throws Exception {
+               runTest("annotation values not equal");
+       }
+
+       public void testNotEqualWithAnnotationValues_357013_2() throws Exception {
+               runTest("annotation values not equal 2");
+       }
+
+       public void testClassRef_357012() throws Exception {
                runTest("class reference in annotation value");
        }
 
-       public void testClassRef2() throws Exception {
-               runTest("class reference in annotation value 2");
+       public void testClassRefInvalidName_357012_2() throws Exception {
+               runTest("class reference in annotation value - invalid typename");
+       }
+
+       public void testClassRef_357012_3() throws Exception {
+               runTest("class reference in annotation value 3");
        }
 
        public void testAnnotationFieldBindingOptimization_356612() throws Exception {
index 60ba012448aa0b5b4915c24e218d13f84afec593..efabde26a7babe2e9b821539e7f023cb31e11309 100644 (file)
@@ -3,17 +3,46 @@
 <suite>
 
 <ajc-test dir="bugs1612/prx" title="class reference in annotation value">
-<compile files="C.java" options="-1.5"/>
+<compile files="C.java" options="-1.5 -showWeaveInfo">
+<message kind="weave" text="Join point 'field-get(int C.i)' in Type 'C' (C.java:17) advised by before advice from 'X' (C.java:22)"/>
+</compile>
 <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"/>
+<ajc-test dir="bugs1612/prx" title="annotation values not equal">
+<compile files="D.java" options="-1.5 -showWeaveInfo">
+<message kind="weave" text="Join point 'field-get(int D.i)' in Type 'D' (D.java:20) advised by before advice from 'X' (D.java:26)"/>
+<message kind="weave" text="Join point 'field-get(int D.j)' in Type 'D' (D.java:21) advised by before advice from 'X' (D.java:26)"/>
+</compile>
 <run class="D">
 </run>
 </ajc-test>
 
+<ajc-test dir="bugs1612/prx" title="class reference in annotation value 3">
+<compile files="E.java" options="-1.5 -showWeaveInfo">
+<message kind="weave" text="Join point 'field-get(int E.i)' in Type 'E' (E.java:17) advised by before advice from 'X' (E.java:22)"/>
+</compile>
+<run class="E">
+</run>
+</ajc-test>
+
+<ajc-test dir="bugs1612/prx" title="annotation values not equal 2">
+<compile files="F.java" options="-1.5 -showWeaveInfo">
+<message kind="weave" text="Join point 'field-get(int F.i)' in Type 'F' (F.java:20) advised by before advice from 'X' (F.java:26)"/>
+<message kind="weave" text="Join point 'field-get(int F.j)' in Type 'F' (F.java:21) advised by before advice from 'X' (F.java:26)"/>
+</compile>
+<run class="F">
+</run>
+</ajc-test>
+
+
+<ajc-test dir="bugs1612/prx" title="class reference in annotation value - invalid typename">
+<compile files="G.java" options="-1.5 -showWeaveInfo">
+<message kind="weave" text="Join point 'field-get(int C.i)' in Type 'C' (C.java:17) advised by before advice from 'X' (C.java:22)"/>
+</compile>
+</ajc-test>
+
 <ajc-test dir="bugs1612/pr356612" title="annotation field binding optimization">
 <compile files="AnnoBinding.java" options="-1.5"/>
 <run class="AnnoBinding">