forked from FasterXML/jackson-jr
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Using Stream Builder to deserialization of int[] (FasterXML#125)
- Loading branch information
Showing
7 changed files
with
79 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 0 additions & 17 deletions
17
jr-objects/src/test/java/com/fasterxml/jackson/jr/failing/ReadIntArray7Test.java
This file was deleted.
Oops, something went wrong.
33 changes: 33 additions & 0 deletions
33
jr-objects/src/test/java/com/fasterxml/jackson/jr/ob/ReadIntArray7Test.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package com.fasterxml.jackson.jr.ob; | ||
|
||
import static org.junit.Assert.assertArrayEquals; | ||
|
||
public class ReadIntArray7Test extends TestBase { | ||
public void testReadIntArray() throws Exception { | ||
final int[] input = new int[]{1, 2, 3, 25, 999}; | ||
String json = JSON.std.asString(input); | ||
int[] result = JSON.std.beanFrom(int[].class, json); | ||
assertArrayEquals(input, result); | ||
} | ||
|
||
public void testReadIntArray2() throws Exception { | ||
final int[][] input = new int[][]{{1, 2, 3, 25, 999},{456,678,789},{1},{},{1000,2000,3000}}; | ||
String json = JSON.std.asString(input); | ||
int[][] result = JSON.std.beanFrom(int[][].class, json); | ||
assertArrayEquals(input, result); | ||
} | ||
|
||
public void testReadIntArray3() throws Exception { | ||
final int[][][] input = new int[][][]{{{1, 2, 3, 25, 999},{6,7,3}},{{456}, {678, 789}},{},{{},{23}},{{}}}; | ||
String json = JSON.std.asString(input); | ||
int[][][] result = JSON.std.beanFrom(int[][][].class, json); | ||
assertArrayEquals(input, result); | ||
} | ||
|
||
public void testReadIntArrayWhenEmpty() throws Exception { | ||
final int[][][] input = new int[][][]{}; | ||
String json = JSON.std.asString(input); | ||
int[][][] result = JSON.std.beanFrom(int[][][].class, json); | ||
assertArrayEquals(input, result); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 0 additions & 2 deletions
2
jr-objects/src/test/java/com/fasterxml/jackson/jr/ob/ReadWithCtors25Test.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters