Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--org.eclipse.ua.tests/data/help/search/test6.xhtml4
-rw-r--r--org.eclipse.ua.tests/data/help/search/testProvider.xhtml16
-rw-r--r--org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/search/BasicTest.java12
-rw-r--r--org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/search/UATestContentExtensionProvider.java57
-rw-r--r--org.eclipse.ua.tests/plugin.xml3
5 files changed, 91 insertions, 1 deletions
diff --git a/org.eclipse.ua.tests/data/help/search/test6.xhtml b/org.eclipse.ua.tests/data/help/search/test6.xhtml
index c0f521687..e65165195 100644
--- a/org.eclipse.ua.tests/data/help/search/test6.xhtml
+++ b/org.eclipse.ua.tests/data/help/search/test6.xhtml
@@ -15,6 +15,10 @@ There paragraph below should be replaced by another paragraph from test3.xhtml:
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>
+<p id="test6_paragraph_to_replace2">
+This is the paragraph from test6.xhtml that should be replaced with one from
+testProvider.xhtml. If you're seeing this then it's not working. bheufnjefb
+</p>
</body>
</html>
diff --git a/org.eclipse.ua.tests/data/help/search/testProvider.xhtml b/org.eclipse.ua.tests/data/help/search/testProvider.xhtml
new file mode 100644
index 000000000..6cac36f46
--- /dev/null
+++ b/org.eclipse.ua.tests/data/help/search/testProvider.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>testProvider.xhtml</title>
+</head>
+
+<body>
+
+<p id="testProvider_paragraph">
+This paragraph is to be included into other docs. ausjduehf
+</p>
+
+</body>
+</html>
diff --git a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/search/BasicTest.java b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/search/BasicTest.java
index d7b8ac334..68680de57 100644
--- a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/search/BasicTest.java
+++ b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/search/BasicTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2009 IBM Corporation and others.
+ * Copyright (c) 2006, 2011 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
@@ -70,6 +70,16 @@ public class BasicTest extends TestCase {
SearchTestUtils.searchAllLocales("bheufnjefa", new String[0] /* no hits*/ );
}
+ // Test replacement using ExtensionProvider
+ public void testSearchInReplaceOutUsingProvider() {
+ SearchTestUtils.searchAllLocales("ausjduehf", new String[] {"/org.eclipse.ua.tests/data/help/search/test6.xhtml" } );
+ }
+
+ // Test replacement using ExtensionProvider
+ public void testSearchInReplacemenTextUsingProvider() {
+ SearchTestUtils.searchAllLocales("bheufnjefb", new String[0] /* no hits*/ );
+ }
+
// sanity test to make sure it finds things in XHTML content in .html file
public void testSearchXhtmlInHtml() {
SearchTestUtils.searchAllLocales("kejehrgaqm", new String[] {"/org.eclipse.ua.tests/data/help/search/test7.html" });
diff --git a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/search/UATestContentExtensionProvider.java b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/search/UATestContentExtensionProvider.java
new file mode 100644
index 000000000..b97166cfe
--- /dev/null
+++ b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/search/UATestContentExtensionProvider.java
@@ -0,0 +1,57 @@
+/*******************************************************************************
+ * Copyright (c) 2011 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 org.eclipse.core.expressions.IEvaluationContext;
+import org.eclipse.help.AbstractContentExtensionProvider;
+import org.eclipse.help.IContentExtension;
+import org.eclipse.help.IUAElement;
+
+public class UATestContentExtensionProvider extends
+ AbstractContentExtensionProvider {
+
+ private IContentExtension extension;
+
+ public UATestContentExtensionProvider() {
+ // TODO Auto-generated constructor stub
+ extension = new IContentExtension() {
+
+ public boolean isEnabled(IEvaluationContext context) {
+ // TODO Auto-generated method stub
+ return true;
+ }
+
+ public IUAElement[] getChildren() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public int getType() {
+ return REPLACEMENT;
+ }
+
+ public String getPath() {
+ return "org.eclipse.ua.tests/data/help/search/test6.xhtml#test6_paragraph_to_replace2";
+ }
+
+ public String getContent() {
+ return "/org.eclipse.ua.tests/data/help/search/testProvider.xhtml";
+ }
+ };
+ }
+
+ @Override
+ public IContentExtension[] getContentExtensions(String locale) {
+ return new IContentExtension[] { extension };
+ }
+
+}
diff --git a/org.eclipse.ua.tests/plugin.xml b/org.eclipse.ua.tests/plugin.xml
index 436a53eef..f5fab85b0 100644
--- a/org.eclipse.ua.tests/plugin.xml
+++ b/org.eclipse.ua.tests/plugin.xml
@@ -492,6 +492,9 @@
<contentExtension file="data/help/dynamic/shared/extension.xml"/>
<contentExtension file="data/help/search/extension.xml"/>
<contentExtension file="data/help/search/extension2.xml"/>
+ <contentExtensionProvider
+ class="org.eclipse.ua.tests.help.search.UATestContentExtensionProvider">
+ </contentExtensionProvider>
</extension>
<extension
point="org.eclipse.help.index">

Back to the top