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 |
|
|
|
|
| 0% |
Uncovered Elements: 18 (18) |
Complexity: 3 |
Complexity Density: 0.2 |
|
31 |
|
public class EnsemblProteinTest |
32 |
|
{ |
33 |
|
|
|
|
| 0% |
Uncovered Elements: 2 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
34 |
0 |
@BeforeClass(alwaysRun = true)... |
35 |
|
public void setUpJvOptionPane() |
36 |
|
{ |
37 |
0 |
JvOptionPane.setInteractiveMode(false); |
38 |
0 |
JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); |
39 |
|
} |
40 |
|
|
|
|
| 0% |
Uncovered Elements: 6 (6) |
Complexity: 1 |
Complexity Density: 0.17 |
4-
|
|
41 |
0 |
@Test(groups = "Functional")... |
42 |
|
public void testIsValidReference() throws Exception |
43 |
|
{ |
44 |
0 |
EnsemblSequenceFetcher esq = new EnsemblProtein(); |
45 |
0 |
Assert.assertTrue(esq.isValidReference("CCDS5863.1")); |
46 |
0 |
Assert.assertTrue(esq.isValidReference("ENSP00000288602")); |
47 |
0 |
Assert.assertFalse(esq.isValidReference("ENST00000288602")); |
48 |
0 |
Assert.assertFalse(esq.isValidReference("ENSG00000288602")); |
49 |
|
|
50 |
0 |
Assert.assertTrue(esq.isValidReference("ENSMUSP00000099398")); |
51 |
|
} |
52 |
|
|
|
|
| 0% |
Uncovered Elements: 7 (7) |
Complexity: 1 |
Complexity Density: 0.14 |
4-
|
|
53 |
0 |
@Test(groups = "Functional")... |
54 |
|
public void testGetAccesionIdFromQuery() throws Exception |
55 |
|
{ |
56 |
0 |
EnsemblSequenceFetcher esq = new EnsemblProtein(); |
57 |
0 |
assertEquals("ENSP00000288602", |
58 |
|
esq.getAccessionIdFromQuery("ENSP00000288602")); |
59 |
0 |
assertEquals("ENSMUSP00000288602", |
60 |
|
esq.getAccessionIdFromQuery("ENSMUSP00000288602")); |
61 |
|
|
62 |
|
|
63 |
0 |
assertEquals("ENSP00000288602", |
64 |
|
esq.getAccessionIdFromQuery("ENST00000288602")); |
65 |
0 |
assertEquals("ENSMUSP00000288602", |
66 |
|
esq.getAccessionIdFromQuery("ENSMUST00000288602")); |
67 |
|
|
68 |
|
|
69 |
0 |
assertEquals("ENSP00000288604", |
70 |
|
esq.getAccessionIdFromQuery("ENSP00000288604 ENSP00000288602")); |
71 |
|
|
72 |
|
|
73 |
0 |
assertEquals("ENSP00000288604,ENSP00000288602", |
74 |
|
esq.getAccessionIdFromQuery("ENSP00000288604,ENSP00000288602")); |
75 |
|
} |
76 |
|
|
77 |
|
} |