1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
|
21 |
|
package jalview.gui; |
22 |
|
|
23 |
|
import java.awt.Color; |
24 |
|
import java.io.File; |
25 |
|
import java.util.Iterator; |
26 |
|
|
27 |
|
import org.junit.Assert; |
28 |
|
import org.testng.annotations.AfterMethod; |
29 |
|
import org.testng.annotations.BeforeClass; |
30 |
|
import org.testng.annotations.BeforeMethod; |
31 |
|
import org.testng.annotations.Test; |
32 |
|
|
33 |
|
import jalview.analysis.AlignmentAnnotationUtils; |
34 |
|
import jalview.api.FeatureColourI; |
35 |
|
import jalview.bin.Cache; |
36 |
|
import jalview.bin.Jalview; |
37 |
|
import jalview.datamodel.Alignment; |
38 |
|
import jalview.datamodel.AlignmentI; |
39 |
|
import jalview.datamodel.HiddenColumns; |
40 |
|
import jalview.datamodel.PDBEntry; |
41 |
|
import jalview.datamodel.Sequence; |
42 |
|
import jalview.datamodel.SequenceFeature; |
43 |
|
import jalview.datamodel.SequenceGroup; |
44 |
|
import jalview.datamodel.SequenceI; |
45 |
|
import jalview.io.DataSourceType; |
46 |
|
import jalview.io.FileLoader; |
47 |
|
import jalview.project.Jalview2xmlTests; |
48 |
|
import jalview.renderer.ResidueShaderI; |
49 |
|
import jalview.schemes.BuriedColourScheme; |
50 |
|
import jalview.schemes.FeatureColour; |
51 |
|
import jalview.schemes.HelixColourScheme; |
52 |
|
import jalview.schemes.JalviewColourScheme; |
53 |
|
import jalview.schemes.StrandColourScheme; |
54 |
|
import jalview.schemes.TurnColourScheme; |
55 |
|
import jalview.util.MessageManager; |
56 |
|
|
|
|
| 92.6% |
Uncovered Elements: 2 (27) |
Complexity: 8 |
Complexity Density: 0.44 |
|
57 |
|
public class AssociatePDBFileTest |
58 |
|
{ |
59 |
|
AlignFrame af; |
60 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (3) |
Complexity: 1 |
Complexity Density: 0.33 |
|
61 |
1 |
@BeforeClass(alwaysRun = true)... |
62 |
|
public static void setUpBeforeClass() throws Exception |
63 |
|
{ |
64 |
1 |
setUpJvOptionPane(); |
65 |
|
|
66 |
|
|
67 |
|
|
68 |
1 |
Cache.loadProperties("test/jalview/io/testProps.jvprops"); |
69 |
1 |
Jalview.main(new String[] { "--nonews" }); |
70 |
|
} |
71 |
|
|
|
|
| 75% |
Uncovered Elements: 1 (4) |
Complexity: 2 |
Complexity Density: 1 |
|
72 |
1 |
@AfterMethod(alwaysRun = true)... |
73 |
|
public void tearDown() |
74 |
|
{ |
75 |
1 |
if (Desktop.instance != null) |
76 |
1 |
Desktop.instance.closeAll_actionPerformed(null); |
77 |
|
} |
78 |
|
|
79 |
|
|
80 |
|
|
81 |
|
|
82 |
|
|
|
|
| 87.5% |
Uncovered Elements: 1 (8) |
Complexity: 3 |
Complexity Density: 0.5 |
|
83 |
1 |
@BeforeMethod(alwaysRun = true)... |
84 |
|
public void setUp() |
85 |
|
{ |
86 |
1 |
Cache.loadProperties("test/jalview/io/testProps.jvprops"); |
87 |
1 |
Cache.applicationProperties.setProperty("SHOW_IDENTITY", |
88 |
|
Boolean.TRUE.toString()); |
89 |
1 |
af = new FileLoader().LoadFileWaitTillLoaded(">1GAQ|A/19-314\n" |
90 |
|
+ "ESKKQEEGVVTNLYKPKEPYVGRCLLNTKITGDDAPGETWHMVFSTEGKIPYREGQSIGVIADGVDKNGKPH\n" |
91 |
|
+ "KVRLYSIASSAIGDFGDSKTVSLCVKRLIYTNDAGEIVKGVCSNFLCDLQPGDNVQITGPVGKEMLMPKDPN\n" |
92 |
|
+ "ATIIMLATGTGIAPFRSFLWKMFFEKHDDYKFNGLGWLFLGVPTSSSLLYKEEFGKMKERAPENFRVDYAVS\n" |
93 |
|
+ "REQTNAAGERMYIQTRMAEYKEELWELLKKDNTYVYMCGLKGMEKGIDDIMVSLAEKDGIDWFDYKKQLKRG\n" |
94 |
|
+ "DQWNVEVY\n" + ">1GAQ|B/1-98\n" |
95 |
|
+ "ATYNVKLITPEGEVELQVPDDVYILDQAEEDGIDLPYSCRAGSCSSCAGKVVSGSVDQSDQSYLDDGQIADG\n" |
96 |
|
+ "WVLTCHAYPTSDVVIETHKEEELTGA\n" + ">1GAQ|C/19-314\n" |
97 |
|
+ "ESKKQEEGVVTNLYKPKEPYVGRCLLNTKITGDDAPGETWHMVFSTEGKIPYREGQSIGVIADGVDKNGKPH\n" |
98 |
|
+ "KVRLYSIASSAIGDFGDSKTVSLCVKRLIYTNDAGEIVKGVCSNFLCDLQPGDNVQITGPVGKEMLMPKDPN\n" |
99 |
|
+ "ATIIMLATGTGIAPFRSFLWKMFFEKHDDYKFNGLGWLFLGVPTSSSLLYKEEFGKMKERAPENFRVDYAVS\n" |
100 |
|
+ "REQTNAAGERMYIQTRMAEYKEELWELLKKDNTYVYMCGLKGMEKGIDDIMVSLAEKDGIDWFDYKKQLKRG\n" |
101 |
|
+ "DQWNVEVY\n", DataSourceType.PASTE); |
102 |
|
|
103 |
|
|
104 |
|
|
105 |
|
|
106 |
1 |
do |
107 |
|
{ |
108 |
1 |
try |
109 |
|
{ |
110 |
1 |
Thread.sleep(50); |
111 |
|
} catch (InterruptedException x) |
112 |
|
{ |
113 |
|
} |
114 |
1 |
} while (af.getViewport().getCalcManager().isWorking()); |
115 |
|
} |
116 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
117 |
1 |
public static void setUpJvOptionPane()... |
118 |
|
{ |
119 |
1 |
JvOptionPane.setInteractiveMode(false); |
120 |
1 |
JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); |
121 |
|
} |
122 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (5) |
Complexity: 1 |
Complexity Density: 0.2 |
1PASS
|
|
123 |
1 |
@Test(groups = "Functional")... |
124 |
|
public void testAssociatePDBFile() |
125 |
|
{ |
126 |
1 |
String assoc_file = "examples/1gaq.txt"; |
127 |
1 |
for (SequenceI toassoc : af.getViewport().getAlignment().getSequences()) |
128 |
|
{ |
129 |
3 |
PDBEntry pe = new AssociatePdbFileWithSeq().associatePdbWithSeq( |
130 |
|
assoc_file, DataSourceType.FILE, toassoc, false, |
131 |
|
Desktop.instance); |
132 |
3 |
Assert.assertNotNull(pe); |
133 |
3 |
Assert.assertNotEquals( |
134 |
|
toassoc.getDatasetSequence().getAnnotation().length, 0); |
135 |
|
} |
136 |
|
} |
137 |
|
} |