Merge branch 'develop' into features/JAL-2446NCList
[jalview.git] / test / jalview / ext / jmol / JmolParserTest.java
index 75b27c7..f5e637c 100644 (file)
@@ -29,6 +29,7 @@ import jalview.datamodel.Alignment;
 import jalview.datamodel.AlignmentI;
 import jalview.datamodel.SequenceI;
 import jalview.gui.AlignFrame;
+import jalview.gui.JvOptionPane;
 import jalview.io.DataSourceType;
 import jalview.io.FileLoader;
 import jalview.structure.StructureImportSettings;
@@ -37,6 +38,7 @@ import jalview.structure.StructureImportSettings.StructureParser;
 import java.util.Vector;
 
 import org.jmol.c.STR;
+import org.testng.annotations.BeforeClass;
 import org.testng.annotations.BeforeMethod;
 import org.testng.annotations.Test;
 
@@ -48,6 +50,14 @@ import MCview.PDBfile;
  */
 public class JmolParserTest
 {
+
+  @BeforeClass(alwaysRun = true)
+  public void setUpJvOptionPane()
+  {
+    JvOptionPane.setInteractiveMode(false);
+    JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION);
+  }
+
   /*
    * 1GAQ has been reduced to alpha carbons only
    * 1QCF is the full PDB file including headers, HETATM etc
@@ -262,15 +272,14 @@ public class JmolParserTest
      * local structure files should yield a false ID based on the filename
      */
     assertNotNull(structureData.getId());
-    assertEquals(structureData.getId(), "localstruct.pdb");
+    assertEquals(structureData.getId(), "localstruct");
     assertNotNull(structureData.getSeqs());
     /*
      * the ID is also the group for features derived from structure data 
      */
-    assertNotNull(structureData.getSeqs().get(0).getSequenceFeatures()[0].featureGroup);
-    assertEquals(
-            structureData.getSeqs().get(0).getSequenceFeatures()[0].featureGroup,
-            "localstruct.pdb");
-
+    String featureGroup = structureData.getSeqs().get(0)
+            .getSequenceFeatures().get(0).featureGroup;
+    assertNotNull(featureGroup);
+    assertEquals(featureGroup, "localstruct");
   }
 }