commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject svn commit: r1371748 - /commons/proper/io/trunk/src/test/java/org/apache/commons/io/input/BOMInputStreamTest.java
Date Fri, 10 Aug 2012 15:47:36 GMT
Author: ggregory
Date: Fri Aug 10 15:47:36 2012
New Revision: 1371748

URL: http://svn.apache.org/viewvc?rev=1371748&view=rev
Log:
Fix bug in tests.

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=1371748&r1=1371747&r2=1371748&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 15:47:36 2012
@@ -515,7 +515,7 @@ public class BOMInputStreamTest {
     @Test
     public void testReadWithBOMUtf8() throws Exception {
         byte[] data = "ABC".getBytes(Charsets.UTF_8);
-        BOMInputStream in = new BOMInputStream(createUtf8DataStream(data, true));
+        BOMInputStream in = new BOMInputStream(createUtf8DataStream(data, true), ByteOrderMark.UTF_8);
         assertEquals('A', in.read());
         assertEquals('B', in.read());
         assertEquals('C', in.read());
@@ -562,14 +562,14 @@ public class BOMInputStreamTest {
     @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)));
+        parseXml(new BOMInputStream(createUtf16BeDataStream(data, true), ByteOrderMark.UTF_16BE));
         parseXml(createUtf16BeDataStream(data, true));
     }
 
     @Test
     public void testReadXmlWithBOMUtf16Le() throws Exception {
         byte[] data = "<?xml version=\"1.0\" encoding=\"UTF-16LE\"?><X/>".getBytes(Charsets.UTF_16LE);
-        parseXml(new BOMInputStream(createUtf16LeDataStream(data, true)));
+        parseXml(new BOMInputStream(createUtf16LeDataStream(data, true), ByteOrderMark.UTF_16LE));
         parseXml(createUtf16LeDataStream(data, true));
     }
 
@@ -578,7 +578,7 @@ public class BOMInputStreamTest {
     public void testReadXmlWithBOMUtf32Be() throws Exception {
         Assume.assumeTrue(Charset.isSupported("UTF_32BE"));
         byte[] data = "<?xml version=\"1.0\" encoding=\"UTF-32BE\"?><X/>".getBytes("UTF_32BE");
-        parseXml(new BOMInputStream(createUtf32BeDataStream(data, true)));
+        parseXml(new BOMInputStream(createUtf32BeDataStream(data, true), ByteOrderMark.UTF_32BE));
         // Expect failure:        
         parseXml(createUtf32BeDataStream(data, true));
     }
@@ -588,7 +588,7 @@ public class BOMInputStreamTest {
     public void testReadXmlWithBOMUtf32Le() throws Exception {
         Assume.assumeTrue(Charset.isSupported("UTF_32LE"));
         byte[] data = "<?xml version=\"1.0\" encoding=\"UTF-32LE\"?><X/>".getBytes("UTF_32LE");
-        parseXml(new BOMInputStream(createUtf32LeDataStream(data, true)));
+        parseXml(new BOMInputStream(createUtf32LeDataStream(data, true), ByteOrderMark.UTF_32LE));
         // Expect failure:        
         parseXml(createUtf32LeDataStream(data, true));
     }



Mime
View raw message