harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From smish...@apache.org
Subject svn commit: r399968 - /incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/io/ObjectInputStreamTest.java
Date Fri, 05 May 2006 05:21:46 GMT
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



Mime
View raw message