Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Goldthorpe2011-09-29 17:26:31 +0000
committerChris Goldthorpe2011-09-29 17:40:09 +0000
commit64cbd840262abfb2ec22e15ab32ad1a500b1387f (patch)
treed61831816fe04375094aea2c46184c55e07fe7e0 /org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/search
parentd9167980d227beb3c0fae203d39721a0ac391d4f (diff)
downloadeclipse.platform.ua-64cbd840262abfb2ec22e15ab32ad1a500b1387f.tar.gz
eclipse.platform.ua-64cbd840262abfb2ec22e15ab32ad1a500b1387f.tar.xz
eclipse.platform.ua-64cbd840262abfb2ec22e15ab32ad1a500b1387f.zip
Bug 359457 - [Test] Need tests for content extension provider
Diffstat (limited to 'org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/search')
-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
2 files changed, 68 insertions, 1 deletions
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 };
+ }
+
+}

Back to the top