JAL-3130 Fixing a few more tests that pass on a Mac but not on linux (e.g. jv-bamboo)
[jalview.git] / test / jalview / io / FormatAdapterTest.java
index 1cabc15..b500266 100644 (file)
@@ -26,17 +26,26 @@ import static org.testng.AssertJUnit.fail;
 
 import jalview.datamodel.AlignmentI;
 import jalview.datamodel.SequenceI;
+import jalview.gui.JvOptionPane;
 
 import java.io.IOException;
 import java.util.ArrayList;
 import java.util.List;
 
+import org.testng.annotations.BeforeClass;
 import org.testng.annotations.DataProvider;
 import org.testng.annotations.Test;
 
 public class FormatAdapterTest
 {
 
+  @BeforeClass(alwaysRun = true)
+  public void setUpJvOptionPane()
+  {
+    JvOptionPane.setInteractiveMode(false);
+    JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION);
+  }
+
   /**
    * Test saving and re-reading in a specified format
    * 
@@ -123,7 +132,7 @@ public class FormatAdapterTest
   static Object[][] getFormats()
   {
     List<FileFormatI> both = new ArrayList<FileFormatI>();
-    for (FileFormat format : FileFormat.values())
+    for (FileFormatI format : FileFormats.getInstance().getFormats())
     {
       if (format.isReadable() && format.isWritable()
               && format.isTextFormat())