Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Kurtakov2019-09-17 14:13:23 +0000
committerAlexander Kurtakov2019-09-17 15:28:44 +0000
commitfc6f968616f9247866be50c9e5e62b1719d7275e (patch)
tree745bc1775a0a3a39fed88eb603247688604ddfee /org.eclipse.ua.tests/help
parenta404cbbc5c78cfa4abe1a405fa5dd4297b5a9385 (diff)
downloadeclipse.platform.ua-fc6f968616f9247866be50c9e5e62b1719d7275e.tar.gz
eclipse.platform.ua-fc6f968616f9247866be50c9e5e62b1719d7275e.tar.xz
eclipse.platform.ua-fc6f968616f9247866be50c9e5e62b1719d7275e.zip
Bug 546446 - buildhelpIndex ant task not reporting which file breaks
indexing Make sure that IndexAssembler doesn't accept broken xml. Change-Id: I67bdf6d9ceb3439a7f366a293548d5947162bad5 Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
Diffstat (limited to 'org.eclipse.ua.tests/help')
-rw-r--r--org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/index/IndexAssemblerTest.java13
1 files changed, 12 insertions, 1 deletions
diff --git a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/index/IndexAssemblerTest.java b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/index/IndexAssemblerTest.java
index f5bd8b9a7..c96255e69 100644
--- a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/index/IndexAssemblerTest.java
+++ b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/index/IndexAssemblerTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2017 IBM Corporation and others.
+ * Copyright (c) 2006, 2019 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -38,6 +38,7 @@ import org.eclipse.help.internal.index.IndexFileParser;
import org.eclipse.help.internal.index.IndexSee;
import org.eclipse.ua.tests.plugin.UserAssistanceTestPlugin;
import org.junit.Test;
+import org.xml.sax.SAXParseException;
public class IndexAssemblerTest {
@Test
@@ -102,6 +103,16 @@ public class IndexAssemblerTest {
assertEquals("topic2", topics[2].getLabel());
}
+ @Test(expected = SAXParseException.class)
+ public void testInvalid() throws Exception {
+ IndexFileParser parser = new IndexFileParser();
+ IndexContribution contrib = parser.parse(
+ new IndexFile(UserAssistanceTestPlugin.getPluginId(), "data/help/index/assembler/invalid.xml", "en"));
+ IndexAssembler assembler = new IndexAssembler();
+ List<IndexContribution> contributions = new ArrayList<>(Arrays.asList(contrib));
+ assembler.assemble(contributions, Platform.getNL());
+ }
+
// Replaces white space between ">" and "<" by a single newline
private String trimWhiteSpace(String input) {

Back to the top