JAL-629 Count VISIBLE annotations for tests
authorBen Soares <b.soares@dundee.ac.uk>
Mon, 24 Apr 2023 09:27:57 +0000 (10:27 +0100)
committerBen Soares <b.soares@dundee.ac.uk>
Mon, 24 Apr 2023 09:27:57 +0000 (10:27 +0100)
test/jalview/bin/CommandsTest2.java
test/jalview/gui/StructureChooserTest.java

index 12e61e4..072d515 100644 (file)
@@ -110,7 +110,13 @@ public class CommandsTest2
       List<StructureViewerBase> openViewers = Desktop.instance
               .getStructureViewers(ap, null);
       Assert.assertNotNull(openViewers);
-      Assert.assertEquals(openViewers.size(), viewerNum,
+      int count = 0;
+      for (StructureViewerBase svb : openViewers)
+      {
+        if (svb.isVisible())
+          count++;
+      }
+      Assert.assertEquals(count, viewerNum,
               "Wrong number of structure viewers opened");
     }
   }
index b4eaf68..dd5cd4c 100644 (file)
@@ -353,8 +353,15 @@ public class StructureChooserTest
       List<StructureViewerBase> openViewers = Desktop.instance
               .getStructureViewers(ap, null);
       Assert.assertNotNull(openViewers);
+      int count = 0;
+      for (StructureViewerBase svb : openViewers)
+      {
+        if (svb.isVisible())
+          count++;
+      }
       Assert.assertEquals("Wrong number of structure viewers opened",
-              viewerNum, openViewers.size());
+              viewerNum, count);
+
     }
 
     if (af != null)