]> source.dussan.org Git - aspectj.git/commitdiff
test from Wes (bug 159143)
authoraclement <aclement>
Wed, 4 Oct 2006 07:27:44 +0000 (07:27 +0000)
committeraclement <aclement>
Wed, 4 Oct 2006 07:27:44 +0000 (07:27 +0000)
tests/bugs153/pr159143/DeclareMethodAnnotation.java [new file with mode: 0644]
tests/src/org/aspectj/systemtest/ajc153/Ajc153Tests.java
tests/src/org/aspectj/systemtest/ajc153/ajc153.xml

diff --git a/tests/bugs153/pr159143/DeclareMethodAnnotation.java b/tests/bugs153/pr159143/DeclareMethodAnnotation.java
new file mode 100644 (file)
index 0000000..830ef72
--- /dev/null
@@ -0,0 +1,65 @@
+// Preserve lineation of affected types or redo expected messages
+
+
+
+@interface MtAn {} 
+
+
+
+
+public aspect DeclareMethodAnnotation {
+
+    
+
+    // ------------------ affected types
+    static class Untyped {
+        void untypedName() {} // declare warning 16
+        void untypedPrefix_blah() {} // declare warning 17
+        void blah_untypedSuffix() {} // declare warning 18       
+    }
+    
+    static class Star {
+        void starName() {} // declare warning 22
+        void starPrefix_blah() {} // declare warning 23
+        void blah_starSuffix() {} // declare warning  24      
+    }
+    static class Type{
+        void typeName() {} // declare warning 27
+        void typePrefix_blah() {} // declare warning 28
+        void blah_typeSuffix() {} // declare warning 29      
+    }
+    
+    static class TypePlus {    
+        void typeplusName() {} // declare warning 33
+        void typeplusPrefix_blah() {} // declare warning 34
+        void blah_typeplusSuffix() {} // declare warning 35              
+    }
+
+    static class TypePlusSubtype extends TypePlus {
+        void typeplusName() {} // declare warning 39
+        void typeplusPrefix_blah() {} // declare warning 40
+        void blah_typeplusSuffix() {} // declare warning  41              
+    }
+    
+    // ------------------ tests
+    declare @method: * untypedName() : @MtAn;
+    declare @method: * untypedPrefix*() : @MtAn;
+    declare @method: * *untypedSuffix() : @MtAn;
+
+    declare @method: * *.starName() : @MtAn;
+    declare @method: * *.starPrefix*() : @MtAn;
+    declare @method: * *.*starSuffix() : @MtAn;
+    
+    declare @method: * Type.typeName() : @MtAn;
+    declare @method: * Type.typePrefix*() : @MtAn;
+    declare @method: * Type.*typeSuffix() : @MtAn;
+    
+    declare @method: * TypePlus+.typeplusName() : @MtAn;
+    declare @method: * TypePlus+.typeplusPrefix*() : @MtAn;
+    declare @method: * TypePlus+.*typeplusSuffix() : @MtAn;
+
+    // ------------------ check using warnings, expected in .xml
+    declare warning : execution(@MtAn * *()): "all";
+
+}
+
index 9f2ff8775488fccd67437afc6e4935e7a8c13bc5..bef05f716841475790448d0d6ddd5d3345634d01 100644 (file)
@@ -29,6 +29,7 @@ public class Ajc153Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
   // public void testAmbiguousBinding_pr121805() { runTest("ambiguous binding");}
 //  public void testNoIllegalStateExceptionWithGenericInnerAspect_pr156058() { runTest("no IllegalStateException with generic inner aspect"); }
 //  public void testNegatedAnnotationMatchingProblem_pr153464() { runTest("negated annotation matching problem");}
+  public void testDeclareMethodAnnotations_pr159143() { runTest("declare method annotations");}
   public void testVisibilityProblem_pr149071()                 { runTest("visibility problem");}
   public void testMissingLineNumbersInStacktraceAfter_pr145442() { runTest("missing line numbers in stacktrace after");}
   public void testMissingLineNumbersInStacktraceAround_pr145442() { runTest("missing line numbers in stacktrace around");}
index c2d54e4d1e61564831ce52125e3341e63c5fb1fe..652472843f313a8020c461cf05a7d0bc5a0c370e 100644 (file)
@@ -2,6 +2,26 @@
 
 <!-- AspectJ v1.5.3 Tests -->
 <suite>
+     <ajc-test dir="bugs153/pr159143" title="declare method annotations">
+        <compile files="DeclareMethodAnnotation.java" options="-1.5">
+            <message line="16" kind="warning" text="all"/>
+            <message line="17" kind="warning" text="all"/>
+            <message line="18" kind="warning" text="all"/>
+            <message line="22" kind="warning" text="all"/>
+            <message line="23" kind="warning" text="all"/>
+            <message line="24" kind="warning" text="all"/>
+            <message line="27" kind="warning" text="all"/>
+            <message line="28" kind="warning" text="all"/>
+            <message line="29" kind="warning" text="all"/>
+            <message line="33" kind="warning" text="all"/>
+            <message line="34" kind="warning" text="all"/>
+            <message line="35" kind="warning" text="all"/>
+            <message line="39" kind="warning" text="all"/>
+            <message line="40" kind="warning" text="all"/>
+            <message line="41" kind="warning" text="all"/>
+        </compile>
+    </ajc-test>
+    
        <ajc-test dir="bugs153/pr148908" title="ensure getSourceSignature correct with static field">
       <compile files="BadInterface.java" options="-emacssym"/>
     </ajc-test>