From ffd22c51b2f6ed21affb41a706229534a9e0093a Mon Sep 17 00:00:00 2001 From: Ben Soares Date: Mon, 24 Apr 2023 10:27:57 +0100 Subject: [PATCH] JAL-629 Count VISIBLE annotations for tests --- test/jalview/bin/CommandsTest2.java | 8 +++++++- test/jalview/gui/StructureChooserTest.java | 9 ++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) 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) -- 1.7.10.2