Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/dynamic/XMLProcessorTest.java')
-rw-r--r--org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/dynamic/XMLProcessorTest.java14
1 files changed, 12 insertions, 2 deletions
diff --git a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/dynamic/XMLProcessorTest.java b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/dynamic/XMLProcessorTest.java
index c146999c1..0628d7026 100644
--- a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/dynamic/XMLProcessorTest.java
+++ b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/dynamic/XMLProcessorTest.java
@@ -10,7 +10,9 @@
*******************************************************************************/
package org.eclipse.ua.tests.help.dynamic;
+import java.io.IOException;
import java.io.InputStream;
+import java.net.URL;
import org.eclipse.core.runtime.Platform;
import org.eclipse.help.internal.base.HelpEvaluationContext;
@@ -45,8 +47,16 @@ public class XMLProcessorTest {
};
XMLProcessor processor = new XMLProcessor(handlers);
Bundle bundle = UserAssistanceTestPlugin.getDefault().getBundle();
- try (InputStream in = bundle.getEntry(FileUtil.getResultFile(path)).openStream();
- InputStream in2 = processor.process(bundle.getEntry(path).openStream(),
+ URL url1 = bundle.getEntry(FileUtil.getResultFile(path));
+ if(url1 == null) {
+ throw new IOException("No entry to '"+FileUtil.getResultFile(path)+"' could be found or caller does not have the appropriate permissions.");//$NON-NLS-1$ //$NON-NLS-2$
+ }
+ URL url2 = bundle.getEntry(path);
+ if(url2 == null) {
+ throw new IOException("No entry to '"+path+"' could be found or caller does not have the appropriate permissions.");//$NON-NLS-1$ //$NON-NLS-2$
+ }
+ try (InputStream in = url1.openStream();
+ InputStream in2 = processor.process(url2.openStream(),
'/' + bundle.getSymbolicName() + '/' + path, "UTF-8")) {
XMLUtil.assertXMLEquals("XML content was not processed correctly: " + path, in, in2);
}

Back to the top