Clover icon

Coverage Report

  1. Project Clover database Thu Aug 13 2020 12:04:21 BST
  2. Package jalview.ext.pymol

File PymolManagerTest.java

 

Code metrics

0
17
2
1
64
42
2
0.12
8.5
2
1

Classes

Class Line # Actions
PymolManagerTest 12 17 2
1.0100%
 

Contributing tests

This file is covered by 2 tests. .

Source view

1    package jalview.ext.pymol;
2   
3    import static org.testng.Assert.assertEquals;
4    import static org.testng.Assert.assertTrue;
5   
6    import java.util.List;
7   
8    import org.testng.annotations.Test;
9   
10    import jalview.structure.StructureCommand;
11   
 
12    public class PymolManagerTest
13    {
 
14  1 toggle @Test(groups = "Functional")
15    public void testGetPostRequest()
16    {
17  1 String req = PymolManager
18    .getPostRequest(new StructureCommand("foobar"));
19  1 assertEquals(req,
20    "<methodCall><methodName>foobar</methodName><params></params></methodCall>");
21   
22  1 req = PymolManager
23    .getPostRequest(new StructureCommand("foobar", "blue", "all"));
24  1 assertEquals(req, "<methodCall><methodName>foobar</methodName><params>"
25    + "<parameter><value>blue</value></parameter>"
26    + "<parameter><value>all</value></parameter>"
27    + "</params></methodCall>");
28    }
29   
 
30  1 toggle @Test(groups = "Functional")
31    public void testGetPymolPaths()
32    {
33    /*
34    * OSX
35    */
36  1 List<String> paths = PymolManager.getPymolPaths("Mac OS X");
37  1 assertEquals(paths.size(), 1);
38  1 assertTrue(
39    paths.contains("/Applications/PyMOL.app/Contents/MacOS/PyMOL"));
40   
41    /*
42    * Linux
43    */
44  1 paths = PymolManager.getPymolPaths("Linux i386 1.5.0");
45  1 assertTrue(paths.contains("/usr/local/pymol/bin/PyMOL"));
46  1 assertTrue(paths.contains("/usr/local/bin/PyMOL"));
47  1 assertTrue(paths.contains("/usr/bin/PyMOL"));
48  1 assertTrue(paths.contains("/usr/local/pymol/bin/PyMOL"));
49  1 assertTrue(paths
50    .contains(System.getProperty("user.home") + "/opt/bin/PyMOL"));
51   
52    /*
53    * Windows
54    */
55  1 paths = PymolManager.getPymolPaths("Windows 10");
56  1 assertTrue(paths.isEmpty()); // TODO - Windows paths
57   
58    /*
59    * Other
60    */
61  1 paths = PymolManager.getPymolPaths("VAX/VMS");
62  1 assertTrue(paths.isEmpty());
63    }
64    }