From 0ff946aff9ce150707a375437fe7270a5095792f Mon Sep 17 00:00:00 2001 From: aclement Date: Wed, 23 Mar 2011 16:22:44 +0000 Subject: [PATCH] 1.6.12 infra + 292239 --- tests/bugs1612/pr292239/Code.java | 30 ++++++++++++ tests/bugs1612/pr292239/Code2.java | 34 ++++++++++++++ .../org/aspectj/systemtest/AllTests16.java | 2 + .../systemtest/ajc1612/Ajc1612Tests.java | 43 +++++++++++++++++ .../ajc1612/AllTestsAspectJ1612.java | 25 ++++++++++ .../aspectj/systemtest/ajc1612/ajc1612.xml | 46 +++++++++++++++++++ 6 files changed, 180 insertions(+) create mode 100644 tests/bugs1612/pr292239/Code.java create mode 100644 tests/bugs1612/pr292239/Code2.java create mode 100644 tests/src/org/aspectj/systemtest/ajc1612/Ajc1612Tests.java create mode 100644 tests/src/org/aspectj/systemtest/ajc1612/AllTestsAspectJ1612.java create mode 100644 tests/src/org/aspectj/systemtest/ajc1612/ajc1612.xml 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 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file -- 2.39.5