Merge branch 'develop' into bug/JAL-2255_seq-fetcher-broken-on-linux
[jalview.git] / test / jalview / io / AnnotatedPDBFileInputTest.java
index b8c12c6..d8ae999 100644 (file)
@@ -31,6 +31,7 @@ import jalview.datamodel.PDBEntry;
 import jalview.datamodel.SequenceFeature;
 import jalview.datamodel.SequenceI;
 import jalview.gui.AlignFrame;
+import jalview.gui.JvOptionPane;
 import jalview.structure.StructureImportSettings;
 import jalview.structure.StructureImportSettings.StructureParser;
 
@@ -44,6 +45,13 @@ import org.testng.annotations.Test;
 public class AnnotatedPDBFileInputTest
 {
 
+  @BeforeClass(alwaysRun = true)
+  public void setUpJvOptionPane()
+  {
+    JvOptionPane.setInteractiveMode(false);
+    JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION);
+  }
+
   AlignmentI al;
 
   String pdbId;
@@ -63,7 +71,7 @@ public class AnnotatedPDBFileInputTest
             Boolean.TRUE.toString());
     FileLoader loader = new FileLoader(false);
     AlignFrame af = loader.LoadFileWaitTillLoaded("examples/1gaq.txt",
-            FormatAdapter.FILE);
+            DataSourceType.FILE);
     al = af.getViewport().getAlignment();
     pdbId = al.getSequenceAt(0).getDatasetSequence().getAllPDBEntries()
             .get(0).getId();
@@ -204,14 +212,14 @@ public class AnnotatedPDBFileInputTest
     String tfile = File.createTempFile("JalviewTest", ".jvp")
             .getAbsolutePath();
     AlignFrame af = new jalview.io.FileLoader().LoadFileWaitTillLoaded(
-            inFile, FormatAdapter.FILE);
+            inFile, DataSourceType.FILE);
     assertTrue("Didn't read input file " + inFile, af != null);
     assertTrue("Failed to store as a project.",
-            af.saveAlignment(tfile, "Jalview"));
+            af.saveAlignment(tfile, FileFormat.Jalview));
     af.closeMenuItem_actionPerformed(true);
     af = null;
     af = new jalview.io.FileLoader().LoadFileWaitTillLoaded(tfile,
-            FormatAdapter.FILE);
+            DataSourceType.FILE);
     assertTrue("Failed to import new project", af != null);
     for (SequenceI asq : af.getViewport().getAlignment().getSequences())
     {