]> source.dussan.org Git - aspectj.git/commitdiff
1.6.12 infra + 292239
authoraclement <aclement>
Wed, 23 Mar 2011 16:22:44 +0000 (16:22 +0000)
committeraclement <aclement>
Wed, 23 Mar 2011 16:22:44 +0000 (16:22 +0000)
tests/bugs1612/pr292239/Code.java [new file with mode: 0644]
tests/bugs1612/pr292239/Code2.java [new file with mode: 0644]
tests/src/org/aspectj/systemtest/AllTests16.java
tests/src/org/aspectj/systemtest/ajc1612/Ajc1612Tests.java [new file with mode: 0644]
tests/src/org/aspectj/systemtest/ajc1612/AllTestsAspectJ1612.java [new file with mode: 0644]
tests/src/org/aspectj/systemtest/ajc1612/ajc1612.xml [new file with mode: 0644]

diff --git a/tests/bugs1612/pr292239/Code.java b/tests/bugs1612/pr292239/Code.java
new file mode 100644 (file)
index 0000000..cbdfd3d
--- /dev/null
@@ -0,0 +1,30 @@
+package mypackage;
+
+import javax.management.MXBean;
+
+aspect Azpect {
+
+    pointcut pc(Object o) : this(o) && execution(* (Code).n*(..));
+
+    after(Object o) throwing(Exception e) : pc(o) {
+       System.out.println("caught it");
+//     e.printStackTrace();
+    }
+    
+}
+
+public class Code {
+
+       // anotherCaughtMethod is NOT advised -- <<< ERROR <<< this should be advised
+    public void n() { throw new RuntimeException("n"); }
+    
+    public static void main(String[]argv) {
+       try {
+               new Code().n();
+       } catch (Exception e) {
+               
+       }
+               System.out.println("done");
+    }
+
+}
diff --git a/tests/bugs1612/pr292239/Code2.java b/tests/bugs1612/pr292239/Code2.java
new file mode 100644 (file)
index 0000000..93356d3
--- /dev/null
@@ -0,0 +1,34 @@
+package mypackage;
+
+aspect Azpect {
+
+    pointcut pc(Object o) : this(o) && execution(* Code2.n*(..) throws Exception+);
+
+    after(Object o) throwing(Exception e) : pc(o) {
+       System.out.println("caught it: "+thisJoinPointStaticPart);
+    }
+    
+}
+
+public class Code2 {
+
+
+    public void n1() { throw new RuntimeException("n"); }
+    public void n2() throws MyException { throw new MyException(); }
+    
+    public static void main(String[]argv) {
+       try {
+               new Code2().n1();
+       } catch (Exception e) {}
+       try {
+               new Code2().n2();
+       } catch (Exception e) {}
+               System.out.println("done");
+    }
+
+}
+
+class MyException extends Exception {
+       
+       
+}
\ No newline at end of file
index bcceb20b4eae650fcd0b6d46d1a35beddb162d0a..c13b783c464470519d53a830bbe13e1cbc7494b1 100644 (file)
@@ -10,6 +10,7 @@ import org.aspectj.systemtest.ajc160.AllTestsAspectJ160;
 import org.aspectj.systemtest.ajc161.AllTestsAspectJ161;
 import org.aspectj.systemtest.ajc1610.AllTestsAspectJ1610;
 import org.aspectj.systemtest.ajc1611.AllTestsAspectJ1611;
+import org.aspectj.systemtest.ajc1612.AllTestsAspectJ1612;
 import org.aspectj.systemtest.ajc162.AllTestsAspectJ162;
 import org.aspectj.systemtest.ajc163.AllTestsAspectJ163;
 import org.aspectj.systemtest.ajc164.AllTestsAspectJ164;
@@ -35,6 +36,7 @@ public class AllTests16 {
                suite.addTest(AllTestsAspectJ169.suite());
                suite.addTest(AllTestsAspectJ1610.suite());
                suite.addTest(AllTestsAspectJ1611.suite());
+               suite.addTest(AllTestsAspectJ1612.suite());
                suite.addTest(AllTests15.suite());
                // $JUnit-END$
                return suite;
diff --git a/tests/src/org/aspectj/systemtest/ajc1612/Ajc1612Tests.java b/tests/src/org/aspectj/systemtest/ajc1612/Ajc1612Tests.java
new file mode 100644 (file)
index 0000000..55aa6d3
--- /dev/null
@@ -0,0 +1,43 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Contributors
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *    Andy Clement - initial API and implementation
+ *******************************************************************************/
+package org.aspectj.systemtest.ajc1612;
+
+import java.io.File;
+
+import junit.framework.Test;
+
+import org.aspectj.testing.XMLBasedAjcTestCase;
+
+/**
+ * @author Andy Clement
+ */
+public class Ajc1612Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
+
+       public void testThrowsClause_292239() {
+               runTest("throws clause");
+       }
+
+       public void testThrowsClause_292239_2() {
+               runTest("throws clause - 2");
+       }
+
+       // ---
+
+       public static Test suite() {
+               return XMLBasedAjcTestCase.loadSuite(Ajc1612Tests.class);
+       }
+
+       @Override
+       protected File getSpecFile() {
+               return new File("../tests/src/org/aspectj/systemtest/ajc1612/ajc1612.xml");
+       }
+
+}
\ No newline at end of file
diff --git a/tests/src/org/aspectj/systemtest/ajc1612/AllTestsAspectJ1612.java b/tests/src/org/aspectj/systemtest/ajc1612/AllTestsAspectJ1612.java
new file mode 100644 (file)
index 0000000..702cfdc
--- /dev/null
@@ -0,0 +1,25 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Contributors
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *    Andy Clement - initial API and implementation
+ *******************************************************************************/
+package org.aspectj.systemtest.ajc1612;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+public class AllTestsAspectJ1612 {
+
+       public static Test suite() {
+               TestSuite suite = new TestSuite("AspectJ 1.6.12 tests");
+               // $JUnit-BEGIN$
+               suite.addTest(Ajc1612Tests.suite());
+               // $JUnit-END$
+               return suite;
+       }
+}
diff --git a/tests/src/org/aspectj/systemtest/ajc1612/ajc1612.xml b/tests/src/org/aspectj/systemtest/ajc1612/ajc1612.xml
new file mode 100644 (file)
index 0000000..943b4f2
--- /dev/null
@@ -0,0 +1,46 @@
+<!DOCTYPE suite SYSTEM "../tests/ajcTestSuite.dtd"[]>
+
+<suite>
+
+  <ajc-test dir="bugs1612/pr292239" title="throws clause">
+       <compile files="Code.java" options="-1.5 -showWeaveInfo">
+         <message kind="weave" text="Join point 'method-execution(void mypackage.Code.n())' in Type 'mypackage.Code' (Code.java:19) advised by afterThrowing advice from 'mypackage.Azpect' (Code.java:9)"/>
+       </compile>
+       <run class="mypackage.Code">
+       <stdout>
+       <line text="caught it"/>
+       <line text="done"/>
+       </stdout>
+       </run>
+  </ajc-test>
+  
+  <ajc-test dir="bugs1612/pr292239" title="throws clause - 2">
+       <compile files="Code2.java" options="-1.5 -showWeaveInfo">
+         <message kind="weave" text="Join point 'method-execution(void mypackage.Code2.n2())' in Type 'mypackage.Code2' (Code2.java:17) advised by afterThrowing advice from 'mypackage.Azpect' (Code2.java:7)"/>
+       </compile>
+       <run class="mypackage.Code2">
+       <stdout>
+       <line text="caught it: execution(void mypackage.Code2.n2())"/>
+       <line text="done"/>
+       </stdout>
+       </run>
+  </ajc-test>
+<!--  
+
+  
+  <ajc-test dir="bugs1611/pr336136" title="itit">
+    <compile files="Country_Roo_Op4j.java">
+    <message kind="error" text="The import com.foo cannot be resolved" line="1"/>
+    <message kind="error" text="The import org.javaruntype cannot be resolved" line="3"/>
+    <message kind="error" text="The import org.op4j cannot be resolved" line="4"/>
+    <message kind="error" text="The import org.op4j cannot be resolved" line="5"/>
+    <message kind="error" text="Country cannot be resolved to a type" line="9"/>
+    <message kind="error" text="Function cannot be resolved to a type" line="11"/>
+    <message kind="error" text="can't determine modifiers of missing type Country_Roo_Op4j$Keys"/>
+    </compile>"
+  </ajc-test>
+  
+  -->
+  
+  
+</suite>
\ No newline at end of file