JAL-3518 separation of ChimeraXManager, pull up of closeViewer etc
[jalview.git] / test / jalview / ext / rbvi / chimera / ChimeraXCommandsTest.java
index cb951c6..c1fa528 100644 (file)
@@ -33,6 +33,7 @@ import org.testng.annotations.BeforeClass;
 import org.testng.annotations.Test;
 
 import jalview.structure.AtomSpecModel;
+import jalview.structure.StructureCommand;
 import jalview.structure.StructureCommandI;
 
 public class ChimeraXCommandsTest
@@ -322,4 +323,35 @@ public class ChimeraXCommandsTest
             .getCommand(),
             "setattr #1/A:89-92|#2/B:8-9,12-20 res jv_kd '27.3' create true");
   }
+
+  @Test(groups = "Functional")
+  public void testCloseViewer()
+  {
+    assertEquals(testee.closeViewer(), new StructureCommand("exit"));
+  }
+
+  @Test(groups = "Functional")
+  public void testGetSelectedResidues()
+  {
+    assertEquals(testee.getSelectedResidues(),
+            new StructureCommand("info selection level residue"));
+  }
+
+  @Test(groups = "Functional")
+  public void testStartNotifications()
+  {
+    List<StructureCommandI> cmds = testee.startNotifications("to here");
+    assertEquals(cmds.size(), 2);
+    assertEquals(cmds.get(0), new StructureCommand("info notify start models prefix ModelChanged jalview url to here"));
+    assertEquals(cmds.get(1), new StructureCommand("info notify start selection jalview prefix SelectionChanged url to here"));
+  }
+
+  @Test(groups = "Functional")
+  public void testStopNotifications()
+  {
+    List<StructureCommandI> cmds = testee.stopNotifications();
+    assertEquals(cmds.size(), 2);
+    assertEquals(cmds.get(0), new StructureCommand("info notify stop models jalview"));
+    assertEquals(cmds.get(1), new StructureCommand("info notify stop selection jalview"));
+  }
 }