You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2012/04/06 15:52:24 UTC

svn commit: r1310328 - /commons/proper/io/trunk/src/test/java/org/apache/commons/io/input/XmlStreamReaderTest.java

Author: ggregory
Date: Fri Apr  6 13:52:24 2012
New Revision: 1310328

URL: http://svn.apache.org/viewvc?rev=1310328&view=rev
Log:
[IO-320] Add XmlStreamReader support for UTF-32. Add DOM data and commented out call sites for UTF-32 BE and LE tests.

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

Modified: commons/proper/io/trunk/src/test/java/org/apache/commons/io/input/XmlStreamReaderTest.java
URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/test/java/org/apache/commons/io/input/XmlStreamReaderTest.java?rev=1310328&r1=1310327&r2=1310328&view=diff
==============================================================================
--- commons/proper/io/trunk/src/test/java/org/apache/commons/io/input/XmlStreamReaderTest.java (original)
+++ commons/proper/io/trunk/src/test/java/org/apache/commons/io/input/XmlStreamReaderTest.java Fri Apr  6 13:52:24 2012
@@ -74,6 +74,10 @@ public class XmlStreamReaderTest extends
     public void testRawNoBom() throws Exception {
         _testRawNoBomValid("US-ASCII");
         _testRawNoBomValid("UTF-8");
+        _testRawNoBomValid("UTF-16BE");
+        _testRawNoBomValid("UTF-16LE");
+        //_testRawNoBomValid("UTF-32BE");
+        //_testRawNoBomValid("UTF-32LE");
         _testRawNoBomValid("ISO-8859-1");
         _testRawNoBomValid("CP1047");
     }
@@ -108,6 +112,8 @@ public class XmlStreamReaderTest extends
         _testRawBomValid("UTF-8");
         _testRawBomValid("UTF-16BE");
         _testRawBomValid("UTF-16LE");
+        //_testRawBomValid("UTF-32BE");
+        //_testRawBomValid("UTF-32LE");
         _testRawBomValid("UTF-16");
 
         _testRawBomInvalid("UTF-8-bom", "US-ASCII", "US-ASCII");
@@ -316,6 +322,8 @@ public class XmlStreamReaderTest extends
     private static final int[] NO_BOM_BYTES = {};
     private static final int[] UTF_16BE_BOM_BYTES = { 0xFE, 0xFF };
     private static final int[] UTF_16LE_BOM_BYTES = { 0xFF, 0XFE };
+    private static final int[] UTF_32BE_BOM_BYTES = { 0x00, 0x00, 0xFE, 0xFF };
+    private static final int[] UTF_32LE_BOM_BYTES = { 0xFF, 0XFE, 0x00, 0x00 };
     private static final int[] UTF_8_BOM_BYTES = { 0xEF, 0xBB, 0xBF };
 
     private static final Map<String, int[]> BOMs = new HashMap<String, int[]>();
@@ -324,6 +332,8 @@ public class XmlStreamReaderTest extends
         BOMs.put("no-bom", NO_BOM_BYTES);
         BOMs.put("UTF-16BE-bom", UTF_16BE_BOM_BYTES);
         BOMs.put("UTF-16LE-bom", UTF_16LE_BOM_BYTES);
+        BOMs.put("UTF-32BE-bom", UTF_32BE_BOM_BYTES);
+        BOMs.put("UTF-32LE-bom", UTF_32LE_BOM_BYTES);
         BOMs.put("UTF-16-bom", NO_BOM_BYTES); // it's added by the writer
         BOMs.put("UTF-8-bom", UTF_8_BOM_BYTES);
     }