harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From odea...@apache.org
Subject svn commit: r764818 - /harmony/enhanced/classlib/trunk/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/io/ObjectInputStreamTest.java
Date Tue, 14 Apr 2009 15:05:46 GMT
Author: odeakin
Date: Tue Apr 14 15:05:45 2009
New Revision: 764818

URL: http://svn.apache.org/viewvc?rev=764818&view=rev
Log:
Make sure we use UTF-8 encoding for non-ASCII platforms.

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

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/io/ObjectInputStreamTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/io/ObjectInputStreamTest.java?rev=764818&r1=764817&r2=764818&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/io/ObjectInputStreamTest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/io/ObjectInputStreamTest.java
Tue Apr 14 15:05:45 2009
@@ -332,7 +332,7 @@
         ois.read(buf, 0, 10);
         ois.close();
         assertEquals("Read incorrect bytes", "HelloWorld", new String(buf, 0,
-                10));
+                10, "UTF-8"));
     }
 
     /**
@@ -428,7 +428,7 @@
         ois.readFully(buf);
         ois.close();
         assertEquals("Read incorrect bytes", "HelloWorld", new String(buf, 0,
-                10));
+                10, "UTF-8"));
     }
 
     /**
@@ -442,7 +442,7 @@
         ois.readFully(buf, 0, 10);
         ois.close();
         assertEquals("Read incorrect bytes", "HelloWorld", new String(buf, 0,
-                10));
+                10, "UTF-8"));
     }
 
     /**
@@ -499,8 +499,8 @@
         // - class A implements Serializable
         // - class C extends A
 
-        byte[] cName = C.class.getName().getBytes();
-        byte[] aName = A.class.getName().getBytes();
+        byte[] cName = C.class.getName().getBytes("UTF-8");
+        byte[] aName = A.class.getName().getBytes("UTF-8");
 
         ByteArrayOutputStream out = new ByteArrayOutputStream();
 
@@ -675,7 +675,7 @@
         ois.skipBytes(5);
         ois.read(buf, 0, 5);
         ois.close();
-        assertEquals("Skipped incorrect bytes", "World", new String(buf, 0, 5));
+        assertEquals("Skipped incorrect bytes", "World", new String(buf, 0, 5, "UTF-8"));
 
         // Regression for HARMONY-844
         try {



Mime
View raw message