1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
|
21 |
|
package jalview.ext.ensembl; |
22 |
|
|
23 |
|
import static org.testng.AssertJUnit.assertEquals; |
24 |
|
|
25 |
|
import jalview.gui.JvOptionPane; |
26 |
|
|
27 |
|
import org.testng.Assert; |
28 |
|
import org.testng.annotations.BeforeClass; |
29 |
|
import org.testng.annotations.Test; |
30 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (18) |
Complexity: 3 |
Complexity Density: 0.2 |
|
31 |
|
public class EnsemblProteinTest |
32 |
|
{ |
33 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
34 |
1 |
@BeforeClass(alwaysRun = true)... |
35 |
|
public void setUpJvOptionPane() |
36 |
|
{ |
37 |
1 |
JvOptionPane.setInteractiveMode(false); |
38 |
1 |
JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); |
39 |
|
} |
40 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (6) |
Complexity: 1 |
Complexity Density: 0.17 |
1PASS
|
|
41 |
1 |
@Test(groups = "Functional")... |
42 |
|
public void testIsValidReference() throws Exception |
43 |
|
{ |
44 |
1 |
EnsemblSequenceFetcher esq = new EnsemblProtein(); |
45 |
1 |
Assert.assertTrue(esq.isValidReference("CCDS5863.1")); |
46 |
1 |
Assert.assertTrue(esq.isValidReference("ENSP00000288602")); |
47 |
1 |
Assert.assertFalse(esq.isValidReference("ENST00000288602")); |
48 |
1 |
Assert.assertFalse(esq.isValidReference("ENSG00000288602")); |
49 |
|
|
50 |
1 |
Assert.assertTrue(esq.isValidReference("ENSMUSP00000099398")); |
51 |
|
} |
52 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (7) |
Complexity: 1 |
Complexity Density: 0.14 |
1PASS
|
|
53 |
1 |
@Test(groups = "Functional")... |
54 |
|
public void testGetAccesionIdFromQuery() throws Exception |
55 |
|
{ |
56 |
1 |
EnsemblSequenceFetcher esq = new EnsemblProtein(); |
57 |
1 |
assertEquals("ENSP00000288602", |
58 |
|
esq.getAccessionIdFromQuery("ENSP00000288602")); |
59 |
1 |
assertEquals("ENSMUSP00000288602", |
60 |
|
esq.getAccessionIdFromQuery("ENSMUSP00000288602")); |
61 |
|
|
62 |
|
|
63 |
1 |
assertEquals("ENSP00000288602", |
64 |
|
esq.getAccessionIdFromQuery("ENST00000288602")); |
65 |
1 |
assertEquals("ENSMUSP00000288602", |
66 |
|
esq.getAccessionIdFromQuery("ENSMUST00000288602")); |
67 |
|
|
68 |
|
|
69 |
1 |
assertEquals("ENSP00000288604", |
70 |
|
esq.getAccessionIdFromQuery("ENSP00000288604 ENSP00000288602")); |
71 |
|
|
72 |
|
|
73 |
1 |
assertEquals("ENSP00000288604,ENSP00000288602", |
74 |
|
esq.getAccessionIdFromQuery("ENSP00000288604,ENSP00000288602")); |
75 |
|
} |
76 |
|
|
77 |
|
} |