From: Ben Soares Date: Mon, 24 Apr 2023 09:27:57 +0000 (+0100) Subject: JAL-629 Count VISIBLE annotations for tests X-Git-Tag: Release_2_11_4_0~383 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=ffd22c51b2f6ed21affb41a706229534a9e0093a;p=jalview.git JAL-629 Count VISIBLE annotations for tests --- diff --git a/test/jalview/bin/CommandsTest2.java b/test/jalview/bin/CommandsTest2.java index 12e61e4..072d515 100644 --- a/test/jalview/bin/CommandsTest2.java +++ b/test/jalview/bin/CommandsTest2.java @@ -110,7 +110,13 @@ public class CommandsTest2 List 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"); } } diff --git a/test/jalview/gui/StructureChooserTest.java b/test/jalview/gui/StructureChooserTest.java index b4eaf68..dd5cd4c 100644 --- a/test/jalview/gui/StructureChooserTest.java +++ b/test/jalview/gui/StructureChooserTest.java @@ -353,8 +353,15 @@ public class StructureChooserTest List 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)