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 static org.testng.AssertJUnit.assertTrue; |
24 |
|
|
25 |
|
import jalview.gui.Help.HelpId; |
26 |
|
|
27 |
|
import java.net.URL; |
28 |
|
|
29 |
|
import javax.help.HelpSet; |
30 |
|
import javax.help.HelpSetException; |
31 |
|
import javax.help.Map; |
32 |
|
|
33 |
|
import org.testng.annotations.BeforeClass; |
34 |
|
import org.testng.annotations.Test; |
35 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (11) |
Complexity: 2 |
Complexity Density: 0.22 |
|
36 |
|
public class HelpTest |
37 |
|
{ |
38 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
39 |
1 |
@BeforeClass(alwaysRun = true)... |
40 |
|
public void setUpJvOptionPane() |
41 |
|
{ |
42 |
1 |
JvOptionPane.setInteractiveMode(false); |
43 |
1 |
JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); |
44 |
|
} |
45 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (7) |
Complexity: 1 |
Complexity Density: 0.14 |
1PASS
|
|
46 |
1 |
@Test(groups = { "Functional" })... |
47 |
|
public void checkHelpTargets() throws HelpSetException |
48 |
|
{ |
49 |
1 |
ClassLoader cl = Desktop.class.getClassLoader(); |
50 |
1 |
URL url = HelpSet.findHelpSet(cl, "help/help"); |
51 |
1 |
HelpSet hs = new HelpSet(cl, url); |
52 |
1 |
Map targets = hs.getLocalMap(); |
53 |
|
|
54 |
1 |
for (HelpId id : HelpId.values()) |
55 |
|
{ |
56 |
5 |
String target = id.getId(); |
57 |
5 |
assertTrue("Unmatched target enum: " + target, |
58 |
|
targets.isValidID(target, hs)); |
59 |
|
} |
60 |
|
|
61 |
|
} |
62 |
|
} |