1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
|
21 |
|
package jalview.datamodel; |
22 |
|
|
23 |
|
import static org.testng.AssertJUnit.assertFalse; |
24 |
|
import static org.testng.AssertJUnit.assertTrue; |
25 |
|
|
26 |
|
import jalview.gui.JvOptionPane; |
27 |
|
|
28 |
|
import org.testng.annotations.BeforeClass; |
29 |
|
import org.testng.annotations.Test; |
30 |
|
|
31 |
|
@Test |
|
|
| 94.7% |
Uncovered Elements: 1 (19) |
Complexity: 3 |
Complexity Density: 0.2 |
|
32 |
|
public class SequenceDummyTest |
33 |
|
{ |
34 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
35 |
1 |
@BeforeClass(alwaysRun = true)... |
36 |
|
public void setUpJvOptionPane() |
37 |
|
{ |
38 |
1 |
JvOptionPane.setInteractiveMode(false); |
39 |
1 |
JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); |
40 |
|
} |
41 |
|
|
42 |
|
|
43 |
|
|
44 |
|
|
|
|
| 93.3% |
Uncovered Elements: 1 (15) |
Complexity: 2 |
Complexity Density: 0.15 |
1PASS
|
|
45 |
1 |
@Test(groups = { "Functional" })... |
46 |
|
public void testBecome() |
47 |
|
{ |
48 |
1 |
SequenceI seq = new Sequence("OrigSeq", "ASEQUENCE"); |
49 |
1 |
SequenceFeature ofeat = new SequenceFeature("NewFeat", "somedesc", 3, |
50 |
|
12, 2.3f, "none"); |
51 |
|
|
52 |
1 |
SequenceDummy dummySeq = new SequenceDummy("OrigSeq"); |
53 |
1 |
dummySeq.addSequenceFeature(ofeat); |
54 |
1 |
dummySeq.become(seq); |
55 |
1 |
assertFalse("Dummy sequence did not become a full sequence", |
56 |
|
dummySeq.isDummy()); |
57 |
1 |
assertTrue("Sequence was not updated from template", seq |
58 |
|
.getSequenceAsString().equals(dummySeq.getSequenceAsString())); |
59 |
1 |
boolean found = false; |
60 |
1 |
for (SequenceFeature sf : dummySeq.getSequenceFeatures()) |
61 |
|
{ |
62 |
1 |
if (sf == ofeat) |
63 |
|
{ |
64 |
1 |
found = true; |
65 |
1 |
break; |
66 |
|
} |
67 |
|
} |
68 |
1 |
assertTrue("Didn't retain original sequence feature", found); |
69 |
|
|
70 |
|
|
71 |
|
} |
72 |
|
} |