Skip to content

Commit cde23cd

Browse files
committed
Test null in ObjectOutputStream.
1 parent 08f0810 commit cde23cd

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

xstream/src/test/com/thoughtworks/acceptance/MultipleObjectsInOneStreamTest.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ public void testDrivenThroughObjectStream() throws IOException, ClassNotFoundExc
123123
oos.writeInt(123);
124124
oos.writeObject("hello");
125125
oos.writeObject(new Software("tw", "xs"));
126+
oos.writeObject(null);
126127
oos.close();
127128

128129
final String expectedXml = ""
@@ -133,6 +134,7 @@ public void testDrivenThroughObjectStream() throws IOException, ClassNotFoundExc
133134
+ " <vendor>tw</vendor>\n"
134135
+ " <name>xs</name>\n"
135136
+ " </software>\n"
137+
+ " <null/>\n"
136138
+ "</object-stream>";
137139

138140
assertEquals(expectedXml, writer.toString());
@@ -141,6 +143,7 @@ public void testDrivenThroughObjectStream() throws IOException, ClassNotFoundExc
141143
assertEquals(123, ois.readInt());
142144
assertEquals("hello", ois.readObject());
143145
assertEquals(new Software("tw", "xs"), ois.readObject());
146+
assertNull(ois.readObject());
144147

145148
try {
146149
ois.readObject(); // As far as I can see this is the only clue the

0 commit comments

Comments
 (0)