Skip to content

Commit

Permalink
Minor test improvement (wrt #479)
Browse files Browse the repository at this point in the history
  • Loading branch information
cowtowncoder committed Jun 4, 2014
1 parent f5485d3 commit dfd3b66
Showing 1 changed file with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,6 @@
public class TestArrayDeserialization
extends BaseMapTest
{
/*
/**********************************************************
/* Helper classes
/**********************************************************
*/

public final static class Bean1
{
int _x, _y;
Expand Down Expand Up @@ -252,7 +246,7 @@ public void testStringArray() throws Exception
"a", "b", "abcd", "", "???", "\"quoted\"", "lf: \n",
};
StringWriter sw = new StringWriter();
JsonGenerator jg = new JsonFactory().createGenerator(sw);
JsonGenerator jg = MAPPER.getFactory().createGenerator(sw);
jg.writeStartArray();
for (String str : STRS) {
jg.writeString(str);
Expand All @@ -267,6 +261,12 @@ public void testStringArray() throws Exception
for (int i = 0; i < STRS.length; ++i) {
assertEquals(STRS[i], result[i]);
}

// [#479]: null handling was busted in 2.4.0
result = MAPPER.readValue(" [ null ]", String[].class);
assertNotNull(result);
assertEquals(1, result.length);
assertNull(result[0]);
}

public void testCharArray() throws Exception
Expand Down

0 comments on commit dfd3b66

Please sign in to comment.