JAL-3065 - amended commit 4906697ab6e5a79fbce3baae89f7f64178c9a739 to exclude ...
[jalview.git] / test / jalview / bin / CommandLineOperations.java
index c79a043..9b94be9 100644 (file)
@@ -20,6 +20,8 @@
  */
 package jalview.bin;
 
+import jalview.gui.JvOptionPane;
+
 import java.io.BufferedReader;
 import java.io.File;
 import java.io.IOException;
@@ -28,12 +30,21 @@ import java.util.ArrayList;
 
 import org.testng.Assert;
 import org.testng.FileAssert;
+import org.testng.annotations.BeforeClass;
 import org.testng.annotations.BeforeTest;
 import org.testng.annotations.DataProvider;
 import org.testng.annotations.Test;
 
 public class CommandLineOperations
 {
+
+  @BeforeClass(alwaysRun = true)
+  public void setUpJvOptionPane()
+  {
+    JvOptionPane.setInteractiveMode(false);
+    JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION);
+  }
+
   private static final int TEST_TIMEOUT = 4500; // Note longer timeout needed on
                                                 // full test run than on
                                                 // individual tests
@@ -44,7 +55,7 @@ public class CommandLineOperations
 
   private static final int MINFILESIZE_BIG = 4096;
 
-  private ArrayList<String> successfulCMDs = new ArrayList<String>();
+  private ArrayList<String> successfulCMDs = new ArrayList<>();
 
   /***
    * from
@@ -105,9 +116,15 @@ public class CommandLineOperations
   private Worker jalviewDesktopRunner(boolean withAwt, String cmd,
           int timeout)
   {
+    String cp_sep = ":";
+    if (System.getProperty("os.name").indexOf("Windows") >= 0)
+    {
+      cp_sep = ";";
+    }
     String _cmd = "java "
             + (withAwt ? "-Djava.awt.headless=true" : "")
-            + " -Djava.ext.dirs=./lib -classpath ./classes jalview.bin.Jalview ";
+            + " -classpath \"./lib/*" + cp_sep
+            + "./classes\" jalview.bin.Jalview ";
     System.out.println("CMD [" + cmd + "]");
     Process ls2_proc = null;
     Worker worker = null;