Skip to content

Tests that requires preview features should only run if the preview features of the right JDK are enabled

Remi Forax requested to merge test-should-work-with-enable-preview into master

Test for jdk 14 and jdk 15 requires the "--enable-preview" on the command line. This patch

  • changes the tests to declare if a test requires --enable-preview or not and run them only if the flag is present on the command line
  • fix Util.getMajorJavaVersion() because Java 1.8.0 is detected as Java 1 and not Java 8
  • update bnd version because of https://github.com/bndtools/bnd/issues/3903

With that, using gradle 6.7.1, with the PMD conf updated and if jacoco release a version compatible with Java 15 (still stuck with Java 14), the build can run on Java 15. The ultimate goal is to prepare the build to be able to run on Java 17 which is a LTS and which should not have any preview feature that changes the classfile.

Edited by Remi Forax

Merge request reports