Merge branch 'develop' into trialMerge
[jalview.git] / test / MCview / PDBfileTest.java
index 2863643..c07c62e 100644 (file)
@@ -33,17 +33,27 @@ import jalview.datamodel.AlignmentI;
 import jalview.datamodel.PDBEntry;
 import jalview.datamodel.Sequence;
 import jalview.datamodel.SequenceI;
-import jalview.io.AppletFormatAdapter;
+import jalview.gui.JvOptionPane;
+import jalview.io.DataSourceType;
 import jalview.structure.StructureImportSettings;
 
 import java.io.IOException;
 import java.util.List;
 
+import org.testng.annotations.BeforeClass;
 import org.testng.annotations.BeforeMethod;
 import org.testng.annotations.Test;
 
 public class PDBfileTest
 {
+
+  @BeforeClass(alwaysRun = true)
+  public void setUpJvOptionPane()
+  {
+    JvOptionPane.setInteractiveMode(false);
+    JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION);
+  }
+
   @Test(groups = { "Functional" })
   public void testIsRna()
   {
@@ -73,7 +83,7 @@ public class PDBfileTest
      * Constructor with file path performs parse()
      */
     PDBfile pf = new PDBfile(false, false, false, "examples/3W5V.pdb",
-            AppletFormatAdapter.FILE);
+            DataSourceType.FILE);
 
     assertEquals("3W5V", pf.getId());
     // verify no alignment annotations created
@@ -149,7 +159,7 @@ public class PDBfileTest
   public void testParse_withAnnotations_noSS() throws IOException
   {
     PDBfile pf = new PDBfile(true, false, false, "examples/3W5V.pdb",
-            AppletFormatAdapter.FILE);
+            DataSourceType.FILE);
 
     AlignmentAnnotation[] anns = getAlignmentAnnotations(pf);
     assertEquals(4, anns.length);
@@ -207,7 +217,7 @@ public class PDBfileTest
   public void testParse_withJmol_noAnnotations() throws IOException
   {
     PDBfile pf = new PDBfile(false, true, false, "examples/3W5V.pdb",
-            AppletFormatAdapter.FILE);
+            DataSourceType.FILE);
 
     /*
      * alignment annotations _are_ created anyway (in
@@ -237,7 +247,7 @@ public class PDBfileTest
           throws IOException
   {
     PDBfile pf = new PDBfile(true, true, false, "examples/3W5V.pdb",
-            AppletFormatAdapter.FILE);
+            DataSourceType.FILE);
 
     /*
      * Alignment annotations for TempFactor, SecStruct, per sequence (chain)
@@ -295,7 +305,7 @@ public class PDBfileTest
     // TODO requires a mock for Annotate3D processing
     // and/or run as an integration test
     PDBfile pf = new PDBfile(true, true, true, "examples/2GIS.pdb",
-            AppletFormatAdapter.FILE);
+            DataSourceType.FILE);
   }
 
   /**
@@ -311,8 +321,6 @@ public class PDBfileTest
     return al.getAlignmentAnnotation();
   }
 
-  // @formatter:on
-
   @BeforeMethod(alwaysRun = true)
   public void setUp()
   {