Merge commit 'alpha/update_2_12_for_2_11_2_series_merge^2' into HEAD
[jalview.git] / test / jalview / ext / rbvi / chimera / ChimeraCommandsTest.java
index b040687..821ebde 100644 (file)
@@ -23,6 +23,7 @@ package jalview.ext.rbvi.chimera;
 import static org.testng.Assert.assertEquals;
 import static org.testng.Assert.assertTrue;
 
+
 import java.awt.Color;
 import java.util.HashMap;
 import java.util.LinkedHashMap;
@@ -33,8 +34,8 @@ import org.testng.annotations.BeforeClass;
 import org.testng.annotations.Test;
 
 import jalview.structure.AtomSpecModel;
+import jalview.structure.StructureCommand;
 import jalview.structure.StructureCommandI;
-
 public class ChimeraCommandsTest
 {
   private ChimeraCommands testee;
@@ -76,7 +77,6 @@ public class ChimeraCommandsTest
      */
     Map<String, Map<Object, AtomSpecModel>> featuresMap = new LinkedHashMap<>();
     Map<Object, AtomSpecModel> featureValues = new HashMap<>();
-
     /*
      * start with just one feature/value...
      */
@@ -187,7 +187,6 @@ public class ChimeraCommandsTest
     model.addRange("5", 25, 35, " ");
     assertEquals(testee.getAtomSpec(model, false),
             "#0:1-4.B,3-10.C|#1:2-5.A,8.A,5-10.B|#5:25-35.");
-
   }
 
   @Test(groups = { "Functional" })
@@ -347,4 +346,49 @@ public class ChimeraCommandsTest
     assertEquals(testee.setAttribute("jv_kd", "27.3", model).getCommand(),
             "setattr res jv_kd '27.3' #1:89-92.A|#2:8-9.B,12-20.B");
   }
+
+  @Test(groups = "Functional")
+  public void testCloseViewer()
+  {
+    assertEquals(testee.closeViewer(), new StructureCommand("stop really"));
+  }
+
+  @Test(groups = "Functional")
+  public void testGetSelectedResidues()
+  {
+    assertEquals(testee.getSelectedResidues(),
+            new StructureCommand("list selection level residue"));
+  }
+
+  @Test(groups = "Functional")
+  public void testListResidueAttributes()
+  {
+    assertEquals(testee.listResidueAttributes(),
+            new StructureCommand("list resattr"));
+  }
+
+  @Test(groups = "Functional")
+  public void testGetResidueAttributes()
+  {
+    assertEquals(testee.getResidueAttributes("binding site"),
+            new StructureCommand("list residues attr 'binding site'"));
+  }
+
+  @Test(groups = "Functional")
+  public void testStartNotifications()
+  {
+    List<StructureCommandI> cmds = testee.startNotifications("to here");
+    assertEquals(cmds.size(), 2);
+    assertEquals(cmds.get(0), new StructureCommand("listen start models url to here"));
+    assertEquals(cmds.get(1), new StructureCommand("listen start select 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("listen stop models"));
+    assertEquals(cmds.get(1), new StructureCommand("listen stop selection"));
+  }
 }