JAL-2326 added setup method for JvOptionPane in all Jalveiw test classes to enable...
[jalview.git] / test / jalview / util / QuickSortTest.java
index 54e46a0..f09dee9 100644 (file)
@@ -23,13 +23,24 @@ package jalview.util;
 import static org.testng.AssertJUnit.assertEquals;
 import static org.testng.AssertJUnit.assertTrue;
 
+import jalview.gui.JvOptionPane;
+
 import java.util.Arrays;
 import java.util.Random;
 
+import org.testng.annotations.BeforeClass;
 import org.testng.annotations.Test;
 
 public class QuickSortTest
 {
+
+  @BeforeClass(alwaysRun = true)
+  public void setUpJvOptionPane()
+  {
+    JvOptionPane.setInteractiveMode(false);
+    JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION);
+  }
+
   private static final String c1 = "Blue";
 
   private static final String c2 = "Yellow";
@@ -110,8 +121,7 @@ public class QuickSortTest
         "ALISON" };
     QuickSort.sort(values, things);
     assertTrue(Arrays.equals(new String[] { "lucy", "henry", "henry",
-        "JOHN",
-        "ALISON" }, values));
+        "JOHN", "ALISON" }, values));
     assertTrue(Arrays.equals(new Object[] { c3, c2, c4, c1, c5 }, things));
   }