From 4c0fa630c72255adf6a800dbbaf76e2bb762cc8e Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Wed, 12 Jun 2024 08:59:07 +0200 Subject: [PATCH] Generate JRE enum and dependent tests and add JAVA_24 (#3855) * Generate code based on YaML file * Use Java Template Engine (JTE) * Add JRE.JAVA_24 --- .idea/codeStyles/Project.xml | 5 + .../release-notes-5.11.0-M3.adoc | 1 + .../code-generator-model/build.gradle.kts | 9 + .../kotlin/junitbuild/generator/model/JRE.kt | 3 + .../src/main/resources/jre.yaml | 30 +++ gradle/base/settings.gradle.kts | 3 + gradle/config/checkstyle/suppressions.xml | 2 + gradle/libs.versions.toml | 4 + .../plugins/code-generator/build.gradle.kts | 15 ++ .../junitbuild.code-generator.gradle.kts | 35 +++ .../generator/GenerateJreRelatedSourceCode.kt | 75 ++++++ .../java/PatchModuleArgumentProvider.kt | 9 +- gradle/plugins/settings.gradle.kts | 3 + .../junit-jupiter-api.gradle.kts | 1 + .../junit/jupiter/api/condition/JRE.java.jte} | 219 +++------------ .../condition/JavaVersionPredicates.java.jte | 22 ++ .../junit-jupiter-engine.gradle.kts | 1 + .../DisabledOnJreConditionTests.java.jte | 99 +++++++ .../DisabledOnJreIntegrationTests.java.jte | 66 +++++ .../EnabledOnJreConditionTests.java.jte | 99 +++++++ .../EnabledOnJreIntegrationTests.java.jte | 64 +++++ .../DisabledForJreRangeConditionTests.java | 35 ++- .../DisabledForJreRangeIntegrationTests.java | 33 +-- .../DisabledOnJreConditionTests.java | 251 ------------------ .../DisabledOnJreIntegrationTests.java | 182 ------------- .../EnabledForJreRangeConditionTests.java | 33 +-- .../EnabledForJreRangeIntegrationTests.java | 37 ++- .../condition/EnabledOnJreConditionTests.java | 251 ------------------ .../EnabledOnJreIntegrationTests.java | 233 ---------------- settings.gradle.kts | 2 + 30 files changed, 644 insertions(+), 1178 deletions(-) create mode 100644 gradle/base/code-generator-model/build.gradle.kts create mode 100644 gradle/base/code-generator-model/src/main/kotlin/junitbuild/generator/model/JRE.kt create mode 100644 gradle/base/code-generator-model/src/main/resources/jre.yaml create mode 100644 gradle/base/settings.gradle.kts create mode 100644 gradle/plugins/code-generator/build.gradle.kts create mode 100644 gradle/plugins/code-generator/src/main/kotlin/junitbuild.code-generator.gradle.kts create mode 100644 gradle/plugins/code-generator/src/main/kotlin/junitbuild/generator/GenerateJreRelatedSourceCode.kt rename junit-jupiter-api/src/{main/java/org/junit/jupiter/api/condition/JRE.java => templates/resources/main/org/junit/jupiter/api/condition/JRE.java.jte} (51%) create mode 100644 junit-jupiter-api/src/templates/resources/testFixtures/org/junit/jupiter/api/condition/JavaVersionPredicates.java.jte create mode 100644 junit-jupiter-engine/src/templates/resources/test/org/junit/jupiter/api/condition/DisabledOnJreConditionTests.java.jte create mode 100644 junit-jupiter-engine/src/templates/resources/test/org/junit/jupiter/api/condition/DisabledOnJreIntegrationTests.java.jte create mode 100644 junit-jupiter-engine/src/templates/resources/test/org/junit/jupiter/api/condition/EnabledOnJreConditionTests.java.jte create mode 100644 junit-jupiter-engine/src/templates/resources/test/org/junit/jupiter/api/condition/EnabledOnJreIntegrationTests.java.jte delete mode 100644 junit-jupiter-engine/src/test/java/org/junit/jupiter/api/condition/DisabledOnJreConditionTests.java delete mode 100644 junit-jupiter-engine/src/test/java/org/junit/jupiter/api/condition/DisabledOnJreIntegrationTests.java delete mode 100644 junit-jupiter-engine/src/test/java/org/junit/jupiter/api/condition/EnabledOnJreConditionTests.java delete mode 100644 junit-jupiter-engine/src/test/java/org/junit/jupiter/api/condition/EnabledOnJreIntegrationTests.java diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml index 5ec02b4ce298..e6094d409c45 100644 --- a/.idea/codeStyles/Project.xml +++ b/.idea/codeStyles/Project.xml @@ -83,6 +83,11 @@