You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by sm...@apache.org on 2006/05/05 07:21:46 UTC
svn commit: r399968 -
/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/io/ObjectInputStreamTest.java
Author: smishura
Date: Thu May 4 22:21:44 2006
New Revision: 399968
URL: http://svn.apache.org/viewcvs?rev=399968&view=rev
Log:
Utilizing JUnit's assert methods and exception handling
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/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/io/ObjectInputStreamTest.java?rev=399968&r1=399967&r2=399968&view=diff
==============================================================================
--- 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 May 4 22:21:44 2006
@@ -531,23 +531,15 @@
* @tests java.io.ObjectInputStream#readObject()
*/
public void test_readObject() throws Exception {
- // Test for method java.lang.Object
- // java.io.ObjectInputStream.readObject()
- try {
- String s = "HelloWorld";
- oos.writeObject(s);
- oos.close();
- ois = new ObjectInputStream(new ByteArrayInputStream(bao
- .toByteArray()));
- assertTrue("Read incorrect Object value", ((String) ois
- .readObject()).equals(s));
- ois.close();
- } catch (IOException e) {
- fail("Exception serializing data : " + e.getMessage());
- } catch (ClassNotFoundException e) {
- fail("Exception serializing data : " + e.getMessage());
- }
-
+ // Test for method java.lang.Object
+ // java.io.ObjectInputStream.readObject()
+ String s = "HelloWorld";
+ oos.writeObject(s);
+ oos.close();
+ ois = new ObjectInputStream(new ByteArrayInputStream(bao.toByteArray()));
+ assertEquals("Read incorrect Object value", s, ois.readObject());
+ ois.close();
+
// Regression for HARMONY-91
// dynamically create serialization byte array for the next hierarchy:
// - class A implements Serializable