8226193: BundleNameTest and BundleIdentifierTest fails if run without network connection JDK-8200758-branch
authorherrick
Fri, 14 Jun 2019 20:56:48 -0400
branchJDK-8200758-branch
changeset 57408 f4a3f1dd2c02
parent 57407 2c14fbeff1dc
child 57409 04d34294cb03
8226193: BundleNameTest and BundleIdentifierTest fails if run without network connection Submitted-by: almatvee Reviewed-by: herrick, asemenyuk
test/jdk/tools/jpackage/createappimage/macosx/JPackageCreateAppImageBundleIdentifierTest.java
test/jdk/tools/jpackage/createappimage/macosx/JPackageCreateAppImageBundleNameTest.java
--- a/test/jdk/tools/jpackage/createappimage/macosx/JPackageCreateAppImageBundleIdentifierTest.java	Fri Jun 14 12:04:12 2019 -0400
+++ b/test/jdk/tools/jpackage/createappimage/macosx/JPackageCreateAppImageBundleIdentifierTest.java	Fri Jun 14 20:56:48 2019 -0400
@@ -107,8 +107,9 @@
         File infoPList = new File(OUTPUT + File.separator + APP_NAME + ".app" +
                 File.separator + "Contents" + File.separator + "Info.plist");
 
-        DocumentBuilder b = DocumentBuilderFactory.newDefaultInstance()
-                                                         .newDocumentBuilder();
+        DocumentBuilderFactory dbf = DocumentBuilderFactory.newDefaultInstance();
+        dbf.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false);
+        DocumentBuilder b = dbf.newDocumentBuilder();
         org.w3c.dom.Document doc = b.parse(new FileInputStream(
                                                   infoPList.getAbsolutePath()));
 
--- a/test/jdk/tools/jpackage/createappimage/macosx/JPackageCreateAppImageBundleNameTest.java	Fri Jun 14 12:04:12 2019 -0400
+++ b/test/jdk/tools/jpackage/createappimage/macosx/JPackageCreateAppImageBundleNameTest.java	Fri Jun 14 20:56:48 2019 -0400
@@ -105,8 +105,9 @@
         File infoPList = new File(OUTPUT + File.separator + APP_NAME + ".app" +
                 File.separator + "Contents" + File.separator + "Info.plist");
 
-        DocumentBuilder b = DocumentBuilderFactory.newDefaultInstance()
-                                                         .newDocumentBuilder();
+        DocumentBuilderFactory dbf = DocumentBuilderFactory.newDefaultInstance();
+        dbf.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false);
+        DocumentBuilder b = dbf.newDocumentBuilder();
         org.w3c.dom.Document doc = b.parse(new FileInputStream(
                                                   infoPList.getAbsolutePath()));