Skip to content

Commit 2fe078d

Browse files
author
duke
committedNov 29, 2023
Automatic merge of jdk:master into master
2 parents 644203f + 9a6ca23 commit 2fe078d

File tree

6 files changed

+52
-18
lines changed

6 files changed

+52
-18
lines changed
 

‎src/java.xml/share/classes/jdk/xml/internal/JdkConstants.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ public final class JdkConstants {
304304
* System Property for the JDKCatalog' RESOLVE property
305305
* @since 22
306306
*/
307-
public static final String JDKCATALOG_RESOLVE = "jdk.xml.jdkCatalog.resolve";
307+
public static final String JDKCATALOG_RESOLVE = "jdk.xml.jdkcatalog.resolve";
308308

309309
// Catalog Resolve Integer mappings for String values
310310
public static final int CONTINUE = 0;

‎src/java.xml/share/conf/jaxp.properties

+22-4
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,11 @@
4747
# the default property values. The format is:
4848
# system-property-name=value
4949
#
50-
# For example, the FILES property in CatalogFeatures has an associated system
51-
# property called javax.xml.catalog.files. An entry for the FILES property in the
52-
# configuration file would therefore use javax.xml.catalog.files as the key, that
50+
# For example, the RESOLVE property in CatalogFeatures has an associated system
51+
# property called javax.xml.catalog.resolve. An entry for the RESOLVE property in the
52+
# configuration file would therefore use javax.xml.catalog.resolve as the key, that
5353
# is:
54-
# javax.xml.catalog.files=strict
54+
# javax.xml.catalog.resolve=strict
5555
#
5656
#
5757
# Extension Functions:
@@ -128,6 +128,24 @@ jdk.xml.overrideDefaultParser=false
128128
#
129129
# javax.xml.useCatalog=true
130130
#
131+
# Implementation Specific Properties - jdkcatalog.resolve
132+
#
133+
# This property instructs the JDK default CatalogResolver to act in accordance with
134+
# the setting when unable to resolve an external reference with the built-in Catalog.
135+
# The options are:
136+
# continue -- indicates that the processing should continue
137+
# ignore -- indicates that the reference is skipped
138+
# strict -- indicates that the resolver should throw a CatalogException
139+
#
140+
# The following setting would cause the resolve to throw a CatalogException when
141+
# unable to resolve an external reference:
142+
# jdk.xml.jdkcatalog.resolve=strict
143+
#
144+
# Implementation Specific Properties - DTD
145+
#
146+
# This property instructs the parsers to: deny, ignore or allow DTD processing.
147+
# The following setting would cause the parser to reject DTD by throwing an exception.
148+
# jdk.xml.dtd.support=deny
131149
#
132150
# Implementation Specific Properties - Limits
133151
#

‎test/jaxp/javax/xml/jaxp/unittest/common/catalog/CatalogTestBase.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public Object[][] getConfigs(Processor processor) {
5757

5858
// error (not from catalog) is expect when CATALOG=continue
5959
boolean isErrExpected = true;
60-
String expected1 = "invalid.site.com";
60+
String expected1 = UNKNOWN_HOST;
6161

6262
// expected when reference is resolved by Catalog
6363
String expected3 = "", expected4 = "";

‎test/jaxp/javax/xml/jaxp/unittest/common/config/files/catalog2.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# ---- Config File: for testing the CATALOG property ----
1414
#
1515
# strict: report error if not resolved by the JDK Catalog
16-
jdk.xml.jdkCatalog.resolve=strict
16+
jdk.xml.jdkcatalog.resolve=strict
1717
# Enable Extension Functions
1818
jdk.xml.enableExtensionFunctions=true
1919
# Disallow overriding the default parser

‎test/jaxp/javax/xml/jaxp/unittest/common/config/files/jaxp.properties

+17-4
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,11 @@
4747
# the default property values. The format is:
4848
# system-property-name=value
4949
#
50-
# For example, the FILES property in CatalogFeatures has an associated system
51-
# property called javax.xml.catalog.files. An entry for the FILES property in the
52-
# configuration file would therefore use javax.xml.catalog.files as the key, that
50+
# For example, the RESOLVE property in CatalogFeatures has an associated system
51+
# property called javax.xml.catalog.resolve. An entry for the RESOLVE property in the
52+
# configuration file would therefore use javax.xml.catalog.resolve as the key, that
5353
# is:
54-
# javax.xml.catalog.files=strict
54+
# javax.xml.catalog.resolve=strict
5555
#
5656
#
5757
# Extension Functions:
@@ -128,6 +128,19 @@ jdk.xml.overrideDefaultParser=false
128128
#
129129
# javax.xml.useCatalog=true
130130
#
131+
# Implementation Specific Properties - jdkcatalog.resolve
132+
#
133+
# This property instructs the JDK default CatalogResolver to act in accordance with
134+
# the setting when unable to resolve an external reference with the built-in Catalog.
135+
# The options are:
136+
# continue -- indicates that the processing should continue
137+
# ignore -- indicates that the reference is skipped
138+
# strict -- indicates that the resolver should throw a CatalogException
139+
#
140+
# The following setting would cause the resolve to throw a CatalogException when
141+
# unable to resolve an external reference:
142+
# jdk.xml.jdkcatalog.resolve=strict
143+
#
131144
# Implementation Specific Properties - DTD
132145
#
133146
# This property instructs the parsers to: deny, ignore or allow DTD processing.

‎test/jaxp/javax/xml/jaxp/unittest/common/util/TestBase.java

+10-7
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ public class TestBase {
102102

103103
// Impl Specific Properties
104104
public static final String SP_DTD = "jdk.xml.dtd.support";
105-
public static final String SP_CATALOG = "jdk.xml.jdkCatalog.resolve";
105+
public static final String SP_CATALOG = "jdk.xml.jdkcatalog.resolve";
106106
public static final String OVERRIDE_PARSER = "jdk.xml.overrideDefaultParser";
107107

108108
// DTD/CATALOG constants
@@ -121,6 +121,7 @@ public class TestBase {
121121
// CATALOG=strict
122122
public static final String CONFIG_CATALOG_STRICT = "catalog2.properties";
123123

124+
public static final String UNKNOWN_HOST = "invalid.site.com";
124125

125126
String xmlExternalEntity, xmlExternalEntityId;
126127
String xmlGE_Expansion, xmlGE_ExpansionId;
@@ -334,15 +335,17 @@ protected void validate(String filename, SchemaFactory sf, boolean expectError,
334335

335336
protected void processError(boolean expectError, String error, Exception e)
336337
throws Exception {
337-
//e.printStackTrace();
338338
String str = e.getMessage();
339-
// System.out.println("Exp Msg: " + str);
340-
//e.printStackTrace();
341339
if (!expectError) {
342-
Assert.assertTrue(false, "Expected pass, but Exception is thrown " +
343-
str);
340+
Assert.assertTrue(false, "Expected pass, but Exception is thrown " + str);
344341
} else {
345-
Assert.assertTrue((str != null) && str.contains(error));
342+
// This check is necessary since errors other than UnknownHostException
343+
// can contain the host name in the System ID
344+
if (UNKNOWN_HOST.equals(error)) {
345+
Assert.assertTrue((str != null) && str.equals(error));
346+
} else {
347+
Assert.assertTrue((str != null) && str.contains(error));
348+
}
346349
}
347350
}
348351

0 commit comments

Comments
 (0)
Failed to load comments.