harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From smish...@apache.org
Subject svn commit: r450776 - /incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/io/ObjectInputStreamTest.java
Date Thu, 28 Sep 2006 09:46:39 GMT
Author: smishura
Date: Thu Sep 28 02:46:39 2006
New Revision: 450776

URL: http://svn.apache.org/viewvc?view=rev&rev=450776
Log:
Apply modified patch for HARMONY-1620 ([classlib][luni]Use serialization test framework in
ObjectInputStreamTest)

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

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/io/ObjectInputStreamTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/io/ObjectInputStreamTest.java?view=diff&rev=450776&r1=450775&r2=450776
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/io/ObjectInputStreamTest.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/io/ObjectInputStreamTest.java
Thu Sep 28 02:46:39 2006
@@ -17,7 +17,6 @@
 
 import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
-import java.io.FileOutputStream;
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.NotActiveException;
@@ -30,7 +29,8 @@
 import java.util.Hashtable;
 import java.util.Vector;
 
-import tests.support.resource.Support_Resources;
+import org.apache.harmony.testframework.serialization.SerializationTest;
+import org.apache.harmony.testframework.serialization.SerializationTest.SerializableAssert;
 
 public class ObjectInputStreamTest extends junit.framework.TestCase implements
         Serializable {
@@ -109,18 +109,12 @@
      * @tests java.io.ObjectInputStream#readObject()
      */
     public void test_readObjectMissingClasses() throws Exception {
-        // To create or update the resource, uncomment the following, and
-        // the B1 class definition and references above.
-        ObjectOutputStream out = new ObjectOutputStream(new FileOutputStream(
-                "hyts_missingclass.ser"));
-        out.writeObject(new tests.api.java.io.ObjectInputStreamTest.A1());
-        out.close();
-
-        ObjectInputStream in = new ObjectInputStream(Support_Resources
-                .getStream("hyts_missingclass.ser"));
-        in.readObject();
-        in.close();
-        // the serialized data should load without any exceptions.
+        SerializationTest.verifySelf(new A1(), new SerializableAssert() {
+            public void assertDeserialized(Serializable initial,
+                    Serializable deserialized) {
+                assertEquals(5, ((A1) deserialized).b1.i);
+            }
+        });
     }
 
     /**



Mime
View raw message