From 332464205ecb167bd82ffc4d78ce18b7818a47ec Mon Sep 17 00:00:00 2001 From: Vest Date: Sat, 6 Jun 2026 15:09:13 +0200 Subject: [PATCH] Build/test cleanup: drop duplicated test JVM args, refresh stale Javadoc * build.gradle: drop duplicated test-task JVM args tasks.named("test", Test) re-added six args that tasks.withType(Test).configureEach already applies to every Test: -Dtestfx.robot=glass, -Dtestfx.headless=true, -Dprism.order=sw, --add-exports for javafx.graphics/com.sun.javafx.util and javafx.base/com.sun.javafx.logging, and --add-opens for javafx.graphics/com.sun.glass.ui. Each was landing on the test JVM command line twice. Kept --add-opens javafx.graphics/com.sun.javafx.application: withType has --add-exports (not --add-opens) for that package, and TestFX's @AfterEach cleanup uses setAccessible(true) on a private field of ParametersImpl, which exports alone don't satisfy. Verified by running pcgen.gui3.dialog.AboutDialogTest after the cleanup. * PluginBuildTest: refresh stale class Javadoc The class Javadoc still referenced the deleted Ant pluginbuild.xml. Now describes what the test actually does today: every plugin source file under code/src/java/plugin// is packaged into the matching plugins.jar produced by code/gradle/plugins.gradle. --- build.gradle | 13 ++++++------- code/src/test/plugin/PluginBuildTest.java | 7 ++++--- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/build.gradle b/build.gradle index bf182dc4db0..24a4898fb95 100644 --- a/build.gradle +++ b/build.gradle @@ -697,19 +697,18 @@ tasks.named("test", Test) { useJUnitPlatform() maxParallelForks = parallelTestForks // TestFX/Monocle setup — only the unit test source set has TestFX-based tests. + // Other JavaFX/Monocle args (testfx.*, prism.order, --add-exports for + // com.sun.javafx.util / com.sun.javafx.logging, --add-opens for + // com.sun.glass.ui) are applied to every Test by the + // tasks.withType(Test).configureEach block below; only the + // com.sun.javafx.application open is unique here, since withType + // has --add-exports (not --add-opens) for that package. jvmArgs += [ - '-Dtestfx.robot=glass', - '-Dtestfx.headless=true', - '-Dprism.order=sw', // Workaround for TestFX modularity issue. https://github.com/TestFX/TestFX/issues/638 // --add-opens (not --add-exports) is required: TestFX's @AfterEach cleanup // does setAccessible(true) on a private field of ParametersImpl, which is // deep reflection — exports alone aren't enough. '--add-opens', 'javafx.graphics/com.sun.javafx.application=ALL-UNNAMED', - // Required for Monocle. - '--add-exports', 'javafx.graphics/com.sun.javafx.util=ALL-UNNAMED', - '--add-exports', 'javafx.base/com.sun.javafx.logging=ALL-UNNAMED', - '--add-opens', 'javafx.graphics/com.sun.glass.ui=ALL-UNNAMED', ] } diff --git a/code/src/test/plugin/PluginBuildTest.java b/code/src/test/plugin/PluginBuildTest.java index 05ef65a9c73..a3b417a7a32 100644 --- a/code/src/test/plugin/PluginBuildTest.java +++ b/code/src/test/plugin/PluginBuildTest.java @@ -39,9 +39,10 @@ import org.junit.jupiter.api.Test; /** - * {@code PluginBuildTest} verifies that the pluginbuild.xml file has all - * required data. As a result this unit test is a bit different in structure to - * a normal test. + * {@code PluginBuildTest} verifies that every plugin source file under + * {@code code/src/java/plugin//} is packaged into the matching + * {@code plugins.jar} produced by {@code code/gradle/plugins.gradle}. + * As a result this unit test is a bit different in structure to a normal test. */ class PluginBuildTest {