Merge branch 'develop' into trialMerge
[jalview.git] / test / jalview / ext / paradise / TestAnnotate3D.java
index 7f150a3..85fc039 100644 (file)
@@ -1,6 +1,6 @@
 /*
- * Jalview - A Sequence Alignment Editor and Viewer (Version 2.9.0b2)
- * Copyright (C) 2015 The Jalview Authors
+ * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
+ * Copyright (C) $$Year-Rel$$ The Jalview Authors
  * 
  * This file is part of Jalview.
  * 
@@ -24,7 +24,10 @@ import static org.testng.AssertJUnit.assertTrue;
 
 import jalview.datamodel.AlignmentI;
 import jalview.datamodel.SequenceI;
+import jalview.gui.JvOptionPane;
+import jalview.io.DataSourceType;
 import jalview.io.FastaFile;
+import jalview.io.FileFormat;
 import jalview.io.FormatAdapter;
 
 import java.io.BufferedReader;
@@ -34,6 +37,7 @@ import java.util.Iterator;
 
 import org.testng.Assert;
 import org.testng.AssertJUnit;
+import org.testng.annotations.BeforeClass;
 import org.testng.annotations.Test;
 
 import MCview.PDBfile;
@@ -43,6 +47,13 @@ import compbio.util.FileUtil;
 public class TestAnnotate3D
 {
 
+  @BeforeClass(alwaysRun = true)
+  public void setUpJvOptionPane()
+  {
+    JvOptionPane.setInteractiveMode(false);
+    JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION);
+  }
+
   @Test(groups = { "Network" }, enabled = true)
   public void test1GIDbyId() throws Exception
   {
@@ -101,7 +112,7 @@ public class TestAnnotate3D
   public void testPDBfileVsRNAML() throws Exception
   {
     PDBfile pdbf = new PDBfile(true, false, true, "examples/2GIS.pdb",
-            FormatAdapter.FILE);
+            DataSourceType.FILE);
     Assert.assertTrue(pdbf.isValid());
     // Comment - should add new FileParse constructor like new FileParse(Reader
     // ..). for direct reading
@@ -128,7 +139,7 @@ public class TestAnnotate3D
       assertTrue("No data returned by Annotate3D", sb.length() > 0);
       final String lines = sb.toString();
       AlignmentI al = new FormatAdapter().readFile(lines,
-              FormatAdapter.PASTE, "RNAML");
+              DataSourceType.PASTE, FileFormat.Rnaml);
       if (al == null || al.getHeight() == 0)
       {
         System.out.println(lines);
@@ -156,11 +167,11 @@ public class TestAnnotate3D
             {
               AssertJUnit
                       .fail("Couldn't find this sequence in original input:\n"
-                              + new FastaFile()
-                                      .print(new SequenceI[] { sq })
+                              + new FastaFile().print(
+                                      new SequenceI[] { sq }, true)
                               + "\n\nOriginal input:\n"
-                              + new FastaFile().print(pdbf.getSeqsAsArray())
-                              + "\n");
+                              + new FastaFile().print(
+                                      pdbf.getSeqsAsArray(), true) + "\n");
             }
           }
         }