logging-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject svn commit: r1482950 - /logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/helpers/CharsetsTest.java
Date Wed, 15 May 2013 16:49:12 GMT
Author: ggregory
Date: Wed May 15 16:49:12 2013
New Revision: 1482950

URL: http://svn.apache.org/r1482950
Log:
Selectively test for KOI8-R, it is not a required encoding.

Modified:
    logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/helpers/CharsetsTest.java

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/helpers/CharsetsTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/helpers/CharsetsTest.java?rev=1482950&r1=1482949&r2=1482950&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/helpers/CharsetsTest.java
(original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/helpers/CharsetsTest.java
Wed May 15 16:49:12 2013
@@ -38,7 +38,7 @@ public class CharsetsTest {
         assertSame(Charset.defaultCharset(), actual);
     }
 
-    @Test(expected=IllegalCharsetNameException.class)
+    @Test(expected = IllegalCharsetNameException.class)
     public void testThrowsExceptionIfNameIsIllegal() {
         Charset actual = Charsets.getSupportedCharset("spaces not allowed");
         assertSame(Charset.defaultCharset(), actual);
@@ -52,8 +52,12 @@ public class CharsetsTest {
         Charset actual2 = Charsets.getSupportedCharset("ISO-8859-1");
         assertSame(Charset.forName("ISO-8859-1"), actual2);
 
-        Charset actual3 = Charsets.getSupportedCharset("KOI8-R");
-        assertSame(Charset.forName("KOI8-R"), actual3);
+        // This part of the test is NOT portable across all Java platforms.
+        // There is no guarantee that KOI8-R is on any given platform
+        if (Charset.isSupported("KOI8-R")) {
+            Charset actual3 = Charsets.getSupportedCharset("KOI8-R");
+            assertSame(Charset.forName("KOI8-R"), actual3);
+        }
     }
 
 }



Mime
View raw message