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"));
25 "<methodCall><methodName>foobar</methodName><params>"
26 + "<parameter><value>blue</value></parameter>"
27 + "<parameter><value>all</value></parameter>"
28 + "</params></methodCall>");
31 @Test(groups = "Functional")
32 public void testGetPymolPaths()
37 List<String> paths = PymolManager.getPymolPaths("Mac OS X");
38 assertEquals(paths.size(), 1);
40 paths.contains("/Applications/PyMOL.app/Contents/MacOS/PyMOL"));
45 paths = PymolManager.getPymolPaths("Linux i386 1.5.0");
46 assertTrue(paths.contains("/usr/local/pymol/bin/PyMOL"));
47 assertTrue(paths.contains("/usr/local/bin/PyMOL"));
48 assertTrue(paths.contains("/usr/bin/PyMOL"));
49 assertTrue(paths.contains("/usr/local/pymol/bin/PyMOL"));
51 .contains(System.getProperty("user.home") + "/opt/bin/PyMOL"));
56 paths = PymolManager.getPymolPaths("Windows 10");
57 assertTrue(paths.isEmpty()); // TODO - Windows paths
62 paths = PymolManager.getPymolPaths("VAX/VMS");
63 assertTrue(paths.isEmpty());