JAL-3783 Reverting to using groovy-all-2.4.12-indy.jar to fix serious problem with...
[jalview.git] / test / jalview / ext / rbvi / chimera / ChimeraXCommandsTest.java
index 7441fee..f677cab 100644 (file)
@@ -33,13 +33,14 @@ 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
 {
   private ChimeraXCommands testee;
 
-  @BeforeClass
+  @BeforeClass(alwaysRun = true)
   public void setUp()
   {
     testee = new ChimeraXCommands();
@@ -322,4 +323,42 @@ 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"));
+  }
+
+  @Test(groups = "Functional")
+  public void testListResidueAttributes()
+  {
+    assertEquals(testee.listResidueAttributes(),
+            new StructureCommand("info resattr"));
+  }
 }