1 package jalview.ext.pymol;
3 import static org.testng.Assert.assertEquals;
4 import static org.testng.Assert.assertTrue;
8 import org.testng.annotations.Test;
10 import jalview.structure.StructureCommand;
12 public class PymolManagerTest
14 @Test(groups = "Functional")
15 public void testGetPostRequest()
17 String req = PymolManager
18 .getPostRequest(new StructureCommand("foobar"));
20 "<methodCall><methodName>foobar</methodName><params></params></methodCall>");
23 .getPostRequest(new StructureCommand("foobar", "blue", "all"));
24 assertEquals(req, "<methodCall><methodName>foobar</methodName><params>"
25 + "<parameter><value>blue</value></parameter>"
26 + "<parameter><value>all</value></parameter>"
27 + "</params></methodCall>");
30 @Test(groups = "Functional")
31 public void testGetPymolPaths()
36 List<String> paths = PymolManager.getPymolPaths("Mac OS X");
37 assertEquals(paths.size(), 1);
39 paths.contains("/Applications/PyMOL.app/Contents/MacOS/PyMOL"));
44 paths = PymolManager.getPymolPaths("Linux i386 1.5.0");
45 assertTrue(paths.contains("/usr/local/pymol/bin/PyMOL"));
46 assertTrue(paths.contains("/usr/local/bin/PyMOL"));
47 assertTrue(paths.contains("/usr/bin/PyMOL"));
48 assertTrue(paths.contains("/usr/local/pymol/bin/PyMOL"));
50 .contains(System.getProperty("user.home") + "/opt/bin/PyMOL"));
55 paths = PymolManager.getPymolPaths("Windows 10");
56 assertTrue(paths.isEmpty()); // TODO - Windows paths
61 paths = PymolManager.getPymolPaths("VAX/VMS");
62 assertTrue(paths.isEmpty());