diff options
author | aclement <aclement> | 2011-03-23 16:22:44 +0000 |
---|---|---|
committer | aclement <aclement> | 2011-03-23 16:22:44 +0000 |
commit | 0ff946aff9ce150707a375437fe7270a5095792f (patch) | |
tree | 7ccae226db59f4fc51ae29c6dc6fe98dffd3074c /tests | |
parent | df25267806381e84bdf17ab25ef88b28e7f3abc2 (diff) | |
download | aspectj-0ff946aff9ce150707a375437fe7270a5095792f.tar.gz aspectj-0ff946aff9ce150707a375437fe7270a5095792f.zip |
1.6.12 infra + 292239
Diffstat (limited to 'tests')
-rw-r--r-- | tests/bugs1612/pr292239/Code.java | 30 | ||||
-rw-r--r-- | tests/bugs1612/pr292239/Code2.java | 34 | ||||
-rw-r--r-- | tests/src/org/aspectj/systemtest/AllTests16.java | 2 | ||||
-rw-r--r-- | tests/src/org/aspectj/systemtest/ajc1612/Ajc1612Tests.java | 43 | ||||
-rw-r--r-- | tests/src/org/aspectj/systemtest/ajc1612/AllTestsAspectJ1612.java | 25 | ||||
-rw-r--r-- | tests/src/org/aspectj/systemtest/ajc1612/ajc1612.xml | 46 |
6 files changed, 180 insertions, 0 deletions
diff --git a/tests/bugs1612/pr292239/Code.java b/tests/bugs1612/pr292239/Code.java new file mode 100644 index 000000000..cbdfd3d50 --- /dev/null +++ b/tests/bugs1612/pr292239/Code.java @@ -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 index 000000000..93356d327 --- /dev/null +++ b/tests/bugs1612/pr292239/Code2.java @@ -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 diff --git a/tests/src/org/aspectj/systemtest/AllTests16.java b/tests/src/org/aspectj/systemtest/AllTests16.java index bcceb20b4..c13b783c4 100644 --- a/tests/src/org/aspectj/systemtest/AllTests16.java +++ b/tests/src/org/aspectj/systemtest/AllTests16.java @@ -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 index 000000000..55aa6d3bb --- /dev/null +++ b/tests/src/org/aspectj/systemtest/ajc1612/Ajc1612Tests.java @@ -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 index 000000000..702cfdc39 --- /dev/null +++ b/tests/src/org/aspectj/systemtest/ajc1612/AllTestsAspectJ1612.java @@ -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 index 000000000..943b4f28a --- /dev/null +++ b/tests/src/org/aspectj/systemtest/ajc1612/ajc1612.xml @@ -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 |