{
private ChimeraCommands testee;
- @BeforeClass
+ @BeforeClass(alwaysRun = true)
public void setUp()
{
testee = new ChimeraCommands();
@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");
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")
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");
+ }
}