From 5779b71c22d85070cbb59aa51a612d03f9744cc3 Mon Sep 17 00:00:00 2001 From: gmungoc Date: Mon, 21 Aug 2017 15:20:36 +0100 Subject: [PATCH] JAL-2680 clear down all mappings before test --- test/jalview/gui/AlignViewportTest.java | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/test/jalview/gui/AlignViewportTest.java b/test/jalview/gui/AlignViewportTest.java index b2286e0..812fd8f 100644 --- a/test/jalview/gui/AlignViewportTest.java +++ b/test/jalview/gui/AlignViewportTest.java @@ -75,6 +75,13 @@ public class AlignViewportTest { Jalview.main(new String[] { "-nonews", "-props", "test/jalview/testProps.jvprops" }); + + /* + * remove any sequence mappings left lying around by other tests + */ + StructureSelectionManager ssm = StructureSelectionManager + .getStructureSelectionManager(Desktop.instance); + ssm.resetAll(); } @BeforeMethod(alwaysRun = true) @@ -173,18 +180,19 @@ public class AlignViewportTest */ StructureSelectionManager ssm = StructureSelectionManager .getStructureSelectionManager(Desktop.instance); - assertEquals(2, ssm.getSequenceMappings().size()); - assertTrue(ssm.getSequenceMappings().contains(acf1)); - assertTrue(ssm.getSequenceMappings().contains(acf2)); + List sequenceMappings = ssm.getSequenceMappings(); + assertEquals(2, sequenceMappings.size()); + assertTrue(sequenceMappings.contains(acf1)); + assertTrue(sequenceMappings.contains(acf2)); /* * Close the second view. Verify that mappings are not removed as the first * view still holds a reference to them. */ af1.closeMenuItem_actionPerformed(false); - assertEquals(2, ssm.getSequenceMappings().size()); - assertTrue(ssm.getSequenceMappings().contains(acf1)); - assertTrue(ssm.getSequenceMappings().contains(acf2)); + assertEquals(2, sequenceMappings.size()); + assertTrue(sequenceMappings.contains(acf1)); + assertTrue(sequenceMappings.contains(acf2)); } /** -- 1.7.10.2