Skip to content

Commit cae6a37

Browse files
authored
test: fix erratic error FileNotFoundException: http://.../catalog.dtd (#1963)
Addresses erratic runtime exceptions because of catalog.dtd temporarily not being available online: ```py java.io.FileNotFoundException: http://www.oasis-open.org/committees/entity/release/1.0/catalog.dtd at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:2010) at ... at java.xml/javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:206) at org.eclipse.wildwebdeveloper.tests.TestXML.testXMLCatalogHttpsUriIncluded(TestXML.java:388) at java.base/java.lang.reflect.Method.invoke(Method.java:580) at java.base/java.util.ArrayList.forEach(ArrayList.java:1596) at java.base/java.util.ArrayList.forEach(ArrayList.java:1596) ```
1 parent 2998f13 commit cae6a37

File tree

1 file changed

+4
-2
lines changed
  • org.eclipse.wildwebdeveloper.tests/src/org/eclipse/wildwebdeveloper/tests

1 file changed

+4
-2
lines changed

org.eclipse.wildwebdeveloper.tests/src/org/eclipse/wildwebdeveloper/tests/TestXML.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -383,9 +383,11 @@ public void testXMLCatalogHttpsUriIncluded() throws Exception {
383383
dialog.getShell().open();
384384
dialog.getShell().close();
385385

386-
// Find system-catalog and parse it
386+
// Find system.catalog in well known location from plugin
387387
File systemCatalog = plugin.getStateLocation().append("system-catalog.xml").toFile();
388-
Document systemCatalogDom = DocumentBuilderFactory.newDefaultInstance().newDocumentBuilder().parse(systemCatalog);
388+
// Parse system-catalog to check it
389+
Document systemCatalogDom = runWithLocalCatalogOnlyForTestXMLCatalog(
390+
() -> DocumentBuilderFactory.newDefaultInstance().newDocumentBuilder().parse(systemCatalog));
389391

390392
// root element
391393
Node catalogNode = systemCatalogDom.getLastChild();

0 commit comments

Comments
 (0)