JAL-3763 (for whatever reason) need to increase timeout for command line ops to 10...
[jalview.git] / test / jalview / bin / CommandLineOperations.java
index cb08563..a539f78 100644 (file)
@@ -54,7 +54,7 @@ public class CommandLineOperations
     JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION);
   }
 
-  private static final int TEST_TIMEOUT = 9000; // Note longer timeout needed
+  private static final int TEST_TIMEOUT = 10500; // Note longer timeout needed
                                                 // on
                                                 // full test run than on
                                                 // individual tests
@@ -129,6 +129,8 @@ public class CommandLineOperations
 
   private static String modules = null;
 
+  private static String java_exe = null;
+
   public synchronized static String getClassPath()
   {
     if (scanner == null)
@@ -141,6 +143,9 @@ public class CommandLineOperations
       {
         modules.concat(mr.getName());
       }
+      java_exe = System.getProperty("java.home") + File.separator + "bin"
+              + File.separator + "java";
+
     }
     while (classpath == null)
     {
@@ -161,7 +166,8 @@ public class CommandLineOperations
     // 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" : "")
+    String _cmd = java_exe + " "
+            + (withAwt ? "-Djava.awt.headless=true" : "")
             + " -classpath " + classpath
             + (modules.length() > 2 ? "--add-modules=\"" + modules + "\""
                     : "")
@@ -204,7 +210,6 @@ public class CommandLineOperations
       Path currentRelativePath = Paths.get("");
       String s = currentRelativePath.toAbsolutePath().toString();
       System.out.println("Test CWD is " + s);
-      System.err.println("Test CWD is " + s);
     } catch (Exception q)
     {
       q.printStackTrace();
@@ -248,7 +253,7 @@ public class CommandLineOperations
     {
       System.out.println(ln);
       successfulCMDs.add(ln);
-      if (++count > 5)
+      if (++count > 25)
       {
         break;
       }