From: Jim Procter Date: Fri, 12 Apr 2019 16:36:22 +0000 (+0100) Subject: JAL-3130 specify module list when launching new Jalview for CLI tests X-Git-Tag: Release_2_11_0~17^2~7^2~40 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=b4938d8d3018957d5c5fd4443278083e8b5e0864;p=jalview.git JAL-3130 specify module list when launching new Jalview for CLI tests --- diff --git a/test/jalview/bin/CommandLineOperations.java b/test/jalview/bin/CommandLineOperations.java index ace1868..1761261 100644 --- a/test/jalview/bin/CommandLineOperations.java +++ b/test/jalview/bin/CommandLineOperations.java @@ -39,6 +39,7 @@ import org.testng.annotations.DataProvider; import org.testng.annotations.Test; import io.github.classgraph.ClassGraph; +import io.github.classgraph.ModuleRef; import io.github.classgraph.ScanResult; public class CommandLineOperations @@ -124,6 +125,8 @@ public class CommandLineOperations private static String classpath = null; + private static String modules = null; + public synchronized static String getClassPath() { if (scanner == null) @@ -131,6 +134,11 @@ public class CommandLineOperations scanner = new ClassGraph(); ScanResult scan = scanner.scan(); classpath = scan.getClasspath(); + modules = ""; + for (ModuleRef mr : scan.getModules()) + { + modules.concat(mr.getName()); + } } while (classpath == null) { @@ -152,7 +160,10 @@ public class CommandLineOperations // not expanded by the shell String classpath = getClassPath(); String _cmd = "java " + (withAwt ? "-Djava.awt.headless=true" : "") - + " -classpath " + classpath + " jalview.bin.Jalview "; + + " -classpath " + classpath + + (modules.length() > 2 ? "--add-modules=\"" + modules + "\"" + : "") + + " jalview.bin.Jalview "; Process ls2_proc = null; Worker worker = null; try