]> source.dussan.org Git - aspectj.git/commitdiff
241847: test added, commented out
authoraclement <aclement>
Wed, 30 Jul 2008 16:39:51 +0000 (16:39 +0000)
committeraclement <aclement>
Wed, 30 Jul 2008 16:39:51 +0000 (16:39 +0000)
tests/bugs162/pr241847/Ann.java [new file with mode: 0644]
tests/bugs162/pr241847/Asp.aj [new file with mode: 0644]
tests/bugs162/pr241847/CC.java [new file with mode: 0644]
tests/bugs162/pr241847/II.java [new file with mode: 0644]
tests/bugs162/pr241847/LongLong.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/pr241847/Ann.java b/tests/bugs162/pr241847/Ann.java
new file mode 100644 (file)
index 0000000..689d934
--- /dev/null
@@ -0,0 +1,8 @@
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+
+
+@Retention(RetentionPolicy.RUNTIME)
+public @interface Ann {
+
+}
diff --git a/tests/bugs162/pr241847/Asp.aj b/tests/bugs162/pr241847/Asp.aj
new file mode 100644 (file)
index 0000000..9df7b7f
--- /dev/null
@@ -0,0 +1,9 @@
+import java.util.Arrays;
+
+
+public aspect Asp {
+   before() : execution(* *(@Ann (*), ..)) {
+      //System.out.println(thisJoinPoint.getSignature().toShortString() + ' ' + Arrays.asList(thisJoinPoint.getArgs()));
+      throw new RuntimeException("expected exception");
+   }
+}
diff --git a/tests/bugs162/pr241847/CC.java b/tests/bugs162/pr241847/CC.java
new file mode 100644 (file)
index 0000000..43dd3b6
--- /dev/null
@@ -0,0 +1,15 @@
+
+public class CC implements II {
+   public void m1(String arg) {
+   }
+
+   public static void main(String [] args) throws Exception {
+      try {
+         new CC().m1(null);
+         throw new Exception("(BAD) advice did not run");
+      } catch (RuntimeException e) {
+         System.out.println("(GOOD) advice ran and threw expected exception");
+         e.printStackTrace(System.out);
+      }
+   }
+}
diff --git a/tests/bugs162/pr241847/II.java b/tests/bugs162/pr241847/II.java
new file mode 100644 (file)
index 0000000..f059f69
--- /dev/null
@@ -0,0 +1,4 @@
+
+public interface II {
+   public void m1(@Ann String arg);
+}
diff --git a/tests/bugs162/pr241847/LongLong.java b/tests/bugs162/pr241847/LongLong.java
new file mode 100644 (file)
index 0000000..40546bf
--- /dev/null
@@ -0,0 +1,14 @@
+public class LongLong implements II {
+   public void m1(String arg) {
+   }
+
+   public static void main(String [] args) throws Exception {
+      try {
+         new LongLong().m1(null);
+         throw new Exception("(BAD) advice did not run");
+      } catch (RuntimeException e) {
+         System.out.println("(GOOD) advice ran and threw expected exception");
+         e.printStackTrace(System.out);
+      }
+   }
+}
index df1286a7add7d4c999060059a18573e15f8c73d5..6fd46344a867118f935ad65d4f4b835e131f8c1d 100644 (file)
@@ -19,6 +19,7 @@ import org.aspectj.testing.XMLBasedAjcTestCase;
 public class Ajc162Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
        
        // AspectJ1.6.2 
+//     public void testParamAnnosPipelining_pr241847() { runTest("param annos pipelining");}
 //     public void testParamAnnoInner_pr241861() { runTest("param annotation inner class"); }
        public void testAnnotationDecp_pr239441() { runTest("annotation decp"); }
        public void testAtAspectJPerTarget_pr198181() { runTest("ataspectj ltw pertarget"); }
index 5c3c494b71606f7135a35ffd2a0a698da1e26770..d0ce9c69d7ab62ceffe9638c5e569b862dc08077 100644 (file)
@@ -3,6 +3,13 @@
 <!-- AspectJ v1.6.2 Tests -->
 <suite>
 
+       <ajc-test dir="bugs162/pr241847" title="param annos pipelining">
+       <compile files="Asp.aj Ann.java CC.java II.java LongLong.java" options="-1.5 -showWeaveInfo">
+               <message kind="weave" text="Join point 'method-execution(void LongLong.m1(java.lang.String))' in Type 'LongLong' (LongLong.java:2) advised by before advice from 'Asp' (Asp.aj:5)"/>
+               <message kind="weave" line="3"/>
+       </compile>
+    </ajc-test>    
+
        <ajc-test dir="bugs162/pr239441" title="annotation decp">
        <compile files="Test3.java SampleAspect.java" options="-1.5 -showWeaveInfo -XhasMember">
        </compile>