diff options
author | Alexander Kriegisch <Alexander@Kriegisch.name> | 2021-07-28 10:55:02 +0700 |
---|---|---|
committer | Alexander Kriegisch <Alexander@Kriegisch.name> | 2021-09-07 08:44:33 +0200 |
commit | 620add3a3c18dc3e126a03254b6482ad9ab7ef36 (patch) | |
tree | 5a43d8a1db333183ac9e335772088e3c922e35de /tests/src/test/resources | |
parent | c80551f1d36e288b4b3be658e70c0560b7e04c9e (diff) | |
download | aspectj-620add3a3c18dc3e126a03254b6482ad9ab7ef36.tar.gz aspectj-620add3a3c18dc3e126a03254b6482ad9ab7ef36.zip |
Add + activate some Java 17 tests
- Fix one fault sanity test configuration
- Deactivate Java 16 preview tests (no longer supported by Java 17
compiler)
- Test sealed classes as final on Java 17 (no longer preview)
- Add tests for JEP 406, pattern matching for switch (preview). At
present, the beta 17 branch of JDT Core does not handle the tested
features and expected compile errors correctly yet, so I had to
temporarily deactivate test execution, only printing TODO messages.
Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
Diffstat (limited to 'tests/src/test/resources')
-rw-r--r-- | tests/src/test/resources/org/aspectj/systemtest/ajc198/ajc198.xml | 70 | ||||
-rw-r--r-- | tests/src/test/resources/org/aspectj/systemtest/ajc198/sanity-tests-17.xml | 6 |
2 files changed, 60 insertions, 16 deletions
diff --git a/tests/src/test/resources/org/aspectj/systemtest/ajc198/ajc198.xml b/tests/src/test/resources/org/aspectj/systemtest/ajc198/ajc198.xml index 06ca7d048..a0c26d098 100644 --- a/tests/src/test/resources/org/aspectj/systemtest/ajc198/ajc198.xml +++ b/tests/src/test/resources/org/aspectj/systemtest/ajc198/ajc198.xml @@ -3,34 +3,78 @@ <suite> - <!-- Java ?? final, Java 16, 15 preview --> -<!-- + <!-- Java 17 final, Java 16, 15 preview --> <ajc-test dir="features197/java15" vm="17" title="sealed class with legal subclasses"> - <compile files="Person.java Employee.java Manager.java" options="--enable-preview -16" /> + <compile files="Person.java Employee.java Manager.java" options="-17" /> </ajc-test> ---> - <!-- Java ?? final, Java 16, 15 preview --> -<!-- + <!-- Java 17 final, Java 16, 15 preview --> <ajc-test dir="features197/java15" vm="17" title="sealed class with illegal subclass"> - <compile files="Person.java Employee.java Manager.java PersonaNonGrata.java" options="--enable-preview -16"> + <compile files="Person.java Employee.java Manager.java PersonaNonGrata.java" options="-17"> <message kind="error" file="PersonaNonGrata.java" text="should be a permitted subtype of Person"/> </compile> </ajc-test> ---> - <!-- Java ?? final, Java 16, 15 preview --> -<!-- + <!-- Java 17 final, Java 16, 15 preview --> <ajc-test dir="features197/java15" vm="17" title="weave sealed class"> - <compile files="Person.java Employee.java Manager.java TopManager.java PersonAspect.aj" options="--enable-preview -16" /> - <run class="TopManager" vmargs="--enable-preview"> + <compile files="Person.java Employee.java Manager.java TopManager.java PersonAspect.aj" options="-17" /> + <run class="TopManager"> <stdout> <line text="Hello Sir John" /> <line text="CEO" /> </stdout> </run> </ajc-test> ---> + + <!-- Java ?? final, Java 17 preview --> + <ajc-test dir="features198/java17" vm="17" title="switch pattern matching error"> + <compile files="SwitchPatternError.java" options="--enable-preview -17"> + <!-- TODO: Add correct compiler error message, as soon as JDT Core supports it --> + <message kind="error" file="SwitchPatternError.java" text="XXX"/> + </compile> + </ajc-test> + + <!-- Java ?? final, Java 17 preview --> + <ajc-test dir="features198/java17" vm="17" title="switch pattern matching java"> + <compile files="SwitchPatternOK.java" options="--enable-preview -17" /> + <run class="SwitchPatternOK" 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" /> + </stdout> + </run> + </ajc-test> + + <!-- Java ?? final, Java 17 preview --> + <ajc-test dir="features198/java17" vm="17" title="switch pattern matching aspect"> + <compile files="SwitchPatternAspect.aj" options="--enable-preview -17" /> + <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" /> + </stdout> + </run> + </ajc-test> <!-- Javac/ECJ 9+ compiler option, but belated implementation in AJC 1.9.7 --> <ajc-test dir="features198/compiler_release" vm="9" title="compile to older JDK release"> diff --git a/tests/src/test/resources/org/aspectj/systemtest/ajc198/sanity-tests-17.xml b/tests/src/test/resources/org/aspectj/systemtest/ajc198/sanity-tests-17.xml index 70f52fafa..adb339a41 100644 --- a/tests/src/test/resources/org/aspectj/systemtest/ajc198/sanity-tests-17.xml +++ b/tests/src/test/resources/org/aspectj/systemtest/ajc198/sanity-tests-17.xml @@ -48,14 +48,14 @@ <compile files="SimpleI.java" options="-17"/> </ajc-test> - <!-- check class file version is 60.0 (Java 16) --> + <!-- check class file version is 61.0 (Java 17) --> <ajc-test dir="bugs160/simplejava" title="simple - j"> <compile files="SimpleJ.java" options="-17"/> </ajc-test> - <!-- check class file version is 60.0 (Java 16) --> + <!-- check class file version is 61.0 (Java 17) --> <ajc-test dir="bugs160/simplejava" title="simple - k"> - <compile files="SimpleJ.java" options="-source 16"/> + <compile files="SimpleJ.java" options="-source 17"/> </ajc-test> <!-- check class file version is 49.0 --> |