diff options
author | Chris Goldthorpe | 2010-11-05 19:28:46 +0000 |
---|---|---|
committer | Chris Goldthorpe | 2010-11-05 19:28:46 +0000 |
commit | 3a4080d428bea007180b0379d9f661f1ae229539 (patch) | |
tree | b05c5964a23c070414369c5e0927393414e1f4ca /org.eclipse.ua.tests/help | |
parent | eb1bded5e44be4b86da60f6c02f6d79d75682515 (diff) | |
download | eclipse.platform.ua-3a4080d428bea007180b0379d9f661f1ae229539.tar.gz eclipse.platform.ua-3a4080d428bea007180b0379d9f661f1ae229539.tar.xz eclipse.platform.ua-3a4080d428bea007180b0379d9f661f1ae229539.zip |
Bug 329466 - [Webapp] Wrong topic was selected in the TOC tree
Diffstat (limited to 'org.eclipse.ua.tests/help')
-rw-r--r-- | org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/toc/TopicFinderTest.java | 34 |
1 files changed, 32 insertions, 2 deletions
diff --git a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/toc/TopicFinderTest.java b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/toc/TopicFinderTest.java index dcee387f3..7c969bfda 100644 --- a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/toc/TopicFinderTest.java +++ b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/toc/TopicFinderTest.java @@ -108,8 +108,8 @@ public class TopicFinderTest extends TestCase{ assertEquals("The plugin org.eclipse.help is installed", topics[1].getLabel()); assertEquals("/org.eclipse.ua.tests/data/help/toc/filteredToc/helpInstalled.html", topics[1].getHref()); } - - public void testNavURL() { + + public void testTocNavURL() { String topic = "http://localhost:8082/help/topic/org.eclipse.ua.tests/data/help/toc/filteredToc/helpInstalled.html"; IToc[] tocs = getTocs(); TopicFinder finder = new TopicFinder(topic, tocs, new UniversalScope()); @@ -119,5 +119,35 @@ public class TopicFinderTest extends TestCase{ assertEquals(selectedToc, finder2.getSelectedToc()); assertEquals(0, finder2.getTopicPath().length); } + + public void testTopic_0_0NavURL() { + checkNavTopic(0, 0); + } + + public void testTopic_0_1NavURL() { + checkNavTopic(0, 1); + } + + public void testTopic_1_0NavURL() { + checkNavTopic(1, 0); + } + + private void checkNavTopic(int index1, int index2) { + String topic = "http://localhost:8082/help/topic/org.eclipse.ua.tests/data/help/toc/filteredToc/helpInstalled.html"; + IToc[] tocs = getTocs(); + TopicFinder finder = new TopicFinder(topic, tocs, new UniversalScope()); + int selectedToc = finder.getSelectedToc(); + String navPath = "http://127.0.0.1:1936/help/nav/" + selectedToc + + '_' + index1 + '_' + index2; + TopicFinder finder2 = new TopicFinder(navPath, tocs, new UniversalScope()); + assertEquals(selectedToc, finder2.getSelectedToc()); + ITopic[] topicPath = finder2.getTopicPath(); + assertEquals(2, topicPath.length); + ITopic[] topLevelTopics = tocs[selectedToc].getTopics(); + assertEquals(topLevelTopics[index1], topicPath[0]); + ITopic[] secondLevelTopics = topLevelTopics[index1].getSubtopics(); + assertEquals(secondLevelTopics[index2], topicPath[1]); + assertEquals("" + index1 + '_' + index2, finder2.getNumericPath()); + } } |