From: gmungoc Date: Mon, 21 Aug 2017 14:20:36 +0000 (+0100) Subject: JAL-2680 clear down all mappings before test X-Git-Tag: Release_2_10_3b1~149 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=5779b71c22d85070cbb59aa51a612d03f9744cc3;p=jalview.git JAL-2680 clear down all mappings before test --- 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)); } /**