Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Goldthorpe2011-10-24 22:07:49 +0000
committerChris Goldthorpe2011-10-24 22:07:49 +0000
commitdd5cfcc19f4c9096e00f5305a2a0c65a785d301e (patch)
treec0801a579e4e1094184c378d3e1975bc54626c9f /org.eclipse.ua.tests/help/org
parentdeb10fbbf5084756b0ee524291d938123d2492c1 (diff)
downloadeclipse.platform.ua-dd5cfcc19f4c9096e00f5305a2a0c65a785d301e.tar.gz
eclipse.platform.ua-dd5cfcc19f4c9096e00f5305a2a0c65a785d301e.tar.xz
eclipse.platform.ua-dd5cfcc19f4c9096e00f5305a2a0c65a785d301e.zip
Bug 361873 - [Help] PlaceholderPage does not work if it is an externalv20111024
URL
Diffstat (limited to 'org.eclipse.ua.tests/help/org')
-rw-r--r--org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webapp/UrlUtilsTests.java45
1 files changed, 43 insertions, 2 deletions
diff --git a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webapp/UrlUtilsTests.java b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webapp/UrlUtilsTests.java
index 731b27143..9410bda74 100644
--- a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webapp/UrlUtilsTests.java
+++ b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webapp/UrlUtilsTests.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008, 2009 IBM Corporation and others.
+ * Copyright (c) 2008, 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
@@ -16,7 +16,7 @@ import org.eclipse.help.internal.webapp.data.UrlUtil;
import junit.framework.TestCase;
/**
- * Test for functions which decode a topic string
+ * Test for methods in UrlUtils
*/
public class UrlUtilsTests extends TestCase {
@@ -96,5 +96,46 @@ public class UrlUtilsTests extends TestCase {
req.setPathInfo("/b/a/c/index.jsp");
assertEquals("../../../a/a/a/test.jsp", UrlUtil.getRelativePath(req, "/a/a/a/test.jsp"));
}
+
+ public void testGetHelpUrlNull() {
+ assertEquals("about:blank", UrlUtil.getHelpURL(null));
+ }
+
+ public void testGetHelpUrlHttp() {
+ assertEquals("http://www.eclipse.org", UrlUtil.getHelpURL("http://www.eclipse.org"));
+ }
+
+ public void testGetHelpUrlHttps() {
+ assertEquals("https://bugs.eclipse.org/bugs/", UrlUtil.getHelpURL("https://bugs.eclipse.org/bugs/"));
+ }
+
+ public void testGetHelpUrlFile() {
+ assertEquals("../topic/file://etc/about.html", UrlUtil.getHelpURL("file://etc/about.html"));
+ }
+
+ public void testGetHelpUrlPageInBundle() {
+ assertEquals("../topic/bundle/help.html", UrlUtil.getHelpURL("/bundle/help.html"));
+ }
+
+ public void testGetHelpUrlNullDepthTwo() {
+ assertEquals("about:blank", UrlUtil.getHelpURL(null, 2));
+ }
+
+ public void testGetHelpUrlHttpDepthTwo() {
+ assertEquals("http://www.eclipse.org", UrlUtil.getHelpURL("http://www.eclipse.org", 2));
+ }
+
+ public void testGetHelpUrlHttpDepthTwos() {
+ assertEquals("https://bugs.eclipse.org/bugs/", UrlUtil.getHelpURL("https://bugs.eclipse.org/bugs/", 2));
+ }
+
+ public void testGetHelpUrlFileDepthTwo() {
+ assertEquals("../../topic/file://etc/about.html", UrlUtil.getHelpURL("file://etc/about.html", 2));
+ }
+
+ public void testGetHelpUrlPageInBundleDepthTwo() {
+ assertEquals("../../topic/bundle/help.html", UrlUtil.getHelpURL("/bundle/help.html", 2));
+ }
+
}

Back to the top