Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCurtis D'Entremont2006-04-07 21:03:01 +0000
committerCurtis D'Entremont2006-04-07 21:03:01 +0000
commitbc7057603ea9c647f47a313e43be66088fa94e23 (patch)
tree98784810b62336c9ccfcfbd5745db9c814a42114 /org.eclipse.ua.tests
parenta60a76cfcc2edda701512d4d4abaa800cc9df302 (diff)
downloadeclipse.platform.ua-bc7057603ea9c647f47a313e43be66088fa94e23.tar.gz
eclipse.platform.ua-bc7057603ea9c647f47a313e43be66088fa94e23.tar.xz
eclipse.platform.ua-bc7057603ea9c647f47a313e43be66088fa94e23.zip
135107 [Help] Allow users to use .html/.htm file extension for XHTML contentv20060407
Diffstat (limited to 'org.eclipse.ua.tests')
-rw-r--r--org.eclipse.ua.tests/data/help/producer/dynamic2.html45
-rw-r--r--org.eclipse.ua.tests/data/help/producer/dynamic2_expected.txt36
-rw-r--r--org.eclipse.ua.tests/data/help/producer/include2.html20
-rw-r--r--org.eclipse.ua.tests/data/help/producer/toc.xml1
-rw-r--r--org.eclipse.ua.tests/data/help/producer/xhtml/invalid/html_doctype.html23
-rw-r--r--org.eclipse.ua.tests/data/help/producer/xhtml/invalid/missing_doctype.html14
-rw-r--r--org.eclipse.ua.tests/data/help/producer/xhtml/valid/frameset.html23
-rw-r--r--org.eclipse.ua.tests/data/help/producer/xhtml/valid/frameset.xhtml23
-rw-r--r--org.eclipse.ua.tests/data/help/producer/xhtml/valid/normal.html23
-rw-r--r--org.eclipse.ua.tests/data/help/producer/xhtml/valid/normal.xhtml23
-rw-r--r--org.eclipse.ua.tests/data/help/producer/xhtml/valid/strict.html23
-rw-r--r--org.eclipse.ua.tests/data/help/producer/xhtml/valid/strict.xhtml23
-rw-r--r--org.eclipse.ua.tests/data/help/producer/xhtml/valid/with_xml_decl.xhtml22
-rw-r--r--org.eclipse.ua.tests/data/help/search/test7.html26
-rw-r--r--org.eclipse.ua.tests/data/help/search/toc.xml1
-rw-r--r--org.eclipse.ua.tests/data/help/toc/extraContent/simple_page.html3
-rw-r--r--org.eclipse.ua.tests/data/help/toc/extraContent/toc2.xml28
-rw-r--r--org.eclipse.ua.tests/data/help/toc/extraContent/toc2_expected.txt30
-rw-r--r--org.eclipse.ua.tests/data/help/toc/extraContent/toc_expected.txt2
-rw-r--r--org.eclipse.ua.tests/data/help/toc/filteredToc/toc_expected.txt2
-rw-r--r--org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/producer/AllProducerTests.java1
-rw-r--r--org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/producer/XHTMLContentDescriberTest.java59
-rw-r--r--org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/search/XHTMLTest.java10
23 files changed, 429 insertions, 32 deletions
diff --git a/org.eclipse.ua.tests/data/help/producer/dynamic2.html b/org.eclipse.ua.tests/data/help/producer/dynamic2.html
new file mode 100644
index 000000000..56d16f0f8
--- /dev/null
+++ b/org.eclipse.ua.tests/data/help/producer/dynamic2.html
@@ -0,0 +1,45 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<!--
+ Test to make sure the dynamic content producer applies to XHTML inside
+ a file with extension .html
+-->
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<title>dynamic2.html</title>
+</head>
+<body>
+
+<h2>dynamic2.html</h2>
+<p>
+This page contains filtered content.
+</p>
+<p filter="os=invalid">
+This paragraph, which has filter attribute "os=invalid" should always be filtered out.
+</p>
+<p filter="os!=invalid">
+This paragraph, which has filter attribute "os!=invalid" should never be filtered out.
+</p>
+<p filter="plugin=my.invalid.plugin.id.012345">
+This paragraph, which has filter attribute "plugin=my.invalid.plugin.id.012345" should always be filtered out.
+</p>
+<p filter="plugin!=my.invalid.plugin.id.012345">
+This paragraph, which has filter attribute "plugin!=my.invalid.plugin.id.012345" should never be filtered out.
+</p>
+<p>
+ <filter name="plugin" value="my.invalid.plugin.id.012345"/>
+ This paragraph, which has filter element name="plugin", value="my.invalid.plugin.id.012345",
+ should always be filtered out.
+</p>
+<p>
+ <filter name="plugin" value="!my.invalid.plugin.id.012345"/>
+ This paragraph, which has filter element name="plugin", value="!my.invalid.plugin.id.012345",
+ should never be filtered out.
+</p>
+
+<include path="org.eclipse.ua.tests/data/help/producer/include2.html/my.paragraph.id"/>
+
+</body>
+</html>
diff --git a/org.eclipse.ua.tests/data/help/producer/dynamic2_expected.txt b/org.eclipse.ua.tests/data/help/producer/dynamic2_expected.txt
new file mode 100644
index 000000000..3a390f500
--- /dev/null
+++ b/org.eclipse.ua.tests/data/help/producer/dynamic2_expected.txt
@@ -0,0 +1,36 @@
+<!--
+ Test to make sure the dynamic content producer applies to XHTML inside
+ a file with extension .html
+--><!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>
+
+<title>dynamic2.html</title>
+</head>
+<body>
+
+<h2>dynamic2.html</h2>
+<p>
+This page contains filtered content.
+</p>
+
+<p filter="os!=invalid">
+This paragraph, which has filter attribute "os!=invalid" should never be filtered out.
+</p>
+
+<p filter="plugin!=my.invalid.plugin.id.012345">
+This paragraph, which has filter attribute "plugin!=my.invalid.plugin.id.012345" should never be filtered out.
+</p>
+
+<p>
+ <filter name="plugin" value="!my.invalid.plugin.id.012345" />
+ This paragraph, which has filter element name="plugin", value="!my.invalid.plugin.id.012345",
+ should never be filtered out.
+</p>
+
+<p id="my.paragraph.id">
+ This paragraph comes from <code>include2.html</code>.
+</p>
+
+</body>
+</html> \ No newline at end of file
diff --git a/org.eclipse.ua.tests/data/help/producer/include2.html b/org.eclipse.ua.tests/data/help/producer/include2.html
new file mode 100644
index 000000000..11dcc7c7e
--- /dev/null
+++ b/org.eclipse.ua.tests/data/help/producer/include2.html
@@ -0,0 +1,20 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<!--
+ Test to ensure that include works when including XHTML from a file with
+ .html extension.
+-->
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<title>include2.html</title>
+</head>
+<body>
+
+<p id="my.paragraph.id">
+ This paragraph comes from <code>include2.html</code>.
+</p>
+
+</body>
+</html>
diff --git a/org.eclipse.ua.tests/data/help/producer/toc.xml b/org.eclipse.ua.tests/data/help/producer/toc.xml
index 86a5e0d2b..7d6ce30b3 100644
--- a/org.eclipse.ua.tests/data/help/producer/toc.xml
+++ b/org.eclipse.ua.tests/data/help/producer/toc.xml
@@ -8,6 +8,7 @@
<toc label="toc.xml">
<topic label="dynamic.xhtml" href="data/help/producer/dynamic.xhtml"/>
+ <topic label="dynamic2.html" href="data/help/producer/dynamic2.html"/>
<!-- This file is in doc.zip in the root of the test plugin -->
<topic label="dynamicInZip.xhtml" href="data/help/producer/dynamicInZip.xhtml"/>
diff --git a/org.eclipse.ua.tests/data/help/producer/xhtml/invalid/html_doctype.html b/org.eclipse.ua.tests/data/help/producer/xhtml/invalid/html_doctype.html
new file mode 100644
index 000000000..2a8198863
--- /dev/null
+++ b/org.eclipse.ua.tests/data/help/producer/xhtml/invalid/html_doctype.html
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
+
+<!--
+ This file is used to test whether or not the dynamic producer will be used
+ when loading an xhtml document from outside a doc.zip. The paragraph at the
+ bottom should always be filtered out by the producer.
+-->
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<title>test</title>
+</head>
+<body>
+
+<h1>test</h1>
+<p>
+Test
+</p>
+
+</body>
+</html>
diff --git a/org.eclipse.ua.tests/data/help/producer/xhtml/invalid/missing_doctype.html b/org.eclipse.ua.tests/data/help/producer/xhtml/invalid/missing_doctype.html
new file mode 100644
index 000000000..b639180b1
--- /dev/null
+++ b/org.eclipse.ua.tests/data/help/producer/xhtml/invalid/missing_doctype.html
@@ -0,0 +1,14 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<title>test</title>
+</head>
+<body>
+
+<h1>test</h1>
+<p>
+Test
+</p>
+
+</body>
+</html>
diff --git a/org.eclipse.ua.tests/data/help/producer/xhtml/valid/frameset.html b/org.eclipse.ua.tests/data/help/producer/xhtml/valid/frameset.html
new file mode 100644
index 000000000..b30156e06
--- /dev/null
+++ b/org.eclipse.ua.tests/data/help/producer/xhtml/valid/frameset.html
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
+
+<!--
+ This file is used to test whether or not the dynamic producer will be used
+ when loading an xhtml document from outside a doc.zip. The paragraph at the
+ bottom should always be filtered out by the producer.
+-->
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<title>test</title>
+</head>
+<body>
+
+<h1>test</h1>
+<p>
+Test
+</p>
+
+</body>
+</html>
diff --git a/org.eclipse.ua.tests/data/help/producer/xhtml/valid/frameset.xhtml b/org.eclipse.ua.tests/data/help/producer/xhtml/valid/frameset.xhtml
new file mode 100644
index 000000000..b30156e06
--- /dev/null
+++ b/org.eclipse.ua.tests/data/help/producer/xhtml/valid/frameset.xhtml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
+
+<!--
+ This file is used to test whether or not the dynamic producer will be used
+ when loading an xhtml document from outside a doc.zip. The paragraph at the
+ bottom should always be filtered out by the producer.
+-->
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<title>test</title>
+</head>
+<body>
+
+<h1>test</h1>
+<p>
+Test
+</p>
+
+</body>
+</html>
diff --git a/org.eclipse.ua.tests/data/help/producer/xhtml/valid/normal.html b/org.eclipse.ua.tests/data/help/producer/xhtml/valid/normal.html
new file mode 100644
index 000000000..44165bdc7
--- /dev/null
+++ b/org.eclipse.ua.tests/data/help/producer/xhtml/valid/normal.html
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<!--
+ This file is used to test whether or not the dynamic producer will be used
+ when loading an xhtml document from outside a doc.zip. The paragraph at the
+ bottom should always be filtered out by the producer.
+-->
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<title>test</title>
+</head>
+<body>
+
+<h1>test</h1>
+<p>
+Test
+</p>
+
+</body>
+</html>
diff --git a/org.eclipse.ua.tests/data/help/producer/xhtml/valid/normal.xhtml b/org.eclipse.ua.tests/data/help/producer/xhtml/valid/normal.xhtml
new file mode 100644
index 000000000..44165bdc7
--- /dev/null
+++ b/org.eclipse.ua.tests/data/help/producer/xhtml/valid/normal.xhtml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<!--
+ This file is used to test whether or not the dynamic producer will be used
+ when loading an xhtml document from outside a doc.zip. The paragraph at the
+ bottom should always be filtered out by the producer.
+-->
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<title>test</title>
+</head>
+<body>
+
+<h1>test</h1>
+<p>
+Test
+</p>
+
+</body>
+</html>
diff --git a/org.eclipse.ua.tests/data/help/producer/xhtml/valid/strict.html b/org.eclipse.ua.tests/data/help/producer/xhtml/valid/strict.html
new file mode 100644
index 000000000..443c3dae5
--- /dev/null
+++ b/org.eclipse.ua.tests/data/help/producer/xhtml/valid/strict.html
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+
+<!--
+ This file is used to test whether or not the dynamic producer will be used
+ when loading an xhtml document from outside a doc.zip. The paragraph at the
+ bottom should always be filtered out by the producer.
+-->
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<title>test</title>
+</head>
+<body>
+
+<h1>test</h1>
+<p>
+Test
+</p>
+
+</body>
+</html>
diff --git a/org.eclipse.ua.tests/data/help/producer/xhtml/valid/strict.xhtml b/org.eclipse.ua.tests/data/help/producer/xhtml/valid/strict.xhtml
new file mode 100644
index 000000000..443c3dae5
--- /dev/null
+++ b/org.eclipse.ua.tests/data/help/producer/xhtml/valid/strict.xhtml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+
+<!--
+ This file is used to test whether or not the dynamic producer will be used
+ when loading an xhtml document from outside a doc.zip. The paragraph at the
+ bottom should always be filtered out by the producer.
+-->
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<title>test</title>
+</head>
+<body>
+
+<h1>test</h1>
+<p>
+Test
+</p>
+
+</body>
+</html>
diff --git a/org.eclipse.ua.tests/data/help/producer/xhtml/valid/with_xml_decl.xhtml b/org.eclipse.ua.tests/data/help/producer/xhtml/valid/with_xml_decl.xhtml
new file mode 100644
index 000000000..44460c399
--- /dev/null
+++ b/org.eclipse.ua.tests/data/help/producer/xhtml/valid/with_xml_decl.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">
+
+<!--
+ This file is used to test whether or not the dynamic producer will be used
+ when loading an xhtml document from outside a doc.zip. The paragraph at the
+ bottom should always be filtered out by the producer.
+-->
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<title>test</title>
+</head>
+<body>
+
+<h1>test</h1>
+<p>
+Test
+</p>
+
+</body>
+</html>
diff --git a/org.eclipse.ua.tests/data/help/search/test7.html b/org.eclipse.ua.tests/data/help/search/test7.html
new file mode 100644
index 000000000..b634fb857
--- /dev/null
+++ b/org.eclipse.ua.tests/data/help/search/test7.html
@@ -0,0 +1,26 @@
+<!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>test7.html</title>
+</head>
+
+<body>
+<p>
+This tests whether or not the right search participant will be used for XHTML
+content inside a file with extension .html
+kejehrgaqm
+</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: hugftnhdtg
+</p>
+<p filter="plugin!=my.invalid.plugin.id.012345">
+This paragraph, which has filter attribute "plugin!=my.invalid.plugin.id.012345" should never be filtered out.
+opqmenhfjs
+</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
index 5e7591950..9faff31af 100644
--- a/org.eclipse.ua.tests/data/help/search/toc.xml
+++ b/org.eclipse.ua.tests/data/help/search/toc.xml
@@ -8,4 +8,5 @@
<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"/>
+ <topic label="test7.html" href="data/help/search/test7.html"/>
</toc>
diff --git a/org.eclipse.ua.tests/data/help/toc/extraContent/simple_page.html b/org.eclipse.ua.tests/data/help/toc/extraContent/simple_page.html
index 5918e900f..290db6534 100644
--- a/org.eclipse.ua.tests/data/help/toc/extraContent/simple_page.html
+++ b/org.eclipse.ua.tests/data/help/toc/extraContent/simple_page.html
@@ -1,4 +1,5 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN"><HTML>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
+<HTML>
<HEAD>
<meta name="copyright" content="Copyright (c) IBM Corporation and others 2000, 2005. This page is made available under license. For full details see the LEGAL in the documentation book that contains this page." >
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1">
diff --git a/org.eclipse.ua.tests/data/help/toc/extraContent/toc2.xml b/org.eclipse.ua.tests/data/help/toc/extraContent/toc2.xml
index a97999eb7..8e9f82afa 100644
--- a/org.eclipse.ua.tests/data/help/toc/extraContent/toc2.xml
+++ b/org.eclipse.ua.tests/data/help/toc/extraContent/toc2.xml
@@ -1,35 +1,35 @@
<?xml version="1.0" encoding="utf-8"?>
<?NLS TYPE="org.eclipse.help.toc"?>
<toc label="Samples" topic="samples.htm">
- <topic label="Bats FOR product: Happy Bats, WAS; version: 9.0,8.0 ; platform: z/OS;AIX" href="bats.htm">
+ <topic label="Bats FOR product: Happy Bats, WAS; version: 9.0,8.0 ; platform: z/OS;AIX" href="simple_page.html">
<criteria name="prodname" value="Happy Bats" />
<criteria name="prodname" value="WAS" />
<criteria name="version" value="9.0" />
<criteria name="version" value="8.0" />
<criteria name="platform" value="z/OS" />
<criteria name="platform" value="AIX" />
- <topic label="Caring for your fruit bat FOR Version: 9.0; platform: z/OS; product: WAS" href="batcaring.htm">
+ <topic label="Caring for your fruit bat FOR Version: 9.0; platform: z/OS; product: WAS" href="simple_page.html">
<criteria name="version" value="9.0" />
<criteria name="platform" value="z/OS" />
<criteria name="prodname" value="WAS" />
</topic>
- <topic label="Cleaning your fruit bat FOR Version: 8.0; platform: AIX; product: Happy Bats" href="batcleaning.htm">
+ <topic label="Cleaning your fruit bat FOR Version: 8.0; platform: AIX; product: Happy Bats" href="simple_page.html">
<criteria name="platform" value="AIX" />
<criteria name="version" value="8.0" />
<criteria name="prodname" value="Happy Bats" />
</topic>
- <topic label="Feeding your bat" href="batfeeding.htm"/>
- <topic label="Bat sonar" href="batsonar.htm"/>
- <topic label="Bat guano" href="batguano.htm"/>
- <topic label="Bat history" href="bathistory.htm"/>
- <topic label="Bat recycling" href="batreuse.htm"/>
+ <topic label="Feeding your bat" href="simple_page.html"/>
+ <topic label="Bat sonar" href="simple_page.html"/>
+ <topic label="Bat guano" href="simple_page.html"/>
+ <topic label="Bat history" href="simple_page.html"/>
+ <topic label="Bat recycling" href="simple_page.html"/>
</topic>
- <topic label="Bats FOR product: Happy Bats" href="bats.htm#none">
+ <topic label="Bats FOR product: Happy Bats" href="simple_page.html">
<criteria name="prodname" value="Happy Bats" />
- <topic label="Feeding your bat" href="batfeeding.htm"/>
- <topic label="Bat sonar" href="batsonar.htm"/>
- <topic label="Bat guano" href="batguano.htm"/>
- <topic label="Bat history" href="bathistory.htm"/>
- <topic label="Bat recycling" href="batreuse.htm"/>
+ <topic label="Feeding your bat" href="simple_page.html"/>
+ <topic label="Bat sonar" href="simple_page.html"/>
+ <topic label="Bat guano" href="simple_page.html"/>
+ <topic label="Bat history" href="simple_page.html"/>
+ <topic label="Bat recycling" href="simple_page.html"/>
</topic>
</toc> \ No newline at end of file
diff --git a/org.eclipse.ua.tests/data/help/toc/extraContent/toc2_expected.txt b/org.eclipse.ua.tests/data/help/toc/extraContent/toc2_expected.txt
index e7b25dca4..fe477d653 100644
--- a/org.eclipse.ua.tests/data/help/toc/extraContent/toc2_expected.txt
+++ b/org.eclipse.ua.tests/data/help/toc/extraContent/toc2_expected.txt
@@ -4,58 +4,58 @@
href="/org.eclipse.ua.tests/data/help/toc/extraContent/toc2.xml">
<topic
label="Bats FOR product: Happy Bats, WAS; version: 9.0,8.0 ; platform: z/OS;AIX"
- href="/org.eclipse.ua.tests/bats.htm">
+ href="/org.eclipse.ua.tests/simple_page.html">
<topic
label="Caring for your fruit bat FOR Version: 9.0; platform: z/OS; product: WAS"
- href="/org.eclipse.ua.tests/batcaring.htm">
+ href="/org.eclipse.ua.tests/simple_page.html">
</topic>
<topic
label="Cleaning your fruit bat FOR Version: 8.0; platform: AIX; product: Happy Bats"
- href="/org.eclipse.ua.tests/batcleaning.htm">
+ href="/org.eclipse.ua.tests/simple_page.html">
</topic>
<topic
label="Feeding your bat"
- href="/org.eclipse.ua.tests/batfeeding.htm">
+ href="/org.eclipse.ua.tests/simple_page.html">
</topic>
<topic
label="Bat sonar"
- href="/org.eclipse.ua.tests/batsonar.htm">
+ href="/org.eclipse.ua.tests/simple_page.html">
</topic>
<topic
label="Bat guano"
- href="/org.eclipse.ua.tests/batguano.htm">
+ href="/org.eclipse.ua.tests/simple_page.html">
</topic>
<topic
label="Bat history"
- href="/org.eclipse.ua.tests/bathistory.htm">
+ href="/org.eclipse.ua.tests/simple_page.html">
</topic>
<topic
label="Bat recycling"
- href="/org.eclipse.ua.tests/batreuse.htm">
+ href="/org.eclipse.ua.tests/simple_page.html">
</topic>
</topic>
<topic
label="Bats FOR product: Happy Bats"
- href="/org.eclipse.ua.tests/bats.htm#none">
+ href="/org.eclipse.ua.tests/simple_page.html">
<topic
label="Feeding your bat"
- href="/org.eclipse.ua.tests/batfeeding.htm">
+ href="/org.eclipse.ua.tests/simple_page.html">
</topic>
<topic
label="Bat sonar"
- href="/org.eclipse.ua.tests/batsonar.htm">
+ href="/org.eclipse.ua.tests/simple_page.html">
</topic>
<topic
label="Bat guano"
- href="/org.eclipse.ua.tests/batguano.htm">
+ href="/org.eclipse.ua.tests/simple_page.html">
</topic>
<topic
label="Bat history"
- href="/org.eclipse.ua.tests/bathistory.htm">
+ href="/org.eclipse.ua.tests/simple_page.html">
</topic>
<topic
label="Bat recycling"
- href="/org.eclipse.ua.tests/batreuse.htm">
+ href="/org.eclipse.ua.tests/simple_page.html">
</topic>
</topic>
-</toc>
+</toc> \ No newline at end of file
diff --git a/org.eclipse.ua.tests/data/help/toc/extraContent/toc_expected.txt b/org.eclipse.ua.tests/data/help/toc/extraContent/toc_expected.txt
index e35bbb632..4c81d6c62 100644
--- a/org.eclipse.ua.tests/data/help/toc/extraContent/toc_expected.txt
+++ b/org.eclipse.ua.tests/data/help/toc/extraContent/toc_expected.txt
@@ -46,4 +46,4 @@
label="Legal"
href="/org.eclipse.ua.tests/data/help/toc/extraContent/simple_page.html">
</topic>
-</toc>
+</toc> \ No newline at end of file
diff --git a/org.eclipse.ua.tests/data/help/toc/filteredToc/toc_expected.txt b/org.eclipse.ua.tests/data/help/toc/filteredToc/toc_expected.txt
index 72cb7236f..45be796f3 100644
--- a/org.eclipse.ua.tests/data/help/toc/filteredToc/toc_expected.txt
+++ b/org.eclipse.ua.tests/data/help/toc/filteredToc/toc_expected.txt
@@ -66,4 +66,4 @@
href="/org.eclipse.ua.tests/data/help/toc/filteredToc/simple_page.html">
</topic>
</topic>
-</toc>
+</toc> \ No newline at end of file
diff --git a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/producer/AllProducerTests.java b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/producer/AllProducerTests.java
index ed30f03bc..17336eb64 100644
--- a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/producer/AllProducerTests.java
+++ b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/producer/AllProducerTests.java
@@ -30,5 +30,6 @@ public class AllProducerTests extends TestSuite {
*/
public AllProducerTests() {
addTest(DynamicContentTest.suite());
+ addTest(XHTMLContentDescriberTest.suite());
}
}
diff --git a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/producer/XHTMLContentDescriberTest.java b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/producer/XHTMLContentDescriberTest.java
new file mode 100644
index 000000000..78196ea99
--- /dev/null
+++ b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/producer/XHTMLContentDescriberTest.java
@@ -0,0 +1,59 @@
+/*******************************************************************************
+ * 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.producer;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URL;
+
+import junit.framework.Assert;
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.content.IContentType;
+import org.eclipse.ua.tests.plugin.UserAssistanceTestPlugin;
+import org.eclipse.ua.tests.util.ResourceFinder;
+
+public class XHTMLContentDescriberTest extends TestCase {
+
+ /*
+ * Returns an instance of this Test.
+ */
+ public static Test suite() {
+ return new TestSuite(XHTMLContentDescriberTest.class);
+ }
+
+ public void testValidXHTML() throws IOException {
+ URL[] urls = ResourceFinder.findFiles(UserAssistanceTestPlugin.getDefault(), "data/help/producer/xhtml/valid", "", true);
+ for (int i=0;i<urls.length;++i) {
+ InputStream in = urls[i].openStream();
+ String url = urls[i].toExternalForm();
+ String fileName = url.substring(url.lastIndexOf('/') + 1);
+ IContentType type = Platform.getContentTypeManager().findContentTypeFor(in, fileName);
+ Assert.assertEquals("The supplied valid XHTML was mistakenly recognized as invalid XHTML by the type describer: file=" + fileName, "org.eclipse.help.xhtml", type.getId());
+ in.close();
+ }
+ }
+
+ public void testInvalidXHTML() throws IOException {
+ URL[] urls = ResourceFinder.findFiles(UserAssistanceTestPlugin.getDefault(), "data/help/producer/xhtml/invalid", "", true);
+ for (int i=0;i<urls.length;++i) {
+ InputStream in = urls[i].openStream();
+ String url = urls[i].toExternalForm();
+ String fileName = url.substring(url.lastIndexOf('/') + 1);
+ IContentType type = Platform.getContentTypeManager().findContentTypeFor(in, fileName);
+ Assert.assertFalse("The supplied invalid XHTML was not properly recognized by the XHTML content type describer: file= " + fileName + " type=" + type.getId(), "org.eclipse.help.xhtml".equals(type.getId()));
+ in.close();
+ }
+ }
+}
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
index 32a4bb1b7..2f0c86204 100644
--- 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
@@ -71,6 +71,16 @@ public class XHTMLTest extends TestCase {
// only exists in paragraph in test6.xhtml that's replaced by another one
{ "bheufnjefa", /* no hits */ },
+
+ // sanity test to make sure it finds things in XHTML content in .html file
+ { "kejehrgaqm", "/org.eclipse.ua.tests/data/help/search/test7.html" },
+
+ // same as above, but in a section that should never be filtered
+ { "opqmenhfjs", "/org.eclipse.ua.tests/data/help/search/test7.html" },
+
+ // only exists in a paragraph in test7.html that should be filtered out
+ // make sure this works for XHTML content inside .html file
+ { "hugftnhdtg", /* no hits */ },
};
/*

Back to the top