aboutsummaryrefslogtreecommitdiffstats
path: root/tests/src/test/resources/org/aspectj/systemtest/ajc1920/ajc1920.xml
diff options
context:
space:
mode:
Diffstat (limited to 'tests/src/test/resources/org/aspectj/systemtest/ajc1920/ajc1920.xml')
-rw-r--r--tests/src/test/resources/org/aspectj/systemtest/ajc1920/ajc1920.xml179
1 files changed, 179 insertions, 0 deletions
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>