From dcd9345f78d1aaee19fc20ddce0ed29d2eb8b587 Mon Sep 17 00:00:00 2001 From: gmungoc Date: Mon, 17 Nov 2014 16:44:14 +0000 Subject: [PATCH] JAL-1573 unit test added to verify Help target enum values. --- test/jalview/gui/HelpTest.java | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 test/jalview/gui/HelpTest.java diff --git a/test/jalview/gui/HelpTest.java b/test/jalview/gui/HelpTest.java new file mode 100644 index 0000000..e4068d7 --- /dev/null +++ b/test/jalview/gui/HelpTest.java @@ -0,0 +1,32 @@ +package jalview.gui; + +import static org.junit.Assert.assertTrue; +import jalview.gui.Help.HelpId; + +import java.net.URL; + +import javax.help.HelpSet; +import javax.help.HelpSetException; +import javax.help.Map; + +import org.junit.Test; + +public class HelpTest +{ + @Test + public void checkHelpTargets() throws HelpSetException + { + ClassLoader cl = Desktop.class.getClassLoader(); + URL url = HelpSet.findHelpSet(cl, "help/help"); // $NON-NLS-$ + HelpSet hs = new HelpSet(cl, url); + Map targets = hs.getLocalMap(); + + for (HelpId id : HelpId.values()) + { + String target = id.toString(); + assertTrue("Unmatched target enum: " + target, + targets.isValidID(target, hs)); + } + + } +} -- 1.7.10.2