]> source.dussan.org Git - aspectj.git/commitdiff
238992: test and fix: string anno values
authoraclement <aclement>
Thu, 31 Jul 2008 19:17:00 +0000 (19:17 +0000)
committeraclement <aclement>
Thu, 31 Jul 2008 19:17:00 +0000 (19:17 +0000)
tests/bugs162/pr238992/Foo5.java [new file with mode: 0644]
tests/src/org/aspectj/systemtest/ajc162/Ajc162Tests.java
tests/src/org/aspectj/systemtest/ajc162/ajc162.xml

diff --git a/tests/bugs162/pr238992/Foo5.java b/tests/bugs162/pr238992/Foo5.java
new file mode 100644 (file)
index 0000000..78a5d51
--- /dev/null
@@ -0,0 +1,36 @@
+import java.lang.annotation.*;
+import java.io.*;
+
+@Entity(s="xxx")
+public class Foo5 {
+  public static void main(String []argv) {
+    Foo5 f = new Foo5();
+    Goo g = new Goo();
+    if (f instanceof Serializable) {
+       throw new RuntimeException("Foo5 should not implement it");        
+    }
+    if (!(g instanceof Serializable)) {
+       throw new RuntimeException("Goo should implement it");        
+    }
+    if (!(new Hoo() instanceof Serializable)) {
+       throw new RuntimeException("Hoo should implement it");        
+    }
+  }
+}
+
+@Entity(s="yyy")
+class Goo {
+}
+
+@Entity // default is "yyy"
+class Hoo {
+}
+
+@Retention(RetentionPolicy.RUNTIME)
+@interface Entity {
+  String s() default "yyy";
+}
+
+aspect X {
+  declare parents: (@Entity(s="yyy") *) implements java.io.Serializable;
+}
index 6fd46344a867118f935ad65d4f4b835e131f8c1d..1b278cb6c674bd51eb554ed13f9b85c0ddbdd0e3 100644 (file)
@@ -23,10 +23,11 @@ public class Ajc162Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
 //     public void testParamAnnoInner_pr241861() { runTest("param annotation inner class"); }
        public void testAnnotationDecp_pr239441() { runTest("annotation decp"); }
        public void testAtAspectJPerTarget_pr198181() { runTest("ataspectj ltw pertarget"); }
-//     public void testAnnotationValueDecp_pr238992() { runTest("annotation value decp"); }
-//     public void testAnnotationValueDecp_pr238992_2() { runTest("annotation value decp - 2"); }
-//     public void testAnnotationValueDecp_pr238992_3() { runTest("annotation value decp - 3"); }
-//     public void testAnnotationValueDecp_pr238992_4() { runTest("annotation value decp - 4"); }
+       public void testAnnotationValueDecp_pr238992() { runTest("annotation value decp"); }
+       public void testAnnotationValueDecp_pr238992_2() { runTest("annotation value decp - 2"); }
+       public void testAnnotationValueDecp_pr238992_3() { runTest("annotation value decp - 3"); }
+       public void testAnnotationValueDecp_pr238992_4() { runTest("annotation value decp - 4"); }
+       public void testAnnotationValueDecp_pr238992_5() { runTest("annotation value decp - 5"); }
        
        /*
         * test plan
index d0ce9c69d7ab62ceffe9638c5e569b862dc08077..dc9d4bf8c0c76d4758480fe73217f902d1aa2d5d 100644 (file)
        <run class="Foo4"/>
     </ajc-test>    
     
+       <ajc-test dir="bugs162/pr238992" title="annotation value decp - 5">
+       <compile files="Foo5.java" options="-1.5 -showWeaveInfo">
+         <message kind="weave" text="Extending interface set for type 'Goo'"/>
+         <message kind="weave" text="Extending interface set for type 'Hoo'"/>
+       </compile>
+       <run class="Foo5"/>
+    </ajc-test>    
+    
     <ajc-test dir="bugs162/pr233718" title="parameter subsetting - matching">
         <compile files="Matching.java" options="-1.5 -showWeaveInfo">
           <message kind="weave" text="Join point 'method-execution(void Matching.m(java.lang.String))' in Type 'Matching' (Matching.java:3) advised by before advice from 'Matching' (Matching.java:8)"/>