X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=test%2Fjalview%2Fext%2Frbvi%2Fchimera%2FChimeraCommandsTest.java;fp=test%2Fjalview%2Fext%2Frbvi%2Fchimera%2FChimeraCommandsTest.java;h=fd4ec69dbd1859a940ee119a3627b9ed01351f01;hb=d69378a7c7a19760bcc240c8c082476fe50f99ae;hp=b8ca2dd9baaa5b98b78dea85b0b280f02079c8d0;hpb=8b795f97aa57877aee49a46778283706dbf3e71b;p=jalview.git diff --git a/test/jalview/ext/rbvi/chimera/ChimeraCommandsTest.java b/test/jalview/ext/rbvi/chimera/ChimeraCommandsTest.java index b8ca2dd..fd4ec69 100644 --- a/test/jalview/ext/rbvi/chimera/ChimeraCommandsTest.java +++ b/test/jalview/ext/rbvi/chimera/ChimeraCommandsTest.java @@ -61,11 +61,10 @@ public class ChimeraCommandsTest // Colours should appear in the Chimera command in the order in which // they were added; within colour, by model, by chain, ranges in start order - // all prefixed with #808080 to colour hidden regions (if shown) gray List commands = testee.colourBySequence(map); assertEquals(commands.size(), 1); assertEquals(commands.get(0).getCommand(), - "color #808080; color #0000ff #0:2-5.A,9-23.A,7.B|#1:1.A,4-7.B;color #ffff00 #1:3-5.A,8.A;color #ff0000 #0:3-9.A"); + "color #0000ff #0:2-5.A,9-23.A,7.B|#1:1.A,4-7.B;color #ffff00 #1:3-5.A,8.A;color #ff0000 #0:3-9.A"); } @Test(groups = { "Functional" }) @@ -340,4 +339,39 @@ 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 testHideAll() + { + StructureCommandI cmd = testee.hideAll(); + assertEquals(cmd.getCommand(), "~display all; ~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"); + } }