JAL-629 Move diagnostics to the right place
authorBen Soares <b.soares@dundee.ac.uk>
Mon, 24 Apr 2023 09:54:56 +0000 (10:54 +0100)
committerBen Soares <b.soares@dundee.ac.uk>
Mon, 24 Apr 2023 09:54:56 +0000 (10:54 +0100)
test/jalview/bin/CommandsTest2.java

index 34b802e..27759b9 100644 (file)
@@ -58,13 +58,23 @@ public class CommandsTest2
   @Test(
     groups =
     { "Functional" },
-    dataProvider = "structureOpeningArgsParams")
+    dataProvider = "structureOpeningArgsParams",
+    singleThreaded = true)
   public void structureOpeningArgsTest(String cmdLine, int seqNum,
           int annNum, int viewerNum)
   {
     String[] args = cmdLine.split("\\s+");
 
     Jalview.main(args);
+    try
+    {
+      // sleep for slow build server to open viewer window
+      Thread.sleep(2500);
+    } catch (InterruptedException e)
+    {
+      e.printStackTrace();
+    }
+
     AlignFrame[] afs = Desktop.getAlignFrames();
     Assert.assertNotNull(afs);
     Assert.assertTrue(afs.length > 0);
@@ -88,8 +98,11 @@ public class CommandsTest2
 
     AlignmentAnnotation[] aas = al.getAlignmentAnnotation();
     int visibleAnn = 0;
+    int dcount = 0;
     for (AlignmentAnnotation aa : aas)
     {
+      System.err.println("##### DIAGNOSIS: annotation " + dcount
+              + " is labelled '" + aa.label + "'");
       if (aa.visible)
         visibleAnn++;
     }
@@ -99,23 +112,12 @@ public class CommandsTest2
 
     if (viewerNum > -1)
     {
-      try
-      {
-        // sleep for slow build server to open viewer window
-        Thread.sleep(2000);
-      } catch (InterruptedException e)
-      {
-        e.printStackTrace();
-      }
       List<StructureViewerBase> openViewers = Desktop.instance
               .getStructureViewers(ap, null);
       Assert.assertNotNull(openViewers);
       int count = 0;
-      int dcount = 0;
       for (StructureViewerBase svb : openViewers)
       {
-        System.err.println("##### DIAGNOSIS: annotation " + dcount
-                + " is called '" + svb.getName() + "'");
         if (svb.isVisible())
           count++;
       }