+
+ @Test(groups = "Functional")
+ public void testColourByChain()
+ {
+ StructureCommandI cmd = testee.colourByChain();
+ assertEquals(cmd.getCommand(), "select *;color chain");
+ }
+
+ @Test(groups = "Functional")
+ public void testColourByCharge()
+ {
+ List<StructureCommandI> cmds = testee.colourByCharge();
+ assertEquals(cmds.size(), 1);
+ assertEquals(cmds.get(0).getCommand(),
+ "select *;color white;select ASP,GLU;color red;"
+ + "select LYS,ARG;color blue;select CYS;color yellow");
+ }
+
+ @Test(groups = "Functional")
+ public void testSetBackgroundColour()
+ {
+ StructureCommandI cmd = testee.setBackgroundColour(Color.PINK);
+ assertEquals(cmd.getCommand(), "background [255, 175, 175]");
+ }
+
+ @Test(groups = "Functional")
+ public void testFocusView()
+ {
+ StructureCommandI cmd = testee.focusView();
+ assertEquals(cmd.getCommand(), "zoom 0");
+ }
+
+ @Test(groups = "Functional")
+ public void testSaveSession()
+ {
+ StructureCommandI cmd = testee.saveSession("/some/filepath");
+ assertEquals(cmd.getCommand(), "write STATE \"/some/filepath\"");
+ }
+
+ @Test(groups = "Functional")
+ public void testShowBackbone()
+ {
+ List<StructureCommandI> cmds = testee.showBackbone();
+ assertEquals(cmds.size(), 1);
+ assertEquals(cmds.get(0).getCommand(),
+ "select *; cartoons off; backbone");
+ }
+
+ @Test(groups = "Functional")
+ public void testLoadFile()
+ {
+ StructureCommandI cmd = testee.loadFile("/some/filepath");
+ assertEquals(cmd.getCommand(), "load FILES \"/some/filepath\"");
+
+ // single backslash gets escaped to double
+ cmd = testee.loadFile("\\some\\filepath");
+ assertEquals(cmd.getCommand(), "load FILES \"\\\\some\\\\filepath\"");
+ }
+
+ @Test(groups = "Functional")
+ public void testOpenSession()
+ {
+ StructureCommandI cmd = testee.openSession("/some/filepath");
+ assertEquals(cmd.getCommand(), "load FILES \"/some/filepath\"");
+
+ // single backslash gets escaped to double
+ cmd = testee.openSession("\\some\\filepath");
+ assertEquals(cmd.getCommand(), "load FILES \"\\\\some\\\\filepath\"");
+ }