mirror of
https://github.com/stleary/JSON-java.git
synced 2025-08-03 11:25:30 -04:00
added test details
This commit is contained in:
parent
3dce55794f
commit
7bb3df8ebf
@ -775,8 +775,8 @@ public class XMLConfigurationTest {
|
|||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
public void testToJSONArray_jsonOutput_withKeepNumberAsString() {
|
public void testToJSONArray_jsonOutput_withKeepNumberAsString() {
|
||||||
final String originalXml = "<root><id>01</id><id>1</id><id>00</id><id>0</id><item id=\"01\"/><title>True</title></root>";
|
final String originalXml = "<root><id>01</id><id>1</id><id>00</id><id>0</id><id>null</id><item id=\"01\"/><title>True</title></root>";
|
||||||
final JSONObject expected = new JSONObject("{\"root\":{\"item\":{\"id\":\"01\"},\"id\":[\"01\",\"1\",\"00\",\"0\"],\"title\":true}}");
|
final JSONObject expected = new JSONObject("{\"root\":{\"item\":{\"id\":\"01\"},\"id\":[\"01\",\"1\",\"00\",\"0\",null],\"title\":true}}");
|
||||||
final JSONObject actualJsonOutput = XML.toJSONObject(originalXml,
|
final JSONObject actualJsonOutput = XML.toJSONObject(originalXml,
|
||||||
new XMLParserConfiguration().withKeepNumberAsString(true));
|
new XMLParserConfiguration().withKeepNumberAsString(true));
|
||||||
Util.compareActualVsExpectedJsonObjects(actualJsonOutput,expected);
|
Util.compareActualVsExpectedJsonObjects(actualJsonOutput,expected);
|
||||||
@ -787,8 +787,8 @@ public class XMLConfigurationTest {
|
|||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
public void testToJSONArray_jsonOutput_withKeepBooleanAsString() {
|
public void testToJSONArray_jsonOutput_withKeepBooleanAsString() {
|
||||||
final String originalXml = "<root><id>01</id><id>1</id><id>00</id><id>0</id><item id=\"01\"/><title>True</title></root>";
|
final String originalXml = "<root><id>01</id><id>1</id><id>00</id><id>0</id><id>null</id><item id=\"01\"/><title>True</title></root>";
|
||||||
final JSONObject expected = new JSONObject("{\"root\":{\"item\":{\"id\":\"01\"},\"id\":[\"01\",1,\"00\",0],\"title\":\"True\"}}");
|
final JSONObject expected = new JSONObject("{\"root\":{\"item\":{\"id\":\"01\"},\"id\":[\"01\",1,\"00\",0,null],\"title\":\"True\"}}");
|
||||||
final JSONObject actualJsonOutput = XML.toJSONObject(originalXml,
|
final JSONObject actualJsonOutput = XML.toJSONObject(originalXml,
|
||||||
new XMLParserConfiguration().withKeepBooleanAsString(true));
|
new XMLParserConfiguration().withKeepBooleanAsString(true));
|
||||||
Util.compareActualVsExpectedJsonObjects(actualJsonOutput,expected);
|
Util.compareActualVsExpectedJsonObjects(actualJsonOutput,expected);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user