aboutsummaryrefslogtreecommitdiffstats
path: root/tests/src
diff options
context:
space:
mode:
authorAlexander Kriegisch <Alexander@Kriegisch.name>2022-03-24 15:16:29 +0700
committerAlexander Kriegisch <Alexander@Kriegisch.name>2022-03-24 15:16:29 +0700
commit50190a1918e66769e0037542054645add1ff8204 (patch)
treec58ab2b90dc44f8aa90b0ad78eb86de141471bd0 /tests/src
parent6403cc20326190dbc9646b0f9b1819f1bb47fc39 (diff)
downloadaspectj-50190a1918e66769e0037542054645add1ff8204.tar.gz
aspectj-50190a1918e66769e0037542054645add1ff8204.zip
Upgrade to latest JDT Core Java 18 changes, activate J18 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/ajc199/Java18PreviewFeaturesTests.java20
-rw-r--r--tests/src/test/resources/org/aspectj/systemtest/ajc199/ajc199.xml33
2 files changed, 37 insertions, 16 deletions
diff --git a/tests/src/test/java/org/aspectj/systemtest/ajc199/Java18PreviewFeaturesTests.java b/tests/src/test/java/org/aspectj/systemtest/ajc199/Java18PreviewFeaturesTests.java
index 8d586b440..dbe6f733a 100644
--- a/tests/src/test/java/org/aspectj/systemtest/ajc199/Java18PreviewFeaturesTests.java
+++ b/tests/src/test/java/org/aspectj/systemtest/ajc199/Java18PreviewFeaturesTests.java
@@ -34,28 +34,24 @@ public class Java18PreviewFeaturesTests extends XMLBasedAjcTestCaseForJava18Only
checkVersion("S", Constants.MAJOR_18, Constants.PREVIEW_MINOR_VERSION);
}
- // TODO:
- // JDT Core does not seem to have implemented JEP 420 yet,
- // see https://bugs.eclipse.org/bugs/show_bug.cgi?id=576746.
- // Therefore, deactivate the special tests for now.
-/*
- public void testSwitchPatternMatchingPreview2Error() {
- runTest("switch pattern matching preview 2 error");
+ public void testSwitchPatternMatchingPreview2Error1() {
+ runTest("switch pattern matching preview 2 error 1");
+ }
+
+ public void testSwitchPatternMatchingPreview2Error2() {
+ runTest("switch pattern matching preview 2 error 2");
}
public void testSwitchPatternMatchingPreview2Java() {
runTest("switch pattern matching preview 2 java");
- checkVersion("SwitchPatternOK", Constants.MAJOR_18, Constants.PREVIEW_MINOR_VERSION);
+ checkVersion("SwitchPatternPreview2OK", Constants.MAJOR_18, Constants.PREVIEW_MINOR_VERSION);
}
public void testSwitchPatternMatchingPreview2Aspect() {
runTest("switch pattern matching preview 2 aspect");
- checkVersion("SwitchPatternAspect", Constants.MAJOR_18, Constants.PREVIEW_MINOR_VERSION);
+ checkVersion("SwitchPatternPreview2Aspect", Constants.MAJOR_18, Constants.PREVIEW_MINOR_VERSION);
checkVersion("Application", Constants.MAJOR_18, Constants.PREVIEW_MINOR_VERSION);
- checkVersion("Shape", Constants.MAJOR_18, Constants.PREVIEW_MINOR_VERSION);
- checkVersion("S", Constants.MAJOR_18, Constants.PREVIEW_MINOR_VERSION);
}
-*/
public static Test suite() {
return XMLBasedAjcTestCase.loadSuite(Java18PreviewFeaturesTests.class);
diff --git a/tests/src/test/resources/org/aspectj/systemtest/ajc199/ajc199.xml b/tests/src/test/resources/org/aspectj/systemtest/ajc199/ajc199.xml
index f0510e79a..7baeea086 100644
--- a/tests/src/test/resources/org/aspectj/systemtest/ajc199/ajc199.xml
+++ b/tests/src/test/resources/org/aspectj/systemtest/ajc199/ajc199.xml
@@ -58,18 +58,34 @@
</ajc-test>
<!-- Java ?? final, Java 17, 18 preview -->
- <ajc-test dir="features199/java18" vm="18" title="switch pattern matching preview 2 error">
- <compile files="SwitchPatternPreview2Error.java" options="--enable-preview -18">
+ <ajc-test dir="features199/java18" vm="18" title="switch pattern matching preview 2 error 1">
+ <compile files="SwitchPatternPreview2Error1.java" options="--enable-preview -18">
<!-- 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"/>
+ <message kind="error" file="SwitchPatternPreview2Error1.java" text="This case label is dominated by one of the preceding case label"/>
+ </compile>
+ </ajc-test>
+
+ <!-- Java ?? final, Java 17, 18 preview -->
+ <ajc-test dir="features199/java18" vm="18" title="switch pattern matching preview 2 error 2">
+ <compile files="SwitchPatternPreview2Error2.java" options="--enable-preview -18">
+ <!-- TODO: Add correct compiler error message, as soon as JDT Core supports it -->
+ <message kind="error" file="SwitchPatternPreview2Error2.java" text="This case label is dominated by one of the preceding case label"/>
</compile>
</ajc-test>
<!-- Java ?? final, Java 17, 18 preview -->
<ajc-test dir="features199/java18" vm="18" title="switch pattern matching preview 2 java">
<compile files="SwitchPatternPreview2OK.java" options="--enable-preview -18" />
- <run class="SwitchPatternOK" vmargs="--enable-preview">
+ <run class="SwitchPatternPreview2OK" vmargs="--enable-preview">
+ <message></message>
<stdout>
+ <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" />
+<!--
<line text="null" />
<line text="int 123" />
<line text="long 999" />
@@ -82,6 +98,7 @@
<line text="Sealed sub-class A" />
<line text="Sealed sub-class B" />
<line text="Sealed sub-record C" />
+-->
</stdout>
</run>
</ajc-test>
@@ -91,6 +108,13 @@
<compile files="SwitchPatternPreview2Aspect.aj" options="--enable-preview -18" />
<run class="Application" vmargs="--enable-preview">
<stdout>
+ <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" />
+<!--
<line text="null" />
<line text="int 123" />
<line text="long 999" />
@@ -103,6 +127,7 @@
<line text="Sealed sub-class A" />
<line text="Sealed sub-class B" />
<line text="Sealed sub-record C" />
+-->
</stdout>
</run>
</ajc-test>