X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=test%2Fjalview%2Fbin%2FCommandLineOperations.java;h=b81facf6964111ef0ef18bba8b7a7a743d049de6;hb=d3546f175bfbb5d16ed7942bf8e602e8ba53c5b5;hp=9b94be9246aaac25655c17f9ab517783f558c3ea;hpb=d5e758fa924437e30dc65b80a46cafcf4691da2f;p=jalview.git diff --git a/test/jalview/bin/CommandLineOperations.java b/test/jalview/bin/CommandLineOperations.java index 9b94be9..b81facf 100644 --- a/test/jalview/bin/CommandLineOperations.java +++ b/test/jalview/bin/CommandLineOperations.java @@ -35,6 +35,9 @@ import org.testng.annotations.BeforeTest; import org.testng.annotations.DataProvider; import org.testng.annotations.Test; +import io.github.classgraph.ClassGraph; +import io.github.classgraph.ScanResult; + public class CommandLineOperations { @@ -113,19 +116,39 @@ public class CommandLineOperations } } - private Worker jalviewDesktopRunner(boolean withAwt, String cmd, - int timeout) + private static ClassGraph scanner = null; + + private static String classpath = null; + + public synchronized static String getClassPath() { - String cp_sep = ":"; - if (System.getProperty("os.name").indexOf("Windows") >= 0) + if (scanner == null) + { + scanner = new ClassGraph(); + ScanResult scan = scanner.scan(); + classpath = scan.getClasspath(); + } + while (classpath == null) { - cp_sep = ";"; + try + { + Thread.sleep(10); + } catch (InterruptedException x) + { + + } } + return classpath; + } + private Worker jalviewDesktopRunner(boolean withAwt, String cmd, + int timeout) + { + // Note: JAL-3065 - don't include quotes for lib/* because the arguments are + // not expanded by the shell + String classpath = getClassPath(); String _cmd = "java " + (withAwt ? "-Djava.awt.headless=true" : "") - + " -classpath \"./lib/*" + cp_sep - + "./classes\" jalview.bin.Jalview "; - System.out.println("CMD [" + cmd + "]"); + + " -classpath " + classpath + " jalview.bin.Jalview "; Process ls2_proc = null; Worker worker = null; try