Skip to content

Commit

Permalink
Make sure serialization fails
Browse files Browse the repository at this point in the history
  • Loading branch information
Mairbek Khadikov committed May 31, 2017
1 parent 96a41c8 commit b37df27
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -730,14 +730,20 @@ public void serialization() {
reserializeAndAssert(Value.float64Array(BrokenSerializationList.of(.1, .2, .3)));
reserializeAndAssert(Value.float64Array((Iterable<Double>) null));

reserializeAndAssert(Value.stringArray(BrokenSerializationList.of("a", "b")));
BrokenSerializationList<String> of = BrokenSerializationList.of("a", "b");
reserializeAndAssert(Value.stringArray(of));
reserializeAndAssert(Value.stringArray(null));

reserializeAndAssert(
Value.bytesArray(BrokenSerializationList.of(newByteArray("a"), newByteArray("b"))));
reserializeAndAssert(Value.bytesArray(null));
}

@Test(expected = IllegalStateException.class)
public void verifyBrokenSerialization() {
reserializeAndAssert(BrokenSerializationList.of(1, 2, 3));
}

private static class BrokenSerializationList<T> extends ForwardingList<T> implements
Serializable {
private final List<T> delegate;
Expand Down

0 comments on commit b37df27

Please sign in to comment.