Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCurtis D'Entremont2006-03-02 00:10:25 +0000
committerCurtis D'Entremont2006-03-02 00:10:25 +0000
commit94ff6f30fee5393bf8c5563bbd4040068f357e3c (patch)
treeb3e990764296852127f7ce37e2d4b6aecc5858e3 /org.eclipse.ua.tests
parent488c04382d19f95121b443ec6d7972789c6082d3 (diff)
downloadeclipse.platform.ua-94ff6f30fee5393bf8c5563bbd4040068f357e3c.tar.gz
eclipse.platform.ua-94ff6f30fee5393bf8c5563bbd4040068f357e3c.tar.xz
eclipse.platform.ua-94ff6f30fee5393bf8c5563bbd4040068f357e3c.zip
130051 [Help] Search dynamic content properlyv20060301
Diffstat (limited to 'org.eclipse.ua.tests')
-rw-r--r--org.eclipse.ua.tests/META-INF/MANIFEST.MF6
-rw-r--r--org.eclipse.ua.tests/data/help/search/extension.xml7
-rw-r--r--org.eclipse.ua.tests/data/help/search/extension2.xml7
-rw-r--r--org.eclipse.ua.tests/data/help/search/test1.xhtml22
-rw-r--r--org.eclipse.ua.tests/data/help/search/test2.xhtml24
-rw-r--r--org.eclipse.ua.tests/data/help/search/test3.xhtml16
-rw-r--r--org.eclipse.ua.tests/data/help/search/test4.xhtml17
-rw-r--r--org.eclipse.ua.tests/data/help/search/test5.xhtml18
-rw-r--r--org.eclipse.ua.tests/data/help/search/test6.xhtml20
-rw-r--r--org.eclipse.ua.tests/data/help/search/toc.xml11
-rw-r--r--org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/AllHelpTests.java2
-rw-r--r--org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/search/AllSearchTests.java34
-rw-r--r--org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/search/XHTMLTest.java190
-rw-r--r--org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/toc/ParserTest.java28
-rw-r--r--org.eclipse.ua.tests/plugin.xml44
15 files changed, 433 insertions, 13 deletions
diff --git a/org.eclipse.ua.tests/META-INF/MANIFEST.MF b/org.eclipse.ua.tests/META-INF/MANIFEST.MF
index b9cdd46ca..327faf934 100644
--- a/org.eclipse.ua.tests/META-INF/MANIFEST.MF
+++ b/org.eclipse.ua.tests/META-INF/MANIFEST.MF
@@ -5,15 +5,17 @@ Bundle-SymbolicName: org.eclipse.ua.tests;singleton:=true
Bundle-Version: 3.2.0.qualifier
Bundle-Activator: org.eclipse.ua.tests.plugin.UserAssistanceTestPlugin
Bundle-Localization: plugin
-Require-Bundle: org.junit,
+Require-Bundle: org.apache.lucene,
+ org.junit,
org.eclipse.core.resources,
org.eclipse.core.runtime,
org.eclipse.help,
org.eclipse.help.appserver,
+ org.eclipse.help.base,
+ org.eclipse.help.ui,
org.eclipse.ui,
org.eclipse.ui.cheatsheets,
org.eclipse.ui.intro,
- org.eclipse.help.ui,
org.eclipse.ui.forms
Eclipse-LazyStart: true
Bundle-Vendor: Eclipse.org
diff --git a/org.eclipse.ua.tests/data/help/search/extension.xml b/org.eclipse.ua.tests/data/help/search/extension.xml
new file mode 100644
index 000000000..db66ffd16
--- /dev/null
+++ b/org.eclipse.ua.tests/data/help/search/extension.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<contentExtension>
+ <topicExtension
+ content="data/help/search/test3.xhtml"
+ path="org.eclipse.ua.tests/data/help/search/test5.xhtml/test5_anchor"/>
+</contentExtension>
diff --git a/org.eclipse.ua.tests/data/help/search/extension2.xml b/org.eclipse.ua.tests/data/help/search/extension2.xml
new file mode 100644
index 000000000..e5206dd6b
--- /dev/null
+++ b/org.eclipse.ua.tests/data/help/search/extension2.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<contentExtension>
+ <topicReplace
+ content="data/help/search/test3.xhtml"
+ path="org.eclipse.ua.tests/data/help/search/test6.xhtml/test6_paragraph_to_replace"/>
+</contentExtension>
diff --git a/org.eclipse.ua.tests/data/help/search/test1.xhtml b/org.eclipse.ua.tests/data/help/search/test1.xhtml
new file mode 100644
index 000000000..d52fe3277
--- /dev/null
+++ b/org.eclipse.ua.tests/data/help/search/test1.xhtml
@@ -0,0 +1,22 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<title>test1.xhtml</title>
+</head>
+
+<body>
+<p>
+This paragraph is never filtered out, and is used as a sanity test. Here's a unique word
+to search for as part of this test: jehcyqpfjs vkrhjewiwh
+</p>
+
+<p filter="os=invalid">
+This paragraph is always filtered out, and is used to ensure that searching does not
+flag this document as a hit. Here is a unique word to search for: gsdduvfqnh
+vkrhjewiwh riehguanil
+</p>
+
+</body>
+</html>
diff --git a/org.eclipse.ua.tests/data/help/search/test2.xhtml b/org.eclipse.ua.tests/data/help/search/test2.xhtml
new file mode 100644
index 000000000..6a3e40b3f
--- /dev/null
+++ b/org.eclipse.ua.tests/data/help/search/test2.xhtml
@@ -0,0 +1,24 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<title>test2.xhtml</title>
+</head>
+
+<body>
+
+<p>
+This test is to ensure that searching properly reacts to changes in filters.
+It will turn the activity on and off and ensure that the search hit comes and goes
+depending on the activity enablement.
+rugnwjfyqj
+</p>
+
+<p filter="activity=org.eclipse.ua.tests.activity">
+This paragraph should only be filtered out when the "org.eclipse.ua.tests.activity"
+activity is not enabled. Here is a unique word to search for: qjfuhemaok
+</p>
+
+</body>
+</html>
diff --git a/org.eclipse.ua.tests/data/help/search/test3.xhtml b/org.eclipse.ua.tests/data/help/search/test3.xhtml
new file mode 100644
index 000000000..b079596eb
--- /dev/null
+++ b/org.eclipse.ua.tests/data/help/search/test3.xhtml
@@ -0,0 +1,16 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<title>test3.xhtml</title>
+</head>
+
+<body>
+
+<p id="test3_paragraph">
+This paragraph is to be included into other docs. fuejnghqjs
+</p>
+
+</body>
+</html>
diff --git a/org.eclipse.ua.tests/data/help/search/test4.xhtml b/org.eclipse.ua.tests/data/help/search/test4.xhtml
new file mode 100644
index 000000000..9bc05e766
--- /dev/null
+++ b/org.eclipse.ua.tests/data/help/search/test4.xhtml
@@ -0,0 +1,17 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<title>test4.xhtml</title>
+</head>
+
+<body>
+
+<p>
+There is an include below that includes a paragraph from test3.xhtml:
+</p>
+<include path="org.eclipse.ua.tests/data/help/search/test3.xhtml/test3_paragraph"/>
+
+</body>
+</html>
diff --git a/org.eclipse.ua.tests/data/help/search/test5.xhtml b/org.eclipse.ua.tests/data/help/search/test5.xhtml
new file mode 100644
index 000000000..61e2de9ba
--- /dev/null
+++ b/org.eclipse.ua.tests/data/help/search/test5.xhtml
@@ -0,0 +1,18 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<title>test5.xhtml</title>
+</head>
+
+<body>
+
+<p>
+There is an anchor below where an extension should contribute a paragraph
+from test3 to it:
+</p>
+<anchor id="test5_anchor" />
+
+</body>
+</html>
diff --git a/org.eclipse.ua.tests/data/help/search/test6.xhtml b/org.eclipse.ua.tests/data/help/search/test6.xhtml
new file mode 100644
index 000000000..c0f521687
--- /dev/null
+++ b/org.eclipse.ua.tests/data/help/search/test6.xhtml
@@ -0,0 +1,20 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<title>test6.xhtml</title>
+</head>
+
+<body>
+
+<p>
+There paragraph below should be replaced by another paragraph from test3.xhtml:
+</p>
+<p id="test6_paragraph_to_replace">
+This is the paragraph from test6.xhtml that should be replaced with one from
+test3.xhtml. If you're seeing this then it's not working. bheufnjefa
+</p>
+
+</body>
+</html>
diff --git a/org.eclipse.ua.tests/data/help/search/toc.xml b/org.eclipse.ua.tests/data/help/search/toc.xml
new file mode 100644
index 000000000..5e7591950
--- /dev/null
+++ b/org.eclipse.ua.tests/data/help/search/toc.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?NLS TYPE="org.eclipse.help.toc"?>
+
+<toc label="Search test TOC">
+ <topic label="test1.xhtml" href="data/help/search/test1.xhtml"/>
+ <topic label="test2.xhtml" href="data/help/search/test2.xhtml"/>
+ <topic label="test3.xhtml" href="data/help/search/test3.xhtml"/>
+ <topic label="test4.xhtml" href="data/help/search/test4.xhtml"/>
+ <topic label="test5.xhtml" href="data/help/search/test5.xhtml"/>
+ <topic label="test6.xhtml" href="data/help/search/test6.xhtml"/>
+</toc>
diff --git a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/AllHelpTests.java b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/AllHelpTests.java
index 8a044eae6..5e0f756a5 100644
--- a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/AllHelpTests.java
+++ b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/AllHelpTests.java
@@ -14,6 +14,7 @@ import junit.framework.Test;
import junit.framework.TestSuite;
import org.eclipse.ua.tests.help.context.AllContextTests;
+import org.eclipse.ua.tests.help.search.AllSearchTests;
import org.eclipse.ua.tests.help.toc.AllTocTests;
/*
@@ -33,6 +34,7 @@ public class AllHelpTests extends TestSuite {
*/
public AllHelpTests() {
addTest(AllContextTests.suite());
+ addTest(AllSearchTests.suite());
addTest(AllTocTests.suite());
}
}
diff --git a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/search/AllSearchTests.java b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/search/AllSearchTests.java
new file mode 100644
index 000000000..34f2fe5ed
--- /dev/null
+++ b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/search/AllSearchTests.java
@@ -0,0 +1,34 @@
+/*******************************************************************************
+ * Copyright (c) 2006 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.ua.tests.help.search;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+/*
+ * Tests help functionality (automated).
+ */
+public class AllSearchTests extends TestSuite {
+
+ /*
+ * Returns the entire test suite.
+ */
+ public static Test suite() {
+ return new AllSearchTests();
+ }
+
+ /*
+ * Constructs a new test suite.
+ */
+ public AllSearchTests() {
+ addTest(XHTMLTest.suite());
+ }
+}
diff --git a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/search/XHTMLTest.java b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/search/XHTMLTest.java
new file mode 100644
index 000000000..c1a7a8dd1
--- /dev/null
+++ b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/search/XHTMLTest.java
@@ -0,0 +1,190 @@
+/*******************************************************************************
+ * Copyright (c) 2006 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.ua.tests.help.search;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Set;
+
+import junit.framework.Assert;
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.help.internal.base.BaseHelpSystem;
+import org.eclipse.help.internal.search.ISearchQuery;
+import org.eclipse.help.internal.search.SearchHit;
+import org.eclipse.help.internal.search.SearchQuery;
+import org.eclipse.help.internal.search.SearchResults;
+import org.eclipse.help.ui.internal.HelpUIPlugin;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.activities.IWorkbenchActivitySupport;
+
+public class XHTMLTest extends TestCase {
+
+ /*
+ * The test data for testXHTMLSearch(). The first string in each array
+ * is the word to search for. The rest are the expected hits' hrefs.
+ */
+ private static final String[][] EXPECTED_RESULTS = {
+ // sanity test
+ { "jehcyqpfjs", "/org.eclipse.ua.tests/data/help/search/test1.xhtml" },
+
+ // appears in both filtered and unfiltered parts of test1.xhtml
+ { "vkrhjewiwh", "/org.eclipse.ua.tests/data/help/search/test1.xhtml" },
+
+ // try OR'ing with a word that does't exist.. should find same result
+ { "vkrhjewiwh OR this_string_shouldnt_exist_in_any_doc", "/org.eclipse.ua.tests/data/help/search/test1.xhtml" },
+
+ // try OR'ing with a string from another doc.. should find both
+ { "vkrhjewiwh OR rugnwjfyqj", "/org.eclipse.ua.tests/data/help/search/test1.xhtml", "/org.eclipse.ua.tests/data/help/search/test2.xhtml" },
+
+ // these two words only appear next to each other in a paragraph that's always filtered out
+ { "\"vkrhjewiwh riehguanil\"", /* no hits */ },
+
+ // first one should be found, but second one only exists in a paragraph that's always filtered out
+ { "vkrhjewiwh AND riehguanil", /* no hits */ },
+
+ // only exists in paragraph that's always filtered out
+ { "gsdduvfqnh", /* no hits */ },
+
+ // word is in test3.xhtml and also included by test4.xhtml, contributed
+ // into test5.xhtml as an extension, and replaces a paragraph in test6.xhtml.
+ { "fuejnghqjs", "/org.eclipse.ua.tests/data/help/search/test3.xhtml", "/org.eclipse.ua.tests/data/help/search/test4.xhtml", "/org.eclipse.ua.tests/data/help/search/test5.xhtml", "/org.eclipse.ua.tests/data/help/search/test6.xhtml" },
+
+ // only exists in paragraph in test6.xhtml that's replaced by another one
+ { "bheufnjefa", /* no hits */ },
+ };
+
+ /*
+ * Returns an instance of this Test.
+ */
+ public static Test suite() {
+ return new TestSuite(XHTMLTest.class);
+ }
+
+ /*
+ * Ensure that org.eclipse.help.ui is started. It contributes extra content
+ * filtering that is used by this test. See UIContentFilterProcessor.
+ */
+ protected void setUp() throws Exception {
+ HelpUIPlugin.getDefault();
+ }
+
+ public void testXHTMLSearch() throws Exception {
+ for (int i=0;i<EXPECTED_RESULTS.length;++i) {
+ String searchWord = EXPECTED_RESULTS[i][0];
+ final Set hrefsToFind = new HashSet();
+ final Set unexpectedHrefs = new HashSet();
+
+ String[] hrefs = new String[EXPECTED_RESULTS[i].length - 1];
+ System.arraycopy(EXPECTED_RESULTS[i], 1, hrefs, 0, hrefs.length);
+ hrefsToFind.addAll(Arrays.asList(hrefs));
+
+ ISearchQuery query = new SearchQuery(searchWord, false, new ArrayList(), Platform.getNL());
+ SearchResults collector = new SearchResults(null, 500, Platform.getNL());
+ BaseHelpSystem.getSearchManager().search(query, collector, new NullProgressMonitor());
+ SearchHit[] hits = collector.getSearchHits();
+ for (int j=0;j<hits.length;++j) {
+ String href = hits[j].getHref();
+ // ignore query params
+ int index = href.indexOf('?');
+ if (index != -1) {
+ href = href.substring(0, index);
+ }
+ if (hrefsToFind.contains(href)) {
+ hrefsToFind.remove(href);
+ }
+ else {
+ unexpectedHrefs.add(href);
+ }
+ }
+
+ if (!hrefsToFind.isEmpty() || !unexpectedHrefs.isEmpty()) {
+ StringBuffer buf = new StringBuffer();
+ buf.append("While searching for: " + searchWord + ",\n");
+ if (!hrefsToFind.isEmpty()) {
+ buf.append("Some of the expected results were not found:\n");
+ Iterator iter = hrefsToFind.iterator();
+ while (iter.hasNext()) {
+ String missedHref = (String)iter.next();
+ buf.append(missedHref + "\n");
+ }
+ }
+ if (!unexpectedHrefs.isEmpty()) {
+ if (!hrefsToFind.isEmpty()) {
+ buf.append("\nAlso,\n");
+ }
+ buf.append("Found some unexpected search results:\n");
+ Iterator iter = unexpectedHrefs.iterator();
+ while (iter.hasNext()) {
+ String unexpectedHref = (String)iter.next();
+ buf.append(unexpectedHref + "\n");
+ }
+ }
+ Assert.fail(buf.toString());
+ }
+ }
+ }
+
+ /**
+ * Tests searching with changing filtering conditions. Activities, for
+ * example, can change during a session, and the search should only
+ * find content that is *currently* not filtered out.
+ */
+ public void testXHTMLActivityFilteringSearch() throws Exception {
+ String searchWord = "qjfuhemaok";
+ String href = "/org.eclipse.ua.tests/data/help/search/test2.xhtml";
+ String testActivity = "org.eclipse.ua.tests.activity";
+ ISearchQuery query = new SearchQuery(searchWord, false, new ArrayList(), Platform.getNL());
+ IWorkbenchActivitySupport activitySupport = PlatformUI.getWorkbench().getActivitySupport();
+ Set withoutTestActivity = activitySupport.getActivityManager().getEnabledActivityIds();
+ Set withTestActivity = new HashSet(withoutTestActivity);
+ withTestActivity.add(testActivity);
+
+ // first try with activity turned off - should not find it
+ activitySupport.setEnabledActivityIds(withoutTestActivity);
+ SearchResults collector = new SearchResults(null, 500, Platform.getNL());
+ BaseHelpSystem.getSearchManager().search(query, collector, new NullProgressMonitor());
+ Assert.assertTrue("Found an unexpected search result. Was searching for string in a paragraph filtered by activity, and the activity was turned off, but the search came back positive", !containsHref(href, collector.getSearchHits()));
+
+ // now try with it turned on - should find it
+ activitySupport.setEnabledActivityIds(withTestActivity);
+ collector = new SearchResults(null, 500, Platform.getNL());
+ BaseHelpSystem.getSearchManager().search(query, collector, new NullProgressMonitor());
+ Assert.assertTrue("Did not find an expected search result. Was searching for string in a paragraph filtered by activity, and the activity was turned on, but the search came back negative", containsHref(href, collector.getSearchHits()));
+
+ // finally try again with it turned off - should not find it
+ activitySupport.setEnabledActivityIds(withoutTestActivity);
+ collector = new SearchResults(null, 500, Platform.getNL());
+ BaseHelpSystem.getSearchManager().search(query, collector, new NullProgressMonitor());
+ Assert.assertTrue("Found an unexpected search result. Was searching for string in a paragraph filtered by activity, and the activity was turned off, but the search came back positive (second attempt)", !containsHref(href, collector.getSearchHits()));
+ }
+
+ private static boolean containsHref(String href, SearchHit[] hits) {
+ for (int i=0;i<hits.length;++i) {
+ String hitHref = hits[i].getHref();
+ // ignore query params
+ int index = hitHref.indexOf('?');
+ if (index != -1) {
+ hitHref = hitHref.substring(0, index);
+ }
+ if (href.equals(hitHref)) {
+ return true;
+ }
+ }
+ return false;
+ }
+}
diff --git a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/toc/ParserTest.java b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/toc/ParserTest.java
index 4336a9494..66e6bbbbd 100644
--- a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/toc/ParserTest.java
+++ b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/toc/ParserTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * Copyright (c) 2006 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
@@ -60,16 +60,22 @@ public class ParserTest extends TestCase {
Bundle bundle = UserAssistanceTestPlugin.getDefault().getBundle();
String pluginRoot = bundle.getLocation().substring("update@".length());
String relativePath = file.getHref();
- String absolutePath = pluginRoot + relativePath;
- String resultFile = FileUtil.getResultFile(absolutePath);
-
- try {
- String expected = FileUtil.getContents(bundle, FileUtil.getResultFile(relativePath, true));
- String actual = TocModelSerializer.serialize(toc);
- Assert.assertEquals("Serialized toc model for " + relativePath + "did not match the expected result: " + FileUtil.getResultFile(relativePath), expected, actual);
- }
- catch(IOException e) {
- Assert.fail("An error occured while loading expected result file for TOC at: " + resultFile + ": " + e);
+
+ /*
+ * Only test what's in the toc test data folder.
+ */
+ if (relativePath.startsWith("data/help/toc/")) {
+ String absolutePath = pluginRoot + relativePath;
+ String resultFile = FileUtil.getResultFile(absolutePath);
+
+ try {
+ String expected = FileUtil.getContents(bundle, FileUtil.getResultFile(relativePath, true));
+ String actual = TocModelSerializer.serialize(toc);
+ Assert.assertEquals("Serialized toc model for " + relativePath + "did not match the expected result: " + FileUtil.getResultFile(relativePath), expected, actual);
+ }
+ catch(IOException e) {
+ Assert.fail("An error occured while loading expected result file for TOC at: " + resultFile + ": " + e);
+ }
}
}
}
diff --git a/org.eclipse.ua.tests/plugin.xml b/org.eclipse.ua.tests/plugin.xml
index 07909a229..771b33d42 100644
--- a/org.eclipse.ua.tests/plugin.xml
+++ b/org.eclipse.ua.tests/plugin.xml
@@ -239,6 +239,50 @@
<toc file="data/help/toc/filteredToc/toc.xml" primary="true" />
<toc file="data/help/toc/filteredToc/filter.xml" />
<toc file="data/help/toc/filteredToc/simple_toc.xml" />
+ <toc file="data/help/search/toc.xml" primary="true"/>
+ </extension>
+
+ <!--
+ For testing dynamic content
+ -->
+ <extension
+ point="org.eclipse.help.contentProducer">
+ <binding producerId="org.eclipse.help.dynamic"/>
+ </extension>
+
+ <!--
+ For testing XHTML content
+ -->
+ <extension
+ point="org.eclipse.help.base.luceneSearchParticipants">
+ <binding participantId="org.eclipse.help.base.xhtml"/>
+ </extension>
+
+ <!--
+ An activity used to test searching (see
+ XHTMLTest#testXHTMLActivityFilteringSearch())
+ -->
+ <extension
+ point="org.eclipse.ui.activities">
+ <category
+ name="testCategory"
+ description="testCategoryDescription"
+ id="org.eclipse.ua.tests.activity.category">
+ </category>
+ <activity
+ name="testActivity"
+ description="testActivityDescription"
+ id="org.eclipse.ua.tests.activity">
+ </activity>
+ <categoryActivityBinding
+ activityId="org.eclipse.ua.tests.activity"
+ categoryId="org.eclipse.ua.tests.activity.category">
+ </categoryActivityBinding>
+ </extension>
+
+ <extension point= "org.eclipse.help.contentExtension">
+ <contentExtension file="data/help/search/extension.xml"/>
+ <contentExtension file="data/help/search/extension2.xml"/>
</extension>
</plugin>

Back to the top