From: gmungoc Date: Mon, 17 Nov 2014 16:44:14 +0000 (+0000) Subject: JAL-1573 unit test added to verify Help target enum values. X-Git-Tag: Release_2_8_2b1^2~27 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=dcd9345f78d1aaee19fc20ddce0ed29d2eb8b587;p=jalview.git JAL-1573 unit test added to verify Help target enum values. --- 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)); + } + + } +}