On Wed, 21 Sep 2022 07:10:07 GMT, Alan Bateman <al...@openjdk.org> wrote:
>> Leslie Zhai has updated the pull request incrementally with one additional >> commit since the last revision: >> >> 8293910: Try --upgrade-module-path and --patch-module but still failed > > The --patch-module option is used to override or add classes/resources in the > module, it doesn't override the module definition. I see you tried > --upgrade-module-path too but you've set the value to IMPORT_MODULE_DIR and > it's not clear what this means in this test. > > Can you try this, I think this should do what you want: > > > --- a/test/jdk/tools/launcher/FXLauncherTest.java > +++ b/test/jdk/tools/launcher/FXLauncherTest.java > @@ -223,7 +223,7 @@ public class FXLauncherTest extends TestHelper { > compileFXModule(); > > List<String> fxCompilerArgs = new ArrayList<>(); > - fxCompilerArgs.add("--module-path=" + MODULE_DIR); > + fxCompilerArgs.add("--upgrade-module-path=" + MODULE_DIR); > fxCompilerArgs.add("--add-modules=javafx.graphics"); > fxCompilerArgs.addAll(Arrays.asList(compilerArgs)); > compile(fxCompilerArgs.toArray(new String[fxCompilerArgs.size()])); > @@ -232,7 +232,7 @@ public class FXLauncherTest extends TestHelper { > static TestResult doFxExec(String...cmds) { > List<String> fxCmds = new ArrayList<>(); > fxCmds.addAll(Arrays.asList(cmds)); > - fxCmds.add(1, "--module-path=" + MODULE_DIR); > + fxCmds.add(1, "--upgrade-module-path=" + MODULE_DIR); > fxCmds.add(2, "--add-modules=javafx.graphics"); > return doExec(fxCmds.toArray(new String[fxCmds.size()])); > } > @@ -439,18 +439,6 @@ public class FXLauncherTest extends TestHelper { > } > > public static void main(String... args) throws Exception { > - > - // Ensure that FX is not part of jdk > - Class<?> fxClass = null; > - try { > - fxClass = Class.forName(FX_MARKER_CLASS); > - } catch (ClassNotFoundException ex) { > - // do nothing > - } > - if (fxClass != null) { > - throw new RuntimeException("JavaFX modules erroneously included > in the JDK"); > - } > - > FXLauncherTest fxt = new FXLauncherTest(); > fxt.run(args); > if (testExitValue > 0) { Hi @AlanBateman Debug patch: diff --git a/test/jdk/tools/launcher/FXLauncherTest.java b/test/jdk/tools/launcher/FXLauncherTest.java index 9cc4b5aea98..33c3e2788ad 100644 --- a/test/jdk/tools/launcher/FXLauncherTest.java +++ b/test/jdk/tools/launcher/FXLauncherTest.java @@ -223,7 +223,7 @@ public class FXLauncherTest extends TestHelper { compileFXModule(); List<String> fxCompilerArgs = new ArrayList<>(); - fxCompilerArgs.add("--module-path=" + MODULE_DIR); + fxCompilerArgs.add("--upgrade-module-path=" + MODULE_DIR); fxCompilerArgs.add("--add-modules=javafx.graphics"); fxCompilerArgs.addAll(Arrays.asList(compilerArgs)); compile(fxCompilerArgs.toArray(new String[fxCompilerArgs.size()])); @@ -232,7 +232,7 @@ public class FXLauncherTest extends TestHelper { static TestResult doFxExec(String...cmds) { List<String> fxCmds = new ArrayList<>(); fxCmds.addAll(Arrays.asList(cmds)); - fxCmds.add(1, "--module-path=" + MODULE_DIR); + fxCmds.add(1, "--upgrade-module-path=" + MODULE_DIR); fxCmds.add(2, "--add-modules=javafx.graphics"); return doExec(fxCmds.toArray(new String[fxCmds.size()])); } @@ -439,18 +439,6 @@ public class FXLauncherTest extends TestHelper { } public static void main(String... args) throws Exception { - - // Ensure that FX is not part of jdk - Class<?> fxClass = null; - try { - fxClass = Class.forName(FX_MARKER_CLASS); - } catch (ClassNotFoundException ex) { - // do nothing - } - if (fxClass != null) { - throw new RuntimeException("JavaFX modules erroneously included in the JDK"); - } - FXLauncherTest fxt = new FXLauncherTest(); fxt.run(args); if (testExitValue > 0) { Still failed: [debug.log](https://github.com/openjdk/jdk/files/9614161/debug.log) Thanks, Leslie Zhai ------------- PR: https://git.openjdk.org/jdk/pull/10299