Minor test fixes. Explicitly fail test if the expected exception was not thrown.
This commit is contained in:
parent
de0f8da151
commit
3fc4bcc061
@ -31,7 +31,6 @@ import java.lang.reflect.Type;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* Functional tests for Json serialization and deserialization of arrays.
|
||||
*
|
||||
@ -81,7 +80,7 @@ public class ArrayTest extends TestCase {
|
||||
|
||||
actualObject = gson.fromJson("[ ]", int[].class);
|
||||
assertTrue(actualObject.length == 0);
|
||||
}
|
||||
}
|
||||
|
||||
public void testNullsInArraySerialization() {
|
||||
String[] array = {"foo", null, "bar"};
|
||||
@ -219,6 +218,7 @@ public class ArrayTest extends TestCase {
|
||||
String json = "[1,'abc',{a:1},5]";
|
||||
try {
|
||||
gson.fromJson(json, Object[].class);
|
||||
fail("This is crazy....how did we deserialize it!!!");
|
||||
} catch (JsonParseException expected) {
|
||||
}
|
||||
}
|
||||
@ -227,6 +227,7 @@ public class ArrayTest extends TestCase {
|
||||
String json = "[1,'abc',[1,2],5]";
|
||||
try {
|
||||
gson.fromJson(json, Object[].class);
|
||||
fail("This is crazy....how did we deserialize it!!!");
|
||||
} catch (JsonParseException expected) {
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user