JAL-2680 remove all mappings in test teardown
authorgmungoc <g.m.carstairs@dundee.ac.uk>
Tue, 22 Aug 2017 15:03:01 +0000 (16:03 +0100)
committergmungoc <g.m.carstairs@dundee.ac.uk>
Tue, 22 Aug 2017 15:03:01 +0000 (16:03 +0100)
test/jalview/io/FeaturesFileTest.java

index 3b688db..152ab84 100644 (file)
@@ -34,7 +34,9 @@ import jalview.datamodel.SequenceFeature;
 import jalview.datamodel.SequenceI;
 import jalview.datamodel.features.SequenceFeatures;
 import jalview.gui.AlignFrame;
+import jalview.gui.Desktop;
 import jalview.gui.JvOptionPane;
+import jalview.structure.StructureSelectionManager;
 
 import java.awt.Color;
 import java.io.File;
@@ -45,11 +47,24 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
+import org.testng.annotations.AfterClass;
 import org.testng.annotations.BeforeClass;
 import org.testng.annotations.Test;
 
 public class FeaturesFileTest
 {
+  private static String simpleGffFile = "examples/testdata/simpleGff3.gff";
+
+  @AfterClass(alwaysRun = true)
+  public void tearDownAfterClass()
+  {
+    /*
+     * remove any sequence mappings created so they don't pollute other tests
+     */
+    StructureSelectionManager ssm = StructureSelectionManager
+            .getStructureSelectionManager(Desktop.instance);
+    ssm.resetAll();
+  }
 
   @BeforeClass(alwaysRun = true)
   public void setUpJvOptionPane()
@@ -58,8 +73,6 @@ public class FeaturesFileTest
     JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION);
   }
 
-  private static String simpleGffFile = "examples/testdata/simpleGff3.gff";
-
   @Test(groups = { "Functional" })
   public void testParse() throws Exception
   {