You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by ay...@apache.org on 2007/03/01 14:28:25 UTC
svn commit: r513312 -
/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/io/ObjectOutputStreamTest.java
Author: ayza
Date: Thu Mar 1 05:28:24 2007
New Revision: 513312
URL: http://svn.apache.org/viewvc?view=rev&rev=513312
Log:
Cosmetic update of ObjectOutputStreamTest. Relates to HARMONY-3158.
Modified:
harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/io/ObjectOutputStreamTest.java
Modified: harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/io/ObjectOutputStreamTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/io/ObjectOutputStreamTest.java?view=diff&rev=513312&r1=513311&r2=513312
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/io/ObjectOutputStreamTest.java (original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/io/ObjectOutputStreamTest.java Thu Mar 1 05:28:24 2007
@@ -1257,6 +1257,10 @@
assertTrue("replaceObject has not been called", (obj instanceof Long));
// Regression for HARMONY-3158
+ Object obj1;
+ Object obj2;
+ Object obj3;
+
baos = new ByteArrayOutputStream();
oos = new ObjectOutputStreamWithReplace(baos);
@@ -1266,13 +1270,17 @@
oos.flush();
ois = new ObjectInputStream(new ByteArrayInputStream (baos.toByteArray()));
- Object obj1 = ois.readObject();
- Object obj2 = ois.readObject();
- Object obj3 = ois.readObject();
+ obj1 = ois.readObject();
+ obj2 = ois.readObject();
+ obj3 = ois.readObject();
oos.close();
ois.close();
- assertTrue("1st replaceObject worked incorrectly", (obj1 instanceof Long) && (((Long) obj1).longValue() == 99));
- assertEquals("2nd replaceObject worked incorrectly", obj2, Integer.class);
- assertEquals("3rd replaceObject worked incorrectly", obj3.getClass(), ObjectStreamClass.class);
+
+ assertTrue("1st replaceObject worked incorrectly", obj1 instanceof Long);
+ assertEquals("1st replaceObject worked incorrectly",
+ 99, ((Long) obj1).longValue());
+ assertEquals("2nd replaceObject worked incorrectly", Integer.class, obj2);
+ assertEquals("3rd replaceObject worked incorrectly",
+ ObjectStreamClass.class, obj3.getClass());
}
}