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 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (19) |
Complexity: 2 |
Complexity Density: 0.12 |
|
12 |
|
public class PymolManagerTest |
13 |
|
{ |
|
|
| 100% |
Uncovered Elements: 0 (4) |
Complexity: 1 |
Complexity Density: 0.25 |
1PASS
|
|
14 |
1 |
@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 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (13) |
Complexity: 1 |
Complexity Density: 0.08 |
1PASS
|
|
30 |
1 |
@Test(groups = "Functional")... |
31 |
|
public void testGetPymolPaths() |
32 |
|
{ |
33 |
|
|
34 |
|
|
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 |
|
|
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 |
|
|
54 |
|
|
55 |
1 |
paths = PymolManager.getPymolPaths("Windows 10"); |
56 |
1 |
assertTrue(paths.isEmpty()); |
57 |
|
|
58 |
|
|
59 |
|
|
60 |
|
|
61 |
1 |
paths = PymolManager.getPymolPaths("VAX/VMS"); |
62 |
1 |
assertTrue(paths.isEmpty()); |
63 |
|
} |
64 |
|
} |