harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From telli...@apache.org
Subject svn commit: r617093 - /harmony/enhanced/classlib/trunk/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/io/InputStreamReaderTest.java
Date Thu, 31 Jan 2008 10:33:24 GMT
Author: tellison
Date: Thu Jan 31 02:33:13 2008
New Revision: 617093

URL: http://svn.apache.org/viewvc?rev=617093&view=rev
Log:
Adapt InputStreamReader#test_getEncoding to check alias name
returns encoding standard name.

Modified:
    harmony/enhanced/classlib/trunk/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/io/InputStreamReaderTest.java

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/io/InputStreamReaderTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/io/InputStreamReaderTest.java?rev=617093&r1=617092&r2=617093&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/io/InputStreamReaderTest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/io/InputStreamReaderTest.java
Thu Jan 31 02:33:13 2008
@@ -300,24 +300,25 @@
      * @tests java.io.InputStreamReader#getEncoding()
      */
     public void test_getEncoding() throws IOException {
-        try {
-            is = new InputStreamReader(fis, "8859_1");
-        } catch (UnsupportedEncodingException e) {
-            assertEquals("Returned incorrect encoding", "8859_1", is.getEncoding());
-        }
+        InputStreamReader isr = new InputStreamReader(fis, "8859_1");
+        assertEquals("Returned incorrect encoding when setting 8859_1",
+                "ISO8859_1", isr.getEncoding());
+
+        isr = new InputStreamReader(fis, "ISO-8859-1");
+        assertEquals("Returned incorrect encoding when setting ISO-8859-1",
+                "ISO8859_1", isr.getEncoding());
 
-        InputStreamReader in = null;
         byte b[] = new byte[5];
-        in = new InputStreamReader(new ByteArrayInputStream(b), "UTF-16BE");
-        in.close();
-        assertNull(in.getEncoding());
+        isr = new InputStreamReader(new ByteArrayInputStream(b), "UTF-16BE");
+        isr.close();
+        assertNull(isr.getEncoding());
 
         try {
-            in = new InputStreamReader(System.in, "UTF-16BE");
+            isr = new InputStreamReader(System.in, "UTF-16BE");
         } catch (UnsupportedEncodingException e) {
             // Ignored
         }
-        assertEquals("UnicodeBigUnmarked", in.getEncoding());
+        assertEquals("UnicodeBigUnmarked", isr.getEncoding());
     }
 
     /**



Mime
View raw message