commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject svn commit: r1371756 - /commons/proper/io/trunk/src/test/java/org/apache/commons/io/input/BOMInputStreamTest.java
Date Fri, 10 Aug 2012 16:12:00 GMT
Author: ggregory
Date: Fri Aug 10 16:11:59 2012
New Revision: 1371756

URL: http://svn.apache.org/viewvc?rev=1371756&view=rev
Log:
Clean up testReadXmlWithBOMUcs2 and add testReadXmlWithBOMUcs4 (but no such enc on Oracle
1.6.0_31...)

Modified:
    commons/proper/io/trunk/src/test/java/org/apache/commons/io/input/BOMInputStreamTest.java

Modified: commons/proper/io/trunk/src/test/java/org/apache/commons/io/input/BOMInputStreamTest.java
URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/test/java/org/apache/commons/io/input/BOMInputStreamTest.java?rev=1371756&r1=1371755&r2=1371756&view=diff
==============================================================================
--- commons/proper/io/trunk/src/test/java/org/apache/commons/io/input/BOMInputStreamTest.java
(original)
+++ commons/proper/io/trunk/src/test/java/org/apache/commons/io/input/BOMInputStreamTest.java
Fri Aug 10 16:11:59 2012
@@ -564,13 +564,23 @@ public class BOMInputStreamTest {
         // UCS-2 is BE.
         Assume.assumeTrue(Charset.isSupported("ISO-10646-UCS-2"));
         byte[] data = "<?xml version=\"1.0\" encoding=\"ISO-10646-UCS-2\"?><X/>".getBytes("ISO-10646-UCS-2");
-        // XML parser does not know what to do with UTF-32
         parseXml(new BOMInputStream(createUtf16BeDataStream(data, true), ByteOrderMark.UTF_16BE));
-        // XML parser does not know what to do with UTF-32
         parseXml(createUtf16BeDataStream(data, true));
     }
 
     @Test
+    public void testReadXmlWithBOMUcs4() throws Exception {
+        // UCS-4 is BE or LE?
+        // Hm: ISO-10646-UCS-4 is not supported on Oracle 1.6.0_31
+        Assume.assumeTrue(Charset.isSupported("ISO-10646-UCS-4"));
+        byte[] data = "<?xml version=\"1.0\" encoding=\"ISO-10646-UCS-4\"?><X/>".getBytes("ISO-10646-UCS-4");
+        // XML parser does not know what to do with UTF-32
+        parseXml(new BOMInputStream(createUtf32BeDataStream(data, true), ByteOrderMark.UTF_32BE));
+        // XML parser does not know what to do with UTF-32
+        parseXml(createUtf32BeDataStream(data, true));
+    }
+
+    @Test
     public void testReadXmlWithBOMUtf16Be() throws Exception {
         byte[] data = "<?xml version=\"1.0\" encoding=\"UTF-16BE\"?><X/>".getBytes(Charsets.UTF_16BE);
         parseXml(new BOMInputStream(createUtf16BeDataStream(data, true), ByteOrderMark.UTF_16BE));



Mime
View raw message