Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Goldthorpe2010-03-16 20:27:02 +0000
committerChris Goldthorpe2010-03-16 20:27:02 +0000
commit52bd7604615087481e62cb3719e47e5d738b6fbf (patch)
tree80fb268f8188a3fc143f2e0f63d1029fc3012a35 /org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/toc
parent07cf06036d3cfe7c6c081a4ce9867d30ec3e3f4c (diff)
downloadeclipse.platform.ua-52bd7604615087481e62cb3719e47e5d738b6fbf.tar.gz
eclipse.platform.ua-52bd7604615087481e62cb3719e47e5d738b6fbf.tar.xz
eclipse.platform.ua-52bd7604615087481e62cb3719e47e5d738b6fbf.zip
Bug 306057 - [Webapp] Show in table of contents not working correctly for filtered topics
Diffstat (limited to 'org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/toc')
-rw-r--r--org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/toc/TopicFinderTest.java24
1 files changed, 13 insertions, 11 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 35cb55049..dcee387f3 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
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007 IBM Corporation and others.
+ * Copyright (c) 2007, 2010 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -14,6 +14,8 @@ package org.eclipse.ua.tests.help.toc;
import org.eclipse.help.IToc;
import org.eclipse.help.ITopic;
import org.eclipse.help.internal.HelpPlugin;
+import org.eclipse.help.internal.base.scope.FilterScope;
+import org.eclipse.help.internal.base.scope.UniversalScope;
import org.eclipse.help.internal.webapp.data.TocData;
import org.eclipse.help.internal.webapp.data.TopicFinder;
import org.eclipse.help.internal.webapp.data.UrlUtil;
@@ -31,20 +33,20 @@ public class TopicFinderTest extends TestCase{
}
public void testNoTocs() {
- TopicFinder finder = new TopicFinder("http:", new IToc[0]);
+ TopicFinder finder = new TopicFinder("http:", new IToc[0], new UniversalScope());
assertEquals(-1, finder.getSelectedToc());
assertNull(finder.getTopicPath());
}
public void testNoTopic() {
- TopicFinder finder = new TopicFinder(null, getTocs());
+ TopicFinder finder = new TopicFinder(null, getTocs(), new UniversalScope());
assertEquals(-1, finder.getSelectedToc());
assertNull(finder.getTopicPath());
}
public void testTopicInToc() {
String topic = "http://localhost:8082/help/topic/org.eclipse.ua.tests/data/help/manual/filter.xhtml";
- TopicFinder finder = new TopicFinder(topic, getTocs());
+ TopicFinder finder = new TopicFinder(topic, getTocs(), new UniversalScope());
int selectedToc = finder.getSelectedToc();
assertFalse(selectedToc == -1);
ITopic[] path = finder.getTopicPath();
@@ -58,7 +60,7 @@ public class TopicFinderTest extends TestCase{
public void testTopicInTocWithAnchor() {
String topic = "http://localhost:8082/help/topic/org.eclipse.ua.tests/data/help/manual/filter.xhtml#ABC";
- TopicFinder finder = new TopicFinder(topic, getTocs());
+ TopicFinder finder = new TopicFinder(topic, getTocs(), new UniversalScope());
int selectedToc = finder.getSelectedToc();
assertFalse(selectedToc == -1);
ITopic[] path = finder.getTopicPath();
@@ -72,7 +74,7 @@ public class TopicFinderTest extends TestCase{
public void testTopicInFilteredToc() {
String topic = "http://localhost:8082/help/topic/org.eclipse.ua.tests/data/help/toc/filteredToc/helpInstalled.html";
- TopicFinder finder = new TopicFinder(topic, getTocs());
+ TopicFinder finder = new TopicFinder(topic, getTocs(), new FilterScope());
int selectedToc = finder.getSelectedToc();
assertFalse(selectedToc == -1);
ITopic[] path = finder.getTopicPath();
@@ -87,7 +89,7 @@ public class TopicFinderTest extends TestCase{
public void testTopicNotInToc() {
String topic = "http://localhost:8082/help/topic/org.eclipse.ua.tests/data/help/manual/filter25.xhtml";
- TopicFinder finder = new TopicFinder(topic, getTocs());
+ TopicFinder finder = new TopicFinder(topic, getTocs(), new UniversalScope());
assertEquals(-1, finder.getSelectedToc());
assertNull(finder.getTopicPath());
}
@@ -95,12 +97,12 @@ public class TopicFinderTest extends TestCase{
public void testLookupFromPath() {
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);
+ TopicFinder finder = new TopicFinder(topic, tocs, new FilterScope());
String numericPath = finder.getNumericPath();
int tocIndex = finder.getSelectedToc();
String fullPath = "" + tocIndex + "_" + numericPath;
int[] intPath = UrlUtil.splitPath(fullPath);
- ITopic[] topics = TocData.decodePath(intPath, tocs[tocIndex]);
+ ITopic[] topics = TocData.decodePath(intPath, tocs[tocIndex], new FilterScope());
assertEquals(2, topics.length);
assertEquals("filter", topics[0].getLabel());
assertEquals("The plugin org.eclipse.help is installed", topics[1].getLabel());
@@ -110,10 +112,10 @@ public class TopicFinderTest extends TestCase{
public void testNavURL() {
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);
+ TopicFinder finder = new TopicFinder(topic, tocs, new UniversalScope());
int selectedToc = finder.getSelectedToc();
String navPath = "http://127.0.0.1:1936/help/nav/" + selectedToc;
- TopicFinder finder2 = new TopicFinder(navPath, tocs);
+ TopicFinder finder2 = new TopicFinder(navPath, tocs, new UniversalScope());
assertEquals(selectedToc, finder2.getSelectedToc());
assertEquals(0, finder2.getTopicPath().length);
}

Back to the top