8065748: Add a test to verify that non ascii characters in Encodings.properties do not cause issues
authordfuchs
Wed, 26 Nov 2014 20:10:48 +0100
changeset 27774 659f0511ec75
parent 27773 938fb14f357a
child 27775 4ee8b208017c
child 27794 c8bb28d30418
8065748: Add a test to verify that non ascii characters in Encodings.properties do not cause issues Reviewed-by: joehw
jdk/test/javax/xml/jaxp/Encodings/CheckEncodingPropertiesFile.java
--- a/jdk/test/javax/xml/jaxp/Encodings/CheckEncodingPropertiesFile.java	Wed Nov 26 11:12:19 2014 -0800
+++ b/jdk/test/javax/xml/jaxp/Encodings/CheckEncodingPropertiesFile.java	Wed Nov 26 20:10:48 2014 +0100
@@ -23,7 +23,7 @@
 
 /**
  * @test
- * @bug 8008738
+ * @bug 8008738 8065138
  * @summary checks that the mapping implemented by
  *      com.sun.org.apache.xml.internal.serializer.Encodings
  *      correctly identifies valid Charset names and
@@ -64,6 +64,15 @@
             props.load(is);
         }
 
+       if (!props.containsKey("UTF8")) {
+           // If the test fails here - it may indicate that you stumbled on an
+           // issue similar to that fixed by JDK-8065138.
+           // Check that the content of the Encodings.properties included in
+           // the tested build image matches the content of the file in the source
+           // jaxp tree of the jdk forest.
+           throw new RuntimeException("UTF8 key missing in " + ClassLoader.getSystemResource(ENCODINGS_FILE));
+       }
+
         //printAllCharsets();
 
         test(props);