1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
|
21 |
|
package jalview.io; |
22 |
|
|
23 |
|
import java.util.Date; |
24 |
|
|
25 |
|
import org.testng.annotations.AfterClass; |
26 |
|
import org.testng.annotations.BeforeClass; |
27 |
|
import org.testng.annotations.BeforeTest; |
28 |
|
|
29 |
|
import jalview.bin.Cache; |
30 |
|
import jalview.bin.Jalview; |
31 |
|
import jalview.datamodel.AlignmentAnnotation; |
32 |
|
import jalview.datamodel.SequenceI; |
33 |
|
import jalview.gui.Desktop; |
34 |
|
import jalview.gui.JvOptionPane; |
35 |
|
|
|
|
| 0% |
Uncovered Elements: 30 (30) |
Complexity: 11 |
Complexity Density: 0.65 |
|
36 |
|
public class Jalview2xmlBase |
37 |
|
{ |
38 |
|
|
|
|
| 0% |
Uncovered Elements: 2 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
39 |
0 |
@BeforeClass(alwaysRun = true)... |
40 |
|
public void setUpJvOptionPane() |
41 |
|
{ |
42 |
0 |
JvOptionPane.setInteractiveMode(false); |
43 |
0 |
JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); |
44 |
|
} |
45 |
|
|
46 |
|
|
47 |
|
@throws |
48 |
|
|
|
|
| 0% |
Uncovered Elements: 4 (4) |
Complexity: 1 |
Complexity Density: 0.25 |
|
49 |
0 |
@BeforeClass(alwaysRun = true)... |
50 |
|
public static void setUpBeforeClass() throws Exception |
51 |
|
{ |
52 |
|
|
53 |
|
|
54 |
|
|
55 |
0 |
Cache.loadProperties("test/jalview/io/testProps.jvprops"); |
56 |
|
|
57 |
|
|
58 |
|
|
59 |
|
|
60 |
|
|
61 |
0 |
Date oneHourFromNow = new Date( |
62 |
|
System.currentTimeMillis() + 3600 * 1000); |
63 |
0 |
Cache.setDateProperty("JALVIEW_NEWS_RSS_LASTMODIFIED", oneHourFromNow); |
64 |
|
|
65 |
0 |
Jalview.main(new String[] {}); |
66 |
|
} |
67 |
|
|
68 |
|
|
69 |
|
@throws |
70 |
|
|
|
|
| 0% |
Uncovered Elements: 4 (4) |
Complexity: 2 |
Complexity Density: 1 |
|
71 |
0 |
@AfterClass(alwaysRun = true)... |
72 |
|
public static void tearDownAfterClass() throws Exception |
73 |
|
{ |
74 |
0 |
if (Desktop.instance != null) |
75 |
0 |
Desktop.instance.closeAll_actionPerformed(null); |
76 |
|
} |
77 |
|
|
|
|
| 0% |
Uncovered Elements: 4 (4) |
Complexity: 4 |
Complexity Density: 2 |
|
78 |
0 |
@BeforeTest(alwaysRun = true)... |
79 |
|
public static void clearDesktop() |
80 |
|
{ |
81 |
0 |
if (Desktop.instance != null && Desktop.getFrames() != null |
82 |
|
&& Desktop.getFrames().length > 0) |
83 |
|
{ |
84 |
0 |
Desktop.instance.closeAll_actionPerformed(null); |
85 |
|
} |
86 |
|
} |
87 |
|
|
|
|
| 0% |
Uncovered Elements: 11 (11) |
Complexity: 3 |
Complexity Density: 0.43 |
|
88 |
0 |
public int countDsAnn(jalview.viewmodel.AlignmentViewport avp)... |
89 |
|
{ |
90 |
0 |
int numdsann = 0; |
91 |
0 |
for (SequenceI sq : avp.getAlignment().getDataset().getSequences()) |
92 |
|
{ |
93 |
0 |
if (sq.getAnnotation() != null) |
94 |
|
{ |
95 |
0 |
for (AlignmentAnnotation dssa : sq.getAnnotation()) |
96 |
|
{ |
97 |
0 |
if (dssa.isValidStruc()) |
98 |
|
{ |
99 |
0 |
numdsann++; |
100 |
|
} |
101 |
|
} |
102 |
|
} |
103 |
|
} |
104 |
0 |
return numdsann; |
105 |
|
} |
106 |
|
|
107 |
|
} |