JAL-3253 jalview.bin.Instance streamlining
[jalview.git] / test / jalview / gui / AlignViewportTest.java
index 20b4988..71378fe 100644 (file)
@@ -28,7 +28,6 @@ import static org.testng.AssertJUnit.assertSame;
 import static org.testng.AssertJUnit.assertTrue;
 
 import jalview.bin.Cache;
-import jalview.bin.Instance;
 import jalview.bin.Jalview;
 import jalview.datamodel.AlignedCodonFrame;
 import jalview.datamodel.Alignment;
@@ -80,9 +79,7 @@ public class AlignViewportTest
     /*
      * remove any sequence mappings left lying around by other tests
      */
-    StructureSelectionManager ssm = StructureSelectionManager
-            .getStructureSelectionManager(Instance.getDesktop());
-    ssm.resetAll();
+    Desktop.getStructureSelectionManager().resetAll();
   }
 
   @BeforeMethod(alwaysRun = true)
@@ -128,9 +125,8 @@ public class AlignViewportTest
      * Verify that creating the alignment for the new View has registered the
      * mappings
      */
-    StructureSelectionManager ssm = StructureSelectionManager
-            .getStructureSelectionManager(Instance.getDesktop());
-    List<AlignedCodonFrame> sequenceMappings = ssm.getSequenceMappings();
+    List<AlignedCodonFrame> sequenceMappings = Desktop
+            .getStructureSelectionManager().getSequenceMappings();
     assertEquals(2, sequenceMappings.size());
     assertTrue(sequenceMappings.contains(acf1));
     assertTrue(sequenceMappings.contains(acf2));
@@ -151,10 +147,9 @@ public class AlignViewportTest
   @Test(groups = { "Functional" })
   public void testDeregisterMapping_withNoReference()
   {
-    Desktop d = Instance.getDesktop();
+    Desktop d = Desktop.getInstance();
     assertNotNull(d);
-    StructureSelectionManager ssm = StructureSelectionManager
-            .getStructureSelectionManager(Instance.getDesktop());
+    StructureSelectionManager ssm = Desktop.getStructureSelectionManager();
     ssm.resetAll();
 
     AlignFrame af1 = new FileLoader().LoadFileWaitTillLoaded(
@@ -214,10 +209,9 @@ public class AlignViewportTest
   @Test(groups = { "Functional" })
   public void testDeregisterMapping_withReference()
   {
-    Desktop d = Instance.getDesktop();
+    Desktop d = Desktop.getInstance();
     assertNotNull(d);
-    StructureSelectionManager ssm = StructureSelectionManager
-            .getStructureSelectionManager(Instance.getDesktop());
+    StructureSelectionManager ssm = Desktop.getStructureSelectionManager();
     ssm.resetAll();
 
     AlignFrame af1 = new FileLoader().LoadFileWaitTillLoaded(