JAL-2314 Re-annotated unit tests using Jws2Discoverer
[jalview.git] / test / jalview / ws / jabaws / DisorderAnnotExportImport.java
index 85c075b..9b1dc19 100644 (file)
@@ -26,6 +26,7 @@ import static org.testng.AssertJUnit.assertTrue;
 import jalview.bin.Cache;
 import jalview.datamodel.AlignmentAnnotation;
 import jalview.datamodel.AlignmentI;
+import jalview.gui.JvOptionPane;
 import jalview.io.AnnotationFile;
 import jalview.io.DataSourceType;
 import jalview.io.FileFormat;
@@ -43,9 +44,21 @@ import org.testng.annotations.AfterClass;
 import org.testng.annotations.BeforeClass;
 import org.testng.annotations.Test;
 
-@Test(groups = { "External" })
+/*
+ * All methods in this class are set to the Network group because setUpBeforeClass will fail
+ * if there is no network.
+ */
+@Test(singleThreaded = true)
 public class DisorderAnnotExportImport
 {
+
+  @BeforeClass(alwaysRun = true)
+  public void setUpJvOptionPane()
+  {
+    JvOptionPane.setInteractiveMode(false);
+    JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION);
+  }
+
   public static String testseqs = "examples/uniref50.fa";
 
   public static Jws2Discoverer disc;
@@ -91,7 +104,7 @@ public class DisorderAnnotExportImport
   /**
    * test for patches to JAL-1294
    */
-  @Test
+  @Test(groups = { "External", "Network" })
   public void testDisorderAnnotExport()
   {
     disorderClient = new AADisorderClient(iupreds.get(0), af, null, null);
@@ -121,15 +134,15 @@ public class DisorderAnnotExportImport
     {
       orig_alig.deleteAnnotation(aa);
     }
-    testAnnotationFileIO("Testing IUPred Annotation IO", orig_alig);
+    checkAnnotationFileIO("Testing IUPred Annotation IO", orig_alig);
 
   }
 
-  public static void testAnnotationFileIO(String testname, AlignmentI al)
+  static void checkAnnotationFileIO(String testname, AlignmentI al)
   {
     try
     {
-      String aligfileout = FileFormat.Pfam.getAlignmentFile().print(
+      String aligfileout = FileFormat.Pfam.getWriter(al).print(
               al.getSequencesArray(), true);
       String anfileout = new AnnotationFile()
               .printAnnotationsForAlignment(al);