1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
|
21 |
|
package jalview.io.gff; |
22 |
|
|
23 |
|
import static org.testng.AssertJUnit.assertNull; |
24 |
|
import static org.testng.AssertJUnit.assertSame; |
25 |
|
import static org.testng.AssertJUnit.assertTrue; |
26 |
|
|
27 |
|
import jalview.gui.JvOptionPane; |
28 |
|
|
29 |
|
import org.testng.annotations.BeforeClass; |
30 |
|
import org.testng.annotations.Test; |
31 |
|
|
|
|
| 0% |
Uncovered Elements: 32 (32) |
Complexity: 2 |
Complexity Density: 0.07 |
|
32 |
|
public class GffHelperFactoryTest |
33 |
|
{ |
34 |
|
|
|
|
| 0% |
Uncovered Elements: 2 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
35 |
0 |
@BeforeClass(alwaysRun = true)... |
36 |
|
public void setUpJvOptionPane() |
37 |
|
{ |
38 |
0 |
JvOptionPane.setInteractiveMode(false); |
39 |
0 |
JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); |
40 |
|
} |
41 |
|
|
|
|
| 0% |
Uncovered Elements: 28 (28) |
Complexity: 1 |
Complexity Density: 0.04 |
4-
|
|
42 |
0 |
@Test(groups = "Functional")... |
43 |
|
public void testGetHelper() |
44 |
|
{ |
45 |
0 |
assertNull(GffHelperFactory.getHelper(null)); |
46 |
|
|
47 |
0 |
String tabRegex = "\\t"; |
48 |
|
|
49 |
|
|
50 |
|
|
51 |
|
|
52 |
0 |
String gff = "submitted\taffine:local\tsimilarity\t20\t30\t99\t+\t.\t"; |
53 |
|
|
54 |
0 |
assertTrue(GffHelperFactory |
55 |
|
.getHelper(gff.split(tabRegex)) instanceof Gff2Helper); |
56 |
|
|
57 |
|
|
58 |
0 |
gff = "submitted\taffine:local\tsimilarity\t20\t30\t99\t+\t.\tID=$1"; |
59 |
0 |
assertSame(GffHelperFactory.getHelper(gff.split(tabRegex)).getClass(), |
60 |
|
Gff3Helper.class); |
61 |
|
|
62 |
|
|
63 |
0 |
gff = "submitted\texonerate:protein2dna:local\tsimilarity\t20\t30\t99\t+\t.\tID=$1"; |
64 |
0 |
assertTrue(GffHelperFactory |
65 |
|
.getHelper(gff.split(tabRegex)) instanceof ExonerateHelper); |
66 |
|
|
67 |
0 |
gff = "submitted\tprotein2genome\tsimilarity\t20\t30\t99\t+\t.\tID=$1"; |
68 |
0 |
assertTrue(GffHelperFactory |
69 |
|
.getHelper(gff.split(tabRegex)) instanceof ExonerateHelper); |
70 |
|
|
71 |
0 |
gff = "submitted\tcoding2coding\tsimilarity\t20\t30\t99\t+\t.\tID=$1"; |
72 |
0 |
assertTrue(GffHelperFactory |
73 |
|
.getHelper(gff.split(tabRegex)) instanceof ExonerateHelper); |
74 |
|
|
75 |
0 |
gff = "submitted\tcoding2genome\tsimilarity\t20\t30\t99\t+\t.\tID=$1"; |
76 |
0 |
assertTrue(GffHelperFactory |
77 |
|
.getHelper(gff.split(tabRegex)) instanceof ExonerateHelper); |
78 |
|
|
79 |
0 |
gff = "submitted\tcdna2genome\tsimilarity\t20\t30\t99\t+\t.\tID=$1"; |
80 |
0 |
assertTrue(GffHelperFactory |
81 |
|
.getHelper(gff.split(tabRegex)) instanceof ExonerateHelper); |
82 |
|
|
83 |
0 |
gff = "submitted\tgenome2genome\tsimilarity\t20\t30\t99\t+\t.\tID=$1"; |
84 |
0 |
assertTrue(GffHelperFactory |
85 |
|
.getHelper(gff.split(tabRegex)) instanceof ExonerateHelper); |
86 |
|
|
87 |
|
|
88 |
0 |
gff = "submitted\tgenome2genome\tSIMILARITY\t20\t30\t99\t+\t.\tID=$1"; |
89 |
0 |
assertTrue(GffHelperFactory |
90 |
|
.getHelper(gff.split(tabRegex)) instanceof ExonerateHelper); |
91 |
|
|
92 |
|
|
93 |
|
|
94 |
|
|
95 |
0 |
gff = "Submitted\tPANTHER\tprotein_match\t1\t1174\t0.0\t+\t.\tName=PTHR32154"; |
96 |
0 |
assertTrue(GffHelperFactory |
97 |
|
.getHelper(gff.split(tabRegex)) instanceof InterProScanHelper); |
98 |
|
|
99 |
|
|
100 |
|
|
101 |
|
|
102 |
0 |
gff = "nothing\tinteresting\there\t20\t30\t99\t+\t.\tID=1"; |
103 |
0 |
GffHelperI helper = GffHelperFactory.getHelper(gff.split(tabRegex)); |
104 |
0 |
assertSame(helper.getClass(), Gff3Helper.class); |
105 |
|
|
106 |
|
|
107 |
0 |
gff = "nothing\tinteresting\there\t20\t30\t99\t+\t.\tID 1"; |
108 |
0 |
helper = GffHelperFactory.getHelper(gff.split(tabRegex)); |
109 |
0 |
assertSame(helper.getClass(), Gff2Helper.class); |
110 |
|
} |
111 |
|
} |