Merge branch 'develop' into feature/JAL-3390hideUnmappedStructure
[jalview.git] / test / jalview / ext / rbvi / chimera / ChimeraCommandsTest.java
index 6880985..8bfb677 100644 (file)
@@ -49,7 +49,6 @@ public class ChimeraCommandsTest
   @Test(groups = { "Functional" })
   public void testColourBySequence()
   {
-
     Map<Object, AtomSpecModel> map = new LinkedHashMap<>();
     ChimeraCommands.addAtomSpecRange(map, Color.blue, "0", 2, 5, "A");
     ChimeraCommands.addAtomSpecRange(map, Color.blue, "0", 7, 7, "B");
@@ -249,13 +248,6 @@ public class ChimeraCommandsTest
     model.addRange("5", 25, 35, " "); // empty chain code
     assertEquals(testee.getAtomSpec(model, true),
             "#0:1-4.B,3-10.C@CA&~@.B-Z&~@.2-9|#1:2-5.A,8.A,5-10.B@CA&~@.B-Z&~@.2-9|#5:25-35.@CA&~@.B-Z&~@.2-9");
-
-  }
-
-  @Test(groups = "Functional")
-  public void testGetModelStartNo()
-  {
-    assertEquals(testee.getModelStartNo(), 0);
   }
 
   @Test(groups = "Functional")
@@ -350,6 +342,40 @@ public class ChimeraCommandsTest
   }
 
   @Test(groups = "Functional")
+  public void testHideAll()
+  {
+    StructureCommandI cmd = testee.hideAll();
+    assertEquals(cmd.getCommand(), "~display; ~ribbon");
+  }
+
+  @Test(groups = "Functional")
+  public void testHideChain()
+  {
+    StructureCommandI cmd = testee.hideChain("1.1", "B");
+    assertEquals(cmd.getCommand(), "~ribbon #1.1:.B");
+  }
+
+  @Test(groups = "Functional")
+  public void testShowStructures()
+  {
+    /*
+     * with nothing excluded
+     */
+    StructureCommandI cmd = testee.showStructures(null);
+    assertEquals(cmd.getCommand(), "ribbon");
+
+    /*
+     * restricted to specified positions
+     */
+    AtomSpecModel restrictTo = new AtomSpecModel();
+    restrictTo.addRange("1.1", 12, 20, "A");
+    restrictTo.addRange("1.1", 30, 35, "A");
+    restrictTo.addRange("2.1", 11, 30, "B");
+    cmd = testee.showStructures(restrictTo);
+    assertEquals(cmd.getCommand(),
+            "ribbon #1.1:12-20.A,30-35.A|#2.1:11-30.B");
+  }
+
   public void testCloseViewer()
   {
     assertEquals(testee.closeViewer(), new StructureCommand("stop really"));