Merge branch 'features/JAL-2326_JOptionPane-refactoring' into develop
[jalview.git] / test / jalview / ext / paradise / TestAnnotate3D.java
index d8582af..1b70e8d 100644 (file)
@@ -24,6 +24,7 @@ import static org.testng.AssertJUnit.assertTrue;
 
 import jalview.datamodel.AlignmentI;
 import jalview.datamodel.SequenceI;
+import jalview.gui.JvOptionPane;
 import jalview.io.FastaFile;
 import jalview.io.FormatAdapter;
 
@@ -34,6 +35,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,7 +45,14 @@ import compbio.util.FileUtil;
 public class TestAnnotate3D
 {
 
-  @Test(enabled = false)
+  @BeforeClass(alwaysRun = true)
+  public void setUpJvOptionPane()
+  {
+    JvOptionPane.setInteractiveMode(false);
+    JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION);
+  }
+
+  @Test(groups = { "Network" }, enabled = true)
   public void test1GIDbyId() throws Exception
   {
     // use same ID as standard tests given at
@@ -53,7 +62,7 @@ public class TestAnnotate3D
     testRNAMLcontent(ids, null);
   }
 
-  @Test(enabled = false)
+  @Test(groups = { "Network" }, enabled = true)
   public void testIdVsContent2GIS() throws Exception
   {
     Iterator<Reader> ids = Annotate3D.getRNAMLForPDBId("2GIS");
@@ -97,7 +106,7 @@ public class TestAnnotate3D
    * 
    * @throws Exception
    */
-  @Test(enabled = false)
+  @Test(groups = { "Network" }, enabled = true)
   public void testPDBfileVsRNAML() throws Exception
   {
     PDBfile pdbf = new PDBfile(true, false, true, "examples/2GIS.pdb",
@@ -111,7 +120,6 @@ public class TestAnnotate3D
     testRNAMLcontent(readers, pdbf);
   }
 
-  @Test(enabled = false)
   private void testRNAMLcontent(Iterator<Reader> readers, PDBfile pdbf)
           throws Exception
   {
@@ -145,9 +153,9 @@ public class TestAnnotate3D
             String sq_ = new String(sq.getSequence()).toLowerCase();
             for (SequenceI _struseq : pdbf.getSeqsAsArray())
             {
-              final String lowerCase = new String(_struseq.getSequence()).toLowerCase();
-              if (lowerCase.equals(
-                      sq_))
+              final String lowerCase = new String(_struseq.getSequence())
+                      .toLowerCase();
+              if (lowerCase.equals(sq_))
               {
                 struseq = _struseq;
                 break;
@@ -155,11 +163,13 @@ public class TestAnnotate3D
             }
             if (struseq == null)
             {
-              AssertJUnit.fail("Couldn't find this sequence in original input:\n"
-                      + new FastaFile().print(new SequenceI[]
-                      { sq })
-                      + "\n\nOriginal input:\n"
-                      + new FastaFile().print(pdbf.getSeqsAsArray()) + "\n");
+              AssertJUnit
+                      .fail("Couldn't find this sequence in original input:\n"
+                              + new FastaFile()
+                                      .print(new SequenceI[] { sq })
+                              + "\n\nOriginal input:\n"
+                              + new FastaFile().print(pdbf.getSeqsAsArray())
+                              + "\n");
             }
           }
         }