]> source.dussan.org Git - aspectj.git/commitdiff
annotation value matching in decp
authoraclement <aclement>
Mon, 3 Mar 2008 17:23:18 +0000 (17:23 +0000)
committeraclement <aclement>
Mon, 3 Mar 2008 17:23:18 +0000 (17:23 +0000)
tests/bugs160/various/A.java [new file with mode: 0644]
tests/bugs160/various/Z.java [new file with mode: 0644]
tests/src/org/aspectj/systemtest/ajc160/Ajc160Tests.java
tests/src/org/aspectj/systemtest/ajc160/ajc160.xml

diff --git a/tests/bugs160/various/A.java b/tests/bugs160/various/A.java
new file mode 100644 (file)
index 0000000..d09cdcf
--- /dev/null
@@ -0,0 +1,16 @@
+// HasMethod with anno value matching
+
+@interface I {
+  int i();
+}
+aspect A {
+  declare parents: hasmethod(@I(i=5) * *(..)) implements java.io.Serializable;
+}
+
+class B {
+@I(i=5)  public void m() {}
+}
+class C {
+@I(i=6)  public void m() {}
+}
+
diff --git a/tests/bugs160/various/Z.java b/tests/bugs160/various/Z.java
new file mode 100644 (file)
index 0000000..4fb0cb1
--- /dev/null
@@ -0,0 +1,16 @@
+// HasMethod with anno value matching
+
+@interface I {
+  boolean b();
+}
+aspect A {
+  declare parents: hasmethod(@I(b=true) * *(..)) implements java.io.Serializable;
+}
+
+class B {
+@I(b=true)  public void m() {}
+}
+class C {
+@I(b=false)  public void m() {}
+}
+
index d3bd8e1b6fd4c2e4b705f45a812438d330d9822a..cf88304c21c0a80da2b1ae0002636bbcd2d025ae 100644 (file)
@@ -20,6 +20,11 @@ import junit.framework.Test;
  */
 public class Ajc160Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
        
+       // AspectH1.6.0rc1
+       public void testHasMethodAnnoValueInt_various() { runTest("hasmethod anno value - I");}
+       public void testHasMethodAnnoValueBoolean_various() { runTest("hasmethod anno value - Z");}
+       
+       // AspectJ1.6.0m2 and earlier
        public void testBoundsCheckShouldFail_pr219298() { runTest("bounds check failure");}
        public void testBoundsCheckShouldFail_pr219298_2() { runTest("bounds check failure - 2");}
        public void testGenericMethodMatching_pr204505_1() { runTest("generics method matching - 1");}
index 09da1df8832fc94b6e97c3748452e13f558b3cd6..35bc56a79fae91b606fc4bb2df9ab0a334084116 100644 (file)
@@ -3,6 +3,18 @@
 <!-- AspectJ v1.6.0 Tests -->
 <suite>
 
+   <ajc-test dir="bugs160/various" title="hasmethod anno value - I">
+     <compile options="-1.5 -XhasMember -showWeaveInfo" files="A.java">
+       <message kind="weave" text="Extending interface set for type 'B' (A.java) to include 'java.io.Serializable' (A.java)"/>
+     </compile>
+   </ajc-test>
+
+   <ajc-test dir="bugs160/various" title="hasmethod anno value - Z">
+     <compile options="-1.5 -XhasMember -showWeaveInfo" files="Z.java">
+       <message kind="weave" text="Extending interface set for type 'B' (Z.java) to include 'java.io.Serializable' (Z.java)"/>
+     </compile>
+   </ajc-test>
+
    <ajc-test dir="bugs160/various" title="hasmethod semantics">
      <compile options="-1.5 -XhasMember -Xlint:ignore" files="HasMethodSemantics.java"/>
      <run class="HasMethodSemantics">