import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;
+import io.github.classgraph.ClassGraph;
+import io.github.classgraph.ScanResult;
+
public class CommandLineOperations
{
JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION);
}
- private static final int TEST_TIMEOUT = 4500; // Note longer timeout needed on
+ private static final int TEST_TIMEOUT = 9000; // Note longer timeout needed on
// full test run than on
// individual tests
}
}
- 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 ./classes" + cp_sep
- + "./lib/* jalview.bin.Jalview ";
- System.out.println("CMD [" + cmd + "]");
+ + " -classpath " + classpath + " jalview.bin.Jalview ";
Process ls2_proc = null;
Worker worker = null;
try
"Failed command : -open examples/uniref50.fa" },
{ "CMD [-nosortbytree] executed successfully!",
"Failed command : -nosortbytree" },
- { "CMD [-dasserver nickname=www.test.com] executed successfully!",
- "Failed command : -dasserver nickname=www.test.com" },
{
"CMD [-features examples/testdata/plantfdx.features] executed successfully!",
"Failed command : -features examples/testdata/plantfdx.features" },
{ "CMD [-nousagestats] executed successfully!",
"Failed command : -nousagestats" },
{ "CMD [-noquestionnaire] executed successfully!",
- "Failed command : -noquestionnaire nickname=www.test.com" } };
+ "Failed command : -noquestionnaire" } };
}