Index: C:/harmony/trunk_0427/modules/luni/src/test/java/tests/api/java/io/ObjectInputStreamTest.java =================================================================== --- C:/harmony/trunk_0427/modules/luni/src/test/java/tests/api/java/io/ObjectInputStreamTest.java (revision 421079) +++ C:/harmony/trunk_0427/modules/luni/src/test/java/tests/api/java/io/ObjectInputStreamTest.java (working copy) @@ -23,6 +23,7 @@ import java.io.NotActiveException; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; +import java.io.ObjectStreamClass; import java.io.Serializable; import java.io.StreamCorruptedException; import java.util.Hashtable; @@ -612,6 +613,17 @@ out.toByteArray())); Object o = ois.readObject(); assertEquals(C.class, o.getClass()); + + //regression test for HARMONY-846 + assertNull(new testObjectInputStream().readObject()); + } + + /** + * @tests java.io.ObjectInputStream#readObjectOverride() + */ + public void test_readObjectOverride() throws Exception { + //regression test for HARMONY-846 + assertNull(new testObjectInputStream().readObjectOverride()); } public static class A implements Serializable { @@ -724,7 +736,7 @@ /** * @tests java.io.ObjectInputStream#skipBytes(int) */ - public void test_skipBytesI() { + public void test_skipBytesI() throws IOException { // Test for method int java.io.ObjectInputStream.skipBytes(int) try { byte[] buf = new byte[10]; @@ -740,8 +752,28 @@ } catch (IOException e) { fail("Exception serializing data : " + e.getMessage()); } + + // regression test for HARMONY-844 + try { + new testObjectInputStream().skipBytes(0); + fail("Exception expected"); + } catch (NullPointerException npe) { + //expected + } } + class testObjectInputStream extends ObjectInputStream { + public testObjectInputStream() throws IOException { + super(); + } + public Object readObjectOverride() throws IOException, ClassNotFoundException{ + return super.readObjectOverride(); + } + public ObjectStreamClass readClassDescriptor() throws IOException, ClassNotFoundException{ + return super.readClassDescriptor(); + } + } + /** * Sets up the fixture, for example, open a network connection. This method * is called before a test is executed.