From 2704db20ecca12d3bbe514a4f7b84d297937de86 Mon Sep 17 00:00:00 2001 From: Andy Clement Date: Mon, 25 Nov 2019 10:40:44 -0800 Subject: Java 13 support --- tests/pom.xml | 2 +- .../org/aspectj/systemtest/ajc193/Java12Tests.java | 10 +-- .../systemtest/ajc195/AllTestsAspectJ195.java | 1 + .../systemtest/ajc195/SanityTestsJava13.java | 89 ++++++++++++++++++++++ .../org/aspectj/systemtest/ajc193/ajc193.xml | 13 ++-- .../aspectj/systemtest/ajc195/sanity-tests-13.xml | 69 +++++++++++++++++ 6 files changed, 172 insertions(+), 12 deletions(-) create mode 100644 tests/src/test/java/org/aspectj/systemtest/ajc195/SanityTestsJava13.java create mode 100644 tests/src/test/resources/org/aspectj/systemtest/ajc195/sanity-tests-13.xml (limited to 'tests') diff --git a/tests/pom.xml b/tests/pom.xml index 7e65f2f0f..c91ffffe0 100644 --- a/tests/pom.xml +++ b/tests/pom.xml @@ -55,7 +55,7 @@ asm 1.0 system - ${project.basedir}/../lib/asm/asm-7.0-beta.renamed.jar + ${project.basedir}/../lib/asm/asm-7.2.renamed.jar org.aspectj diff --git a/tests/src/test/java/org/aspectj/systemtest/ajc193/Java12Tests.java b/tests/src/test/java/org/aspectj/systemtest/ajc193/Java12Tests.java index 72388ba68..9a36d3daf 100644 --- a/tests/src/test/java/org/aspectj/systemtest/ajc193/Java12Tests.java +++ b/tests/src/test/java/org/aspectj/systemtest/ajc193/Java12Tests.java @@ -5,7 +5,7 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html *******************************************************************************/ -package org.aspectj.systemtest.ajc193; +package org.aspectj.systemtest.ajc193; import org.aspectj.apache.bcel.Constants; import org.aspectj.testing.XMLBasedAjcTestCase; @@ -15,22 +15,22 @@ import junit.framework.Test; /** * @author Andy Clement - */ + */ public class Java12Tests extends XMLBasedAjcTestCaseForJava12OrLater { public void testSwitch1() { runTest("switch 1"); - checkVersion("Switch1", Constants.MAJOR_12, Constants.PREVIEW_MINOR_VERSION); + checkVersion("Switch1", Constants.MAJOR_13, Constants.PREVIEW_MINOR_VERSION); } public void testSwitch2() { runTest("switch 2"); - checkVersion("Switch2", Constants.MAJOR_12, Constants.PREVIEW_MINOR_VERSION); + checkVersion("Switch2", Constants.MAJOR_13, Constants.PREVIEW_MINOR_VERSION); } public void testSwitch3() { runTest("switch 3"); - checkVersion("Switch3", Constants.MAJOR_12, Constants.PREVIEW_MINOR_VERSION); + checkVersion("Switch3", Constants.MAJOR_13, Constants.PREVIEW_MINOR_VERSION); } // --- diff --git a/tests/src/test/java/org/aspectj/systemtest/ajc195/AllTestsAspectJ195.java b/tests/src/test/java/org/aspectj/systemtest/ajc195/AllTestsAspectJ195.java index a7eb6604e..8a714a606 100644 --- a/tests/src/test/java/org/aspectj/systemtest/ajc195/AllTestsAspectJ195.java +++ b/tests/src/test/java/org/aspectj/systemtest/ajc195/AllTestsAspectJ195.java @@ -18,6 +18,7 @@ public class AllTestsAspectJ195 { public static Test suite() { TestSuite suite = new TestSuite("AspectJ 1.9.4 tests"); suite.addTest(Ajc195Tests.suite()); + suite.addTest(SanityTestsJava13.suite()); return suite; } } diff --git a/tests/src/test/java/org/aspectj/systemtest/ajc195/SanityTestsJava13.java b/tests/src/test/java/org/aspectj/systemtest/ajc195/SanityTestsJava13.java new file mode 100644 index 000000000..89ac25e07 --- /dev/null +++ b/tests/src/test/java/org/aspectj/systemtest/ajc195/SanityTestsJava13.java @@ -0,0 +1,89 @@ +/******************************************************************************* + * Copyright (c) 2006, 2018 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 org.aspectj.testing.XMLBasedAjcTestCaseForJava13OrLater; + +import junit.framework.Test; + +/* + * Some very trivial tests that help verify things are OK. + * These are a copy of the earlier Sanity Tests created for 1.6 but these supply the -10 option + * to check code generation and modification with that version specified. + * + * @author Andy Clement + */ +public class SanityTestsJava13 extends XMLBasedAjcTestCaseForJava13OrLater { + + public static final int bytecode_version_for_JDK_level = 57; + + // Incredibly trivial test programs that check the compiler works at all (these are easy-ish to debug) + public void testSimpleJava_A() { + runTest("simple - a"); + } + + public void testSimpleJava_B() { + runTest("simple - b"); + } + + public void testSimpleCode_C() { + runTest("simple - c"); + } + + public void testSimpleCode_D() { + runTest("simple - d"); + } + + public void testSimpleCode_E() { + runTest("simple - e"); + } + + public void testSimpleCode_F() { + runTest("simple - f"); + } + + public void testSimpleCode_G() { + runTest("simple - g"); + } + + public void testSimpleCode_H() { + runTest("simple - h", true); + } + + public void testSimpleCode_I() { + runTest("simple - i"); + } + + public void testVersionCorrect1() throws ClassNotFoundException { + runTest("simple - j"); + checkVersion("A", bytecode_version_for_JDK_level, 0); + } + + public void testVersionCorrect2() throws ClassNotFoundException { + runTest("simple - k"); + checkVersion("A", bytecode_version_for_JDK_level, 0); + } + + public void testVersionCorrect4() throws ClassNotFoundException { // check it is 49.0 when -1.5 is specified + runTest("simple - m"); + checkVersion("A", 49, 0); + } + + + // /////////////////////////////////////// + public static Test suite() { + return XMLBasedAjcTestCase.loadSuite(SanityTestsJava13.class); + } + + @Override + protected java.net.URL getSpecFile() { + return getClassResource("sanity-tests-13.xml"); + } + +} diff --git a/tests/src/test/resources/org/aspectj/systemtest/ajc193/ajc193.xml b/tests/src/test/resources/org/aspectj/systemtest/ajc193/ajc193.xml index c13159c30..cea315f82 100644 --- a/tests/src/test/resources/org/aspectj/systemtest/ajc193/ajc193.xml +++ b/tests/src/test/resources/org/aspectj/systemtest/ajc193/ajc193.xml @@ -51,8 +51,9 @@ Method call - - + + + @@ -64,8 +65,8 @@ Method call - - + + @@ -77,8 +78,8 @@ Method call - - + + diff --git a/tests/src/test/resources/org/aspectj/systemtest/ajc195/sanity-tests-13.xml b/tests/src/test/resources/org/aspectj/systemtest/ajc195/sanity-tests-13.xml new file mode 100644 index 000000000..3a83e1108 --- /dev/null +++ b/tests/src/test/resources/org/aspectj/systemtest/ajc195/sanity-tests-13.xml @@ -0,0 +1,69 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -- cgit v1.2.3