aboutsummaryrefslogtreecommitdiffstats
path: root/tests/src
diff options
context:
space:
mode:
authorAlexander Kriegisch <Alexander@Kriegisch.name>2023-03-28 16:29:12 +0200
committerAlexander Kriegisch <Alexander@Kriegisch.name>2023-06-24 13:10:46 +0700
commitec5e94cc188bfb54ff96b8312548176c3c02c80a (patch)
treeaf12ceda7b843e4dcef2d6585a5f326252027134 /tests/src
parentfbc79b2de7d6742883d41d7a8c91268bd1da3f55 (diff)
downloadaspectj-ec5e94cc188bfb54ff96b8312548176c3c02c80a.tar.gz
aspectj-ec5e94cc188bfb54ff96b8312548176c3c02c80a.zip
Add basic tests for Java 20, deactivate Java 19 preview tests
Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
Diffstat (limited to 'tests/src')
-rw-r--r--tests/src/test/java/org/aspectj/systemtest/ajc1919/AllTestsAspectJ1919.java3
-rw-r--r--tests/src/test/java/org/aspectj/systemtest/ajc1920/Ajc1920TestsJava.java32
-rw-r--r--tests/src/test/java/org/aspectj/systemtest/ajc1920/AllTestsAspectJ1920.java33
-rw-r--r--tests/src/test/java/org/aspectj/systemtest/ajc1920/Bugs1920Tests.java31
-rw-r--r--tests/src/test/java/org/aspectj/systemtest/ajc1920/Java20PreviewFeaturesTests.java103
-rw-r--r--tests/src/test/java/org/aspectj/systemtest/ajc1920/SanityTestsJava20.java87
-rw-r--r--tests/src/test/resources/org/aspectj/systemtest/ajc1920/ajc1920.xml179
-rw-r--r--tests/src/test/resources/org/aspectj/systemtest/ajc1920/sanity-tests-20.xml70
8 files changed, 537 insertions, 1 deletions
diff --git a/tests/src/test/java/org/aspectj/systemtest/ajc1919/AllTestsAspectJ1919.java b/tests/src/test/java/org/aspectj/systemtest/ajc1919/AllTestsAspectJ1919.java
index da1a81f97..e7b67db7b 100644
--- a/tests/src/test/java/org/aspectj/systemtest/ajc1919/AllTestsAspectJ1919.java
+++ b/tests/src/test/java/org/aspectj/systemtest/ajc1919/AllTestsAspectJ1919.java
@@ -24,10 +24,11 @@ public class AllTestsAspectJ1919 {
suite.addTest(Ajc1919TestsJava.suite());
}
// Do not run tests using a previous compiler's preview features anymore. They would all fail.
- // TODO: Comment out the following block when upgrading JDT Core to Java 20
+ /*
if (LangUtil.is19VMOrGreater() && !LangUtil.is20VMOrGreater()) {
suite.addTest(Java19PreviewFeaturesTests.suite());
}
+ */
return suite;
}
}
diff --git a/tests/src/test/java/org/aspectj/systemtest/ajc1920/Ajc1920TestsJava.java b/tests/src/test/java/org/aspectj/systemtest/ajc1920/Ajc1920TestsJava.java
new file mode 100644
index 000000000..cc2770412
--- /dev/null
+++ b/tests/src/test/java/org/aspectj/systemtest/ajc1920/Ajc1920TestsJava.java
@@ -0,0 +1,32 @@
+/*******************************************************************************
+ * Copyright (c) 2022 Contributors
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v 2.0
+ * which accompanies this distribution, and is available at
+ * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt
+ *******************************************************************************/
+package org.aspectj.systemtest.ajc1920;
+
+import junit.framework.Test;
+import org.aspectj.testing.XMLBasedAjcTestCase;
+import org.aspectj.testing.XMLBasedAjcTestCaseForJava20OrLater;
+
+/**
+ * @author Alexander Kriegisch
+ */
+public class Ajc1920TestsJava extends XMLBasedAjcTestCaseForJava20OrLater {
+
+ public void testDummyJava20() {
+ //runTest("dummy Java 20");
+ }
+
+ public static Test suite() {
+ return XMLBasedAjcTestCase.loadSuite(Ajc1920TestsJava.class);
+ }
+
+ @Override
+ protected java.net.URL getSpecFile() {
+ return getClassResource("ajc1920.xml");
+ }
+
+}
diff --git a/tests/src/test/java/org/aspectj/systemtest/ajc1920/AllTestsAspectJ1920.java b/tests/src/test/java/org/aspectj/systemtest/ajc1920/AllTestsAspectJ1920.java
new file mode 100644
index 000000000..c7962c2db
--- /dev/null
+++ b/tests/src/test/java/org/aspectj/systemtest/ajc1920/AllTestsAspectJ1920.java
@@ -0,0 +1,33 @@
+/*******************************************************************************
+ * Copyright (c) 2022 Contributors
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v 2.0
+ * which accompanies this distribution, and is available at
+ * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt
+ *******************************************************************************/
+package org.aspectj.systemtest.ajc1920;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+import org.aspectj.util.LangUtil;
+
+/**
+ * @author Alexander Kriegisch
+ */
+public class AllTestsAspectJ1920 {
+
+ public static Test suite() {
+ TestSuite suite = new TestSuite("AspectJ 1.9.20 tests");
+ suite.addTest(Bugs1920Tests.suite());
+ if (LangUtil.is20VMOrGreater()) {
+ suite.addTest(SanityTestsJava20.suite());
+ suite.addTest(Ajc1920TestsJava.suite());
+ }
+ // Do not run tests using a previous compiler's preview features anymore. They would all fail.
+ // TODO: Comment out the following block when upgrading JDT Core to Java 20
+ if (LangUtil.is20VMOrGreater() && !LangUtil.is21VMOrGreater()) {
+ suite.addTest(Java20PreviewFeaturesTests.suite());
+ }
+ return suite;
+ }
+}
diff --git a/tests/src/test/java/org/aspectj/systemtest/ajc1920/Bugs1920Tests.java b/tests/src/test/java/org/aspectj/systemtest/ajc1920/Bugs1920Tests.java
new file mode 100644
index 000000000..fca9fee20
--- /dev/null
+++ b/tests/src/test/java/org/aspectj/systemtest/ajc1920/Bugs1920Tests.java
@@ -0,0 +1,31 @@
+/*******************************************************************************
+ * Copyright (c) 2022 Contributors
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v 2.0
+ * which accompanies this distribution, and is available at
+ * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt
+ *******************************************************************************/
+package org.aspectj.systemtest.ajc1920;
+
+import junit.framework.Test;
+import org.aspectj.testing.XMLBasedAjcTestCase;
+
+/**
+ * @author Alexander Kriegisch
+ */
+public class Bugs1920Tests extends XMLBasedAjcTestCase {
+
+ public void testDummyJava20() {
+ //runTest("dummy Java 20");
+ }
+
+ public static Test suite() {
+ return XMLBasedAjcTestCase.loadSuite(Bugs1920Tests.class);
+ }
+
+ @Override
+ protected java.net.URL getSpecFile() {
+ return getClassResource("ajc1920.xml");
+ }
+
+}
diff --git a/tests/src/test/java/org/aspectj/systemtest/ajc1920/Java20PreviewFeaturesTests.java b/tests/src/test/java/org/aspectj/systemtest/ajc1920/Java20PreviewFeaturesTests.java
new file mode 100644
index 000000000..e597b32ec
--- /dev/null
+++ b/tests/src/test/java/org/aspectj/systemtest/ajc1920/Java20PreviewFeaturesTests.java
@@ -0,0 +1,103 @@
+/*******************************************************************************
+ * Copyright (c) 2022 Contributors
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v 2.0
+ * which accompanies this distribution, and is available at
+ * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt
+ *******************************************************************************/
+package org.aspectj.systemtest.ajc1920;
+
+import junit.framework.Test;
+import org.aspectj.apache.bcel.Constants;
+import org.aspectj.testing.XMLBasedAjcTestCase;
+import org.aspectj.testing.XMLBasedAjcTestCaseForJava20Only;
+
+/**
+ * @author Alexander Kriegisch
+ */
+public class Java20PreviewFeaturesTests extends XMLBasedAjcTestCaseForJava20Only {
+
+ public void testSwitchPatternMatchingPreview4Java() {
+ runTest("switch pattern matching preview 4 java");
+ checkVersion("SwitchPatternPreview4OK", Constants.MAJOR_20, Constants.PREVIEW_MINOR_VERSION);
+ }
+
+ public void testSwitchPatternMatchingPreview4Error() {
+ runTest("switch pattern matching preview 4 error");
+ }
+
+ public void testSwitchPatternMatchingPreview3Aspect() {
+ runTest("switch pattern matching preview 3 aspect");
+ checkVersion("SwitchPatternPreview3Aspect", Constants.MAJOR_20, Constants.PREVIEW_MINOR_VERSION);
+ checkVersion("Application", Constants.MAJOR_20, Constants.PREVIEW_MINOR_VERSION);
+ checkVersion("Shape", Constants.MAJOR_20, Constants.PREVIEW_MINOR_VERSION);
+ checkVersion("S", Constants.MAJOR_20, Constants.PREVIEW_MINOR_VERSION);
+ }
+
+ public void testSwitchPatternMatchingCaseLabelDominatedByPrecedingError() {
+ runTest("switch pattern matching error");
+ }
+
+ public void testSwitchPatternMatchingPreview3Error1() {
+ runTest("switch pattern matching preview 3 error 1");
+ }
+
+ public void testSwitchPatternMatchingPreview3Error2() {
+ runTest("switch pattern matching preview 3 error 2");
+ }
+
+ public void testRecordPatternsPreview1OK() {
+ // https://github.com/eclipse-jdt/eclipse.jdt.core/issues/450
+ runTest("record patterns");
+ }
+
+ public void testRecordPatternsPreview1Error() {
+ // https://github.com/eclipse-jdt/eclipse.jdt.core/issues/450 (fixed for preview 2 in Eclipse 2033-03, 4.27)
+ runTest("record patterns error");
+ checkVersion("RecordPatternsPreview1Error", Constants.MAJOR_20, Constants.PREVIEW_MINOR_VERSION);
+ checkVersion("Box", Constants.MAJOR_20, Constants.PREVIEW_MINOR_VERSION);
+ }
+
+ public void testRecordPatternsPreview1ExhaustivenessOK1() {
+ // Falsely throws 'An enhanced switch statement should be exhaustive; a default label expected' twice,
+ // see https://github.com/eclipse-jdt/eclipse.jdt.core/issues/455
+ // TODO: Remove redundant default clauses when fixed upstream
+ System.out.println("TODO: fully activate when https://github.com/eclipse-jdt/eclipse.jdt.core/issues/455 has been fixed");
+ runTest("record patterns exhaustiveness 1");
+ }
+
+ public void testRecordPatternsPreview1Aspect() {
+ runTest("record patterns aspect");
+ }
+
+ public void testRecordPatternsPreview1ExhaustivenessAspect() {
+ // Falsely throws 'An enhanced switch statement should be exhaustive; a default label expected' twice,
+ // see https://github.com/eclipse-jdt/eclipse.jdt.core/issues/455
+ // TODO: Remove redundant default clauses when fixed upstream
+ System.out.println("TODO: fully activate when https://github.com/eclipse-jdt/eclipse.jdt.core/issues/455 has been fixed");
+ runTest("record patterns exhaustiveness aspect");
+ }
+
+ public void testRecordPatternsPreview1ExhaustivenessError() {
+ // See https://github.com/eclipse-jdt/eclipse.jdt.core/issues/455
+ runTest("record patterns exhaustiveness error");
+ }
+
+ public void testRecordPatternsPreview1ExhaustivenessOK2() {
+ // Falsely throws 'An enhanced switch statement should be exhaustive; a default label expected',
+ // see https://github.com/eclipse-jdt/eclipse.jdt.core/issues/398
+ // TODO: activate when fixed
+ System.out.println("TODO: activate when https://github.com/eclipse-jdt/eclipse.jdt.core/issues/398 has been fixed");
+ //runTest("record patterns exhaustiveness 2");
+ }
+
+ public static Test suite() {
+ return XMLBasedAjcTestCase.loadSuite(Java20PreviewFeaturesTests.class);
+ }
+
+ @Override
+ protected java.net.URL getSpecFile() {
+ return getClassResource("ajc1920.xml");
+ }
+
+}
diff --git a/tests/src/test/java/org/aspectj/systemtest/ajc1920/SanityTestsJava20.java b/tests/src/test/java/org/aspectj/systemtest/ajc1920/SanityTestsJava20.java
new file mode 100644
index 000000000..09f52c1b7
--- /dev/null
+++ b/tests/src/test/java/org/aspectj/systemtest/ajc1920/SanityTestsJava20.java
@@ -0,0 +1,87 @@
+/*******************************************************************************
+ * Copyright (c) 2022 Contributors
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v 2.0
+ * which accompanies this distribution, and is available at
+ * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt
+ *******************************************************************************/
+package org.aspectj.systemtest.ajc1920;
+
+import junit.framework.Test;
+import org.aspectj.testing.XMLBasedAjcTestCase;
+import org.aspectj.testing.XMLBasedAjcTestCaseForJava20OrLater;
+
+/*
+ * 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 -20 option
+ * to check code generation and modification with that version specified.
+ *
+ * @author Alexander Kriegisch
+ */
+public class SanityTestsJava20 extends XMLBasedAjcTestCaseForJava20OrLater {
+
+ public static final int bytecode_version_for_JDK_level = 64;
+
+ // 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() {
+ runTest("simple - j");
+ checkVersion("A", bytecode_version_for_JDK_level, 0);
+ }
+
+ public void testVersionCorrect2() {
+ runTest("simple - k");
+ checkVersion("A", bytecode_version_for_JDK_level, 0);
+ }
+
+ public void testVersionCorrect4() {
+ runTest("simple - m");
+ // Must be 49.0 when -1.5 is specified
+ checkVersion("A", 49, 0);
+ }
+
+ public static Test suite() {
+ return XMLBasedAjcTestCase.loadSuite(SanityTestsJava20.class);
+ }
+
+ @Override
+ protected java.net.URL getSpecFile() {
+ return getClassResource("sanity-tests-20.xml");
+ }
+
+}
diff --git a/tests/src/test/resources/org/aspectj/systemtest/ajc1920/ajc1920.xml b/tests/src/test/resources/org/aspectj/systemtest/ajc1920/ajc1920.xml
new file mode 100644
index 000000000..4d2df9f39
--- /dev/null
+++ b/tests/src/test/resources/org/aspectj/systemtest/ajc1920/ajc1920.xml
@@ -0,0 +1,179 @@
+<!DOCTYPE suite SYSTEM "../tests/ajcTestSuite.dtd"[]>
+
+<!--
+ Java 20: no new final language features, only preview/incubator ones:
+ - "JEP 432: Record Patterns (Second Preview)" (###)
+ - "JEP 433: Pattern Matching for switch (Fourth Preview)" (###)
+ - "JEP 429: Scoped Values (Incubator)" (API only)
+ - "JEP 436: Virtual Threads (Second Preview)" (API only)
+ - "JEP 437: Structured Concurrency (Second Incubator)" (API only)
+-->
+<suite>
+
+ <!-- Java ?? final, Java 17, 18, 19, 20 preview -->
+ <ajc-test dir="features1920/java20" vm="20" title="switch pattern matching preview 4 java">
+ <compile files="SwitchPatternPreview4OK.java" options="--enable-preview -20" />
+ <run class="SwitchPatternPreview4OK" vmargs="--enable-preview">
+ <message></message>
+ <stdout>
+ <line text="null" />
+ <line text="int 123" />
+ <line text="long 999" />
+ <line text="double 12.340000" />
+ <line text="String foo" />
+ <line text="[123, foo, 999, 12.34]" />
+ <line text="Non-circle" />
+ <line text="Small circle" />
+ <line text="Large circle" />
+ <line text="Sealed sub-class A" />
+ <line text="Sealed sub-class B" />
+ <line text="Sealed sub-record C" />
+ <line text="absolute value 1: -1" />
+ <line text="other integer: 0" />
+ <line text="positive integer: 42" />
+ <line text="other integer: -99" />
+ <line text="positive integer: 123" />
+ <line text="value unavailable: null" />
+ </stdout>
+ </run>
+ </ajc-test>
+
+ <!-- Java ?? final, Java 17, 18, 19, 20 preview -->
+ <ajc-test dir="features1920/java20" vm="20" title="switch pattern matching preview 4 error">
+ <compile files="SwitchPatternPreview4Error.java" options="--enable-preview -20">
+ <!-- TODO: Add correct compiler error message, as soon as JDT Core supports it -->
+ <message kind="error" file="SwitchPatternPreview4Error.java" text="This case label is dominated by one of the preceding case label"/>
+ </compile>
+ </ajc-test>
+
+ <!-- Java ?? final, Java 17, 18, 19, 20 preview -->
+ <ajc-test dir="features1919/java19" vm="20" title="switch pattern matching preview 3 aspect">
+ <compile files="SwitchPatternPreview3Aspect.aj" options="--enable-preview -20" />
+ <run class="Application" vmargs="--enable-preview">
+ <stdout>
+ <line text="null" />
+ <line text="int 123" />
+ <line text="long 999" />
+ <line text="double 12.340000" />
+ <line text="String foo" />
+ <line text="[123, foo, 999, 12.34]" />
+ <line text="Non-circle" />
+ <line text="Small circle" />
+ <line text="Large circle" />
+ <line text="Sealed sub-class A" />
+ <line text="Sealed sub-class B" />
+ <line text="Sealed sub-record C" />
+ <line text="absolute value 1: -1" />
+ <line text="other integer: 0" />
+ <line text="positive integer: 42" />
+ <line text="other integer: -99" />
+ <line text="positive integer: 123" />
+ <line text="value unavailable: null" />
+ </stdout>
+ </run>
+ </ajc-test>
+
+ <!-- Java ?? final, Java 17, 18, 19, 20 preview -->
+ <ajc-test dir="features198/java17" vm="20" title="switch pattern matching error">
+ <compile files="SwitchPatternError.java" options="--enable-preview -20">
+ <!-- TODO: Add correct compiler error message, as soon as JDT Core supports it -->
+ <message kind="error" file="SwitchPatternError.java" text="This case label is dominated by one of the preceding case label"/>
+ </compile>
+ </ajc-test>
+
+ <!-- Java ?? final, Java 17, 18, 19, 20 preview -->
+ <ajc-test dir="features1919/java19" vm="20" title="switch pattern matching preview 3 error 1">
+ <compile files="SwitchPatternPreview3Error1.java" options="--enable-preview -20">
+ <!-- TODO: Add correct compiler error message, as soon as JDT Core supports it -->
+ <message kind="error" file="SwitchPatternPreview3Error1.java" text="This case label is dominated by one of the preceding case label"/>
+ </compile>
+ </ajc-test>
+
+ <!-- Java ?? final, Java 17, 18, 19, 20 preview -->
+ <ajc-test dir="features1919/java19" vm="20" title="switch pattern matching preview 3 error 2">
+ <compile files="SwitchPatternPreview3Error2.java" options="--enable-preview -20">
+ <!-- TODO: Add correct compiler error message, as soon as JDT Core supports it -->
+ <message kind="error" file="SwitchPatternPreview3Error2.java" text="This case label is dominated by one of the preceding case label"/>
+ </compile>
+ </ajc-test>
+
+ <!-- Java ?? final, Java 19, 20 preview -->
+ <ajc-test dir="features1919/java19" vm="20" title="record patterns">
+ <compile files="RecordPatternsPreview1OK.java" options="--enable-preview -20"/>
+ </ajc-test>
+
+ <!-- Java ?? final, Java 19, 20 preview -->
+ <ajc-test dir="features1919/java19" vm="20" title="record patterns error">
+ <compile files="RecordPatternsPreview1Error.java" options="--enable-preview -20">
+ <!-- https://github.com/eclipse-jdt/eclipse.jdt.core/issues/450 (fixed for preview 2 in Eclipse 2033-03, 4.27) -->
+ <!--
+ <message kind="error" file="RecordPatternsPreview1Error.java" text="Raw types are not allowed in record patterns"/>
+ <message kind="error" file="RecordPatternsPreview1Error.java" text="Raw types are not allowed in record patterns"/>
+ -->
+ </compile>
+ <run class="RecordPatternsPreview1Error" vmargs="--enable-preview">
+ <stdout>
+ <line text="I'm a box"/>
+ <line text="I'm a box"/>
+ </stdout>
+ </run>
+ </ajc-test>
+
+ <!-- Java ?? final, Java 19, 20 preview -->
+ <ajc-test dir="features1919/java19" vm="20" title="record patterns exhaustiveness 1">
+ <compile files="RecordPatternsPreview1ExhaustivenessOK1.java" options="--enable-preview -20"/>
+ <run class="RecordPatternsPreview1ExhaustivenessOK1" vmargs="--enable-preview">
+ <stdout>
+ <line text="y"/>
+ <line text="a"/>
+ </stdout>
+ </run>
+ </ajc-test>
+
+ <!-- Java ?? final, Java 19, 20 preview -->
+ <ajc-test dir="features1919/java19" vm="20" title="record patterns exhaustiveness aspect">
+ <compile files="RecordPatternsPreview1ExhaustivenessAspect.aj" options="--enable-preview -20"/>
+ <!-- TODO: Remove redundant default clauses when https://github.com/eclipse-jdt/eclipse.jdt.core/issues/455 has been fixed -->
+ <run class="RecordPatternsPreview1ExhaustivenessAspect" vmargs="--enable-preview">
+ <stdout>
+ <line text="y"/>
+ <line text="a"/>
+ <line text="Pair[x=C@000, y=D@000]"/>
+ </stdout>
+ </run>
+ </ajc-test>
+
+ <!-- Java ?? final, Java 19, 20 preview -->
+ <ajc-test dir="features1919/java19" vm="20" title="record patterns aspect">
+ <compile files="RecordPatternsPreview1Aspect.aj" options="--enable-preview -20"/>
+ <run class="RecordPatternsPreview1Aspect" vmargs="--enable-preview">
+ <stdout>
+ <line text="9"/>
+ <line text="14"/>
+ <line text="Doing something with Point[x=2, y=7]"/>
+ <line text="Upper-left color: RED"/>
+ <line text="Upper-left color: RED"/>
+ <line text="Upper-left x coordinate: 1"/>
+ <line text="Doing something with Rectangle[upperLeft=ColoredPoint[p=Point[x=1, y=6], c=RED], lowerRight=ColoredPoint[p=Point[x=4, y=6], c=BLUE]]"/>
+ </stdout>
+ </run>
+ </ajc-test>
+
+ <!-- Java ?? final, Java 19, 20 preview -->
+ <ajc-test dir="features1919/java19" vm="20" title="record patterns exhaustiveness error">
+ <compile files="RecordPatternsPreview1ExhaustivenessError.java" options="--enable-preview -20">
+ <message kind="error" file="RecordPatternsPreview1ExhaustivenessError.java" text="An enhanced switch statement should be exhaustive; a default label expected"/>
+ </compile>
+ </ajc-test>
+
+ <!-- Java ?? final, Java 19, 20 preview -->
+ <ajc-test dir="features1919/java19" vm="20" title="record patterns exhaustiveness 2">
+ <compile files="RecordPatternsPreview1ExhaustivenessOK2.java" options="--enable-preview -20"/>
+ <run class="RecordPatternsPreview1ExhaustivenessOK2" vmargs="--enable-preview">
+ <stdout>
+ <line text="Bob 12"/>
+ </stdout>
+ </run>
+ </ajc-test>
+
+</suite>
diff --git a/tests/src/test/resources/org/aspectj/systemtest/ajc1920/sanity-tests-20.xml b/tests/src/test/resources/org/aspectj/systemtest/ajc1920/sanity-tests-20.xml
new file mode 100644
index 000000000..1c6d8d870
--- /dev/null
+++ b/tests/src/test/resources/org/aspectj/systemtest/ajc1920/sanity-tests-20.xml
@@ -0,0 +1,70 @@
+<!DOCTYPE suite SYSTEM "../tests/ajcTestSuite.dtd"[]>
+
+<suite>
+
+ <!-- empty class -->
+ <ajc-test dir="bugs160/simplejava" title="simple - a">
+ <compile files="SimpleA.java" options="-20"/>
+ </ajc-test>
+
+ <!-- class with one method -->
+ <ajc-test dir="bugs160/simplejava" title="simple - b">
+ <compile files="SimpleB.java" options="-20"/>
+ <run class="SimpleB"/>
+ </ajc-test>
+
+ <!-- empty aspect -->
+ <ajc-test dir="bugs160/simplejava" title="simple - c">
+ <compile files="SimpleC.java" options="-20"/>
+ </ajc-test>
+
+ <!-- simple before -->
+ <ajc-test dir="bugs160/simplejava" title="simple - d">
+ <compile files="SimpleD.java" options="-20"/>
+ </ajc-test>
+
+ <!-- simple itd field -->
+ <ajc-test dir="bugs160/simplejava" title="simple - e">
+ <compile files="SimpleE.java" options="-20"/>
+ </ajc-test>
+
+ <!-- aspect with main calling a static method -->
+ <ajc-test dir="bugs160/simplejava" title="simple - f">
+ <compile files="SimpleF.java" options="-20"/>
+ </ajc-test>
+
+ <!-- pertarget -->
+ <ajc-test dir="bugs160/simplejava" title="simple - g">
+ <compile files="SimpleG.java" options="-20"/>
+ </ajc-test>
+
+ <!-- generic ctor itds -->
+ <ajc-test dir="bugs160/simplejava" title="simple - h">
+ <compile files="SimpleH.java" options="-20"/>
+ </ajc-test>
+
+ <!-- overriding generic itd methods -->
+ <ajc-test dir="bugs160/simplejava" title="simple - i">
+ <compile files="SimpleI.java" options="-20"/>
+ </ajc-test>
+
+ <!-- check class file version is 64.0 (Java 20) -->
+ <ajc-test dir="bugs160/simplejava" title="simple - j">
+ <compile files="SimpleJ.java" options="-20"/>
+ </ajc-test>
+
+ <!-- check class file version is 64.0 (Java 20) -->
+ <ajc-test dir="bugs160/simplejava" title="simple - k">
+ <compile files="SimpleJ.java" options="-source 20"/>
+ </ajc-test>
+
+ <!-- check class file version is 49.0 -->
+ <ajc-test dir="bugs160/simplejava" title="simple - m">
+ <compile files="SimpleJ.java" options="-1.5"/>
+ </ajc-test>
+
+ <ajc-test dir="bugs160/simplejava" title="simple - n">
+ <compile files="SimpleN.java" options="-20"/>
+ </ajc-test>
+
+</suite>