diff options
author | Andy Clement <aclement@pivotal.io> | 2019-06-03 10:06:59 -0700 |
---|---|---|
committer | Andy Clement <aclement@pivotal.io> | 2019-06-03 10:06:59 -0700 |
commit | ff7f5a5441d4e2e8744a10c8f7c733fa208e0b89 (patch) | |
tree | 5334238d7461c41d869365232bcbded6a7a9f159 /tests/src | |
parent | 01f7d8ba8e3ff34ffacb95ae25787b0f0ce9f1d8 (diff) | |
download | aspectj-ff7f5a5441d4e2e8744a10c8f7c733fa208e0b89.tar.gz aspectj-ff7f5a5441d4e2e8744a10c8f7c733fa208e0b89.zip |
Fix 547808: npe regression for multi @Around
Diffstat (limited to 'tests/src')
4 files changed, 88 insertions, 9 deletions
diff --git a/tests/src/test/java/org/aspectj/systemtest/AllTests19.java b/tests/src/test/java/org/aspectj/systemtest/AllTests19.java index c2c798c32..eeff00b31 100644 --- a/tests/src/test/java/org/aspectj/systemtest/AllTests19.java +++ b/tests/src/test/java/org/aspectj/systemtest/AllTests19.java @@ -1,12 +1,9 @@ /******************************************************************************* - * Copyright (c) 2013, 2014 Contributors + * Copyright (c) 2013, 2019 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; @@ -14,19 +11,25 @@ import org.aspectj.systemtest.ajc190.AllTestsAspectJ190; import org.aspectj.systemtest.ajc191.AllTestsAspectJ191; import org.aspectj.systemtest.ajc192.AllTestsAspectJ192; import org.aspectj.systemtest.ajc193.AllTestsAspectJ193; +import org.aspectj.systemtest.ajc195.AllTestsAspectJ195; import junit.framework.Test; import junit.framework.TestSuite; +/** + * @author Andy Clement + */ public class AllTests19 { public static Test suite() { TestSuite suite = new TestSuite("AspectJ System Test Suite - 1.9"); - // $JUnit-BEGIN$ - suite.addTest(AllTestsAspectJ190.suite()); - suite.addTest(AllTestsAspectJ191.suite()); - suite.addTest(AllTestsAspectJ192.suite()); - suite.addTest(AllTestsAspectJ193.suite()); + // $JUnit-BEGIN$ + suite.addTest(AllTestsAspectJ190.suite()); + suite.addTest(AllTestsAspectJ191.suite()); + suite.addTest(AllTestsAspectJ192.suite()); + suite.addTest(AllTestsAspectJ193.suite()); + // there were no new tests for 1.9.4 + suite.addTest(AllTestsAspectJ195.suite()); suite.addTest(AllTests18.suite()); // $JUnit-END$ return suite; diff --git a/tests/src/test/java/org/aspectj/systemtest/ajc195/Ajc195Tests.java b/tests/src/test/java/org/aspectj/systemtest/ajc195/Ajc195Tests.java new file mode 100644 index 000000000..7c6034a3e --- /dev/null +++ b/tests/src/test/java/org/aspectj/systemtest/ajc195/Ajc195Tests.java @@ -0,0 +1,34 @@ +/******************************************************************************* + * Copyright (c) 2019 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 + *******************************************************************************/ +package org.aspectj.systemtest.ajc195; + +import org.aspectj.testing.XMLBasedAjcTestCase; + +import junit.framework.Test; + +/** + * @author Andy Clement + */ +public class Ajc195Tests extends XMLBasedAjcTestCase { + + public void testFinallyBlocksAndUnlinkingAndExceptions() { + runTest("around finally blocks and unlinking"); + } + + // --- + + public static Test suite() { + return XMLBasedAjcTestCase.loadSuite(Ajc195Tests.class); + } + + @Override + protected java.net.URL getSpecFile() { + return getClassResource("ajc195.xml"); + } + +} diff --git a/tests/src/test/java/org/aspectj/systemtest/ajc195/AllTestsAspectJ195.java b/tests/src/test/java/org/aspectj/systemtest/ajc195/AllTestsAspectJ195.java new file mode 100644 index 000000000..a7eb6604e --- /dev/null +++ b/tests/src/test/java/org/aspectj/systemtest/ajc195/AllTestsAspectJ195.java @@ -0,0 +1,23 @@ +/******************************************************************************* + * Copyright (c) 2018-2019 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.ajc195; + +import junit.framework.Test; +import junit.framework.TestSuite; + +public class AllTestsAspectJ195 { + + public static Test suite() { + TestSuite suite = new TestSuite("AspectJ 1.9.4 tests"); + suite.addTest(Ajc195Tests.suite()); + return suite; + } +} diff --git a/tests/src/test/resources/org/aspectj/systemtest/ajc195/ajc195.xml b/tests/src/test/resources/org/aspectj/systemtest/ajc195/ajc195.xml new file mode 100644 index 000000000..10d1a0156 --- /dev/null +++ b/tests/src/test/resources/org/aspectj/systemtest/ajc195/ajc195.xml @@ -0,0 +1,19 @@ +<!DOCTYPE suite SYSTEM "../tests/ajcTestSuite.dtd"[]> + +<suite> + + <ajc-test dir="bugs195/333274" vm="1.8" title="around finally blocks and unlinking"> + <compile files="Code.java" options="-showWeaveInfo -1.8 -XnoInline"> + <message kind="weave" text="Join point 'method-call(void Code.print2(java.lang.String))' in Type 'Code' (Code.java:15) advised by around advice from 'Azpect' (Code.java:35)"/> + <message kind="weave" text="Join point 'method-call(void Code.print2(java.lang.String))' in Type 'Code' (Code.java:15) advised by around advice from 'Azpect' (Code.java:31)"/> + </compile> + + <run class="Code"> + <stdout> + <line text="abc"/> + <line text="Caught java.lang.IllegalStateException"/> + </stdout> + </run> + </ajc-test> + +</suite> |