Annotation Type JavacCompilerTest


@API(since="0.0.1", status=STABLE) @ArgumentsSource(JavacCompilersProvider.class) @DisabledInNativeImage @Documented @Inherited @ParameterizedTest(name="for compiler \"{0}\"") @Retention(RUNTIME) @Target({ANNOTATION_TYPE,METHOD,TYPE}) @TestTemplate @Tag("java-compiler-testing-test") @Tag("javac-test") public @interface JavacCompilerTest
Annotation that can be applied to a ParameterizedTest to enable passing in a range of JavacJctCompilerImpl instances with specific configured versions as the first parameter.

This will also add the "java-compiler-testing-test" tag and "javac-test" tags to your test method, meaning you can instruct your IDE or build system to optionally only run tests annotated with this method for development purposes. As an example, Maven Surefire could be instructed to only run these tests by passing -Dgroup="javac-test" to Maven.

If your build is running in a GraalVM Native Image, then this test will not execute, as the Java Compiler Testing API is not yet tested within Native Images.

Since:
0.0.1
Author:
Ashley Scopes
  • Element Details

    • minVersion

      Minimum version to use (inclusive).
      Returns:
      the minimum version.
      Default:
      -2147483648
    • maxVersion

      Maximum version to use (inclusive).
      Returns:
      the maximum version.
      Default:
      2147483647
    • configurers

      Get an array of compiler configurers to apply in-order before starting the test.

      Each configurer must have a public no-args constructor, and their package must be open to this module if JPMS modules are in-use.

      Returns:
      an array of classes to run to configure the compiler. These run in the given order.
      Default:
      {}
    • modules

      boolean modules
      Whether we need to support modules or not.

      Setting this to true will skip any versions of the compiler that do not support JPMS modules.

      Returns:
      true if we need to support modules, or false if we do not.
      Default:
      false
    • versionStrategy

      The version strategy to use.

      This determines whether the version number being iterated across specifies the release, source, target, or source and target versions.

      The default is to specify the release.

      Returns:
      the version strategy to use.
      Default:
      RELEASE