@@ -102,7 +102,7 @@ public class TestBase {
102
102
103
103
// Impl Specific Properties
104
104
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" ;
106
106
public static final String OVERRIDE_PARSER = "jdk.xml.overrideDefaultParser" ;
107
107
108
108
// DTD/CATALOG constants
@@ -121,6 +121,7 @@ public class TestBase {
121
121
// CATALOG=strict
122
122
public static final String CONFIG_CATALOG_STRICT = "catalog2.properties" ;
123
123
124
+ public static final String UNKNOWN_HOST = "invalid.site.com" ;
124
125
125
126
String xmlExternalEntity , xmlExternalEntityId ;
126
127
String xmlGE_Expansion , xmlGE_ExpansionId ;
@@ -334,15 +335,17 @@ protected void validate(String filename, SchemaFactory sf, boolean expectError,
334
335
335
336
protected void processError (boolean expectError , String error , Exception e )
336
337
throws Exception {
337
- //e.printStackTrace();
338
338
String str = e .getMessage ();
339
- // System.out.println("Exp Msg: " + str);
340
- //e.printStackTrace();
341
339
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 );
344
341
} 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
+ }
346
349
}
347
350
}
348
351
0 commit comments