commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brentwor...@apache.org
Subject svn commit: r1535374 - /commons/proper/io/trunk/src/test/java/org/apache/commons/io/input/CharSequenceInputStreamTest.java
Date Thu, 24 Oct 2013 13:22:07 GMT
Author: brentworden
Date: Thu Oct 24 13:22:07 2013
New Revision: 1535374

URL: http://svn.apache.org/r1535374
Log:
exclude variation of the sun.nio.cs.ext.COMPOUND_TEXT_Encorder charset name when testing stream
availability and skipping.

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

Modified: commons/proper/io/trunk/src/test/java/org/apache/commons/io/input/CharSequenceInputStreamTest.java
URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/test/java/org/apache/commons/io/input/CharSequenceInputStreamTest.java?rev=1535374&r1=1535373&r2=1535374&view=diff
==============================================================================
--- commons/proper/io/trunk/src/test/java/org/apache/commons/io/input/CharSequenceInputStreamTest.java
(original)
+++ commons/proper/io/trunk/src/test/java/org/apache/commons/io/input/CharSequenceInputStreamTest.java
Thu Oct 24 13:22:07 2013
@@ -92,7 +92,7 @@ public class CharSequenceInputStreamTest
     public void testBufferedRead_AvailableCharset() throws IOException {
         for (final String csName : Charset.availableCharsets().keySet()) {
             // prevent java.lang.UnsupportedOperationException at sun.nio.cs.ext.ISO2022_CN.newEncoder.
-            if (Charset.forName(csName).canEncode() && ! "COMPOUND_TEXT".equalsIgnoreCase(csName))
{
+            if (isAvailabilityTestableForCharset(csName)) {
                 testBufferedRead(TEST_STRING, csName);
             }
         }
@@ -426,10 +426,14 @@ public class CharSequenceInputStreamTest
 //            at org.apache.commons.io.input.CharSequenceInputStreamTest.testAvailableRead(CharSequenceInputStreamTest.java:412)
 //            at org.apache.commons.io.input.CharSequenceInputStreamTest.testAvailable(CharSequenceInputStreamTest.java:424)
 
-            if (Charset.forName(csName).canEncode() && ! "COMPOUND_TEXT".equalsIgnoreCase(csName)
&& ! "x-COMPOUND_TEXT".equalsIgnoreCase(csName)) {
+            if (isAvailabilityTestableForCharset(csName)) {
                 testAvailableSkip(csName);
                 testAvailableRead(csName);
             }
         }
     }
+
+    private boolean isAvailabilityTestableForCharset(final String csName) {
+        return Charset.forName(csName).canEncode() && ! "COMPOUND_TEXT".equalsIgnoreCase(csName)
&& ! "x-COMPOUND_TEXT".equalsIgnoreCase(csName);
+    }
 }



Mime
View raw message