commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject svn commit: r1302747 - /commons/proper/io/trunk/src/test/java/org/apache/commons/io/ByteOrderMarkTestCase.java
Date Tue, 20 Mar 2012 01:32:37 GMT
Author: ggregory
Date: Tue Mar 20 01:32:37 2012
New Revision: 1302747

URL: http://svn.apache.org/viewvc?rev=1302747&view=rev
Log:
Tests that {@link ByteOrderMark#getCharsetName()} can be loaded as a {@link java.nio.charset.Charset}
as advertised.

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

Modified: commons/proper/io/trunk/src/test/java/org/apache/commons/io/ByteOrderMarkTestCase.java
URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/test/java/org/apache/commons/io/ByteOrderMarkTestCase.java?rev=1302747&r1=1302746&r2=1302747&view=diff
==============================================================================
--- commons/proper/io/trunk/src/test/java/org/apache/commons/io/ByteOrderMarkTestCase.java
(original)
+++ commons/proper/io/trunk/src/test/java/org/apache/commons/io/ByteOrderMarkTestCase.java
Tue Mar 20 01:32:37 2012
@@ -16,6 +16,7 @@
  */
 package org.apache.commons.io;
 
+import java.nio.charset.Charset;
 import java.util.Arrays;
 
 import org.apache.commons.io.testtools.FileBasedTestCase;
@@ -43,6 +44,13 @@ public class ByteOrderMarkTestCase exten
         assertEquals("test3 name", "test3", TEST_BOM_3.getCharsetName());
     }
 
+    /** Tests that {@link ByteOrderMark#getCharsetName()} can be loaded as a {@link java.nio.charset.Charset}
as advertised. */
+    public void testConstantCharsetNames() {
+        assertNotNull(Charset.forName(ByteOrderMark.UTF_16BE.getCharsetName()));
+        assertNotNull(Charset.forName(ByteOrderMark.UTF_16LE.getCharsetName()));
+        assertNotNull(Charset.forName(ByteOrderMark.UTF_8.getCharsetName()));
+    }
+
     /** Test {@link ByteOrderMark#length()} */
     public void testLength() {
         assertEquals("test1 length", 1, TEST_BOM_1.length());



Mime
View raw message