Skip to content

Commit 7bb3df8

Browse files
committed
added test details
1 parent 3dce557 commit 7bb3df8

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/test/java/org/json/junit/XMLConfigurationTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -775,8 +775,8 @@ public void testToJSONArray_jsonOutput() {
775775
*/
776776
@Test
777777
public void testToJSONArray_jsonOutput_withKeepNumberAsString() {
778-
final String originalXml = "<root><id>01</id><id>1</id><id>00</id><id>0</id><item id=\"01\"/><title>True</title></root>";
779-
final JSONObject expected = new JSONObject("{\"root\":{\"item\":{\"id\":\"01\"},\"id\":[\"01\",\"1\",\"00\",\"0\"],\"title\":true}}");
778+
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>";
779+
final JSONObject expected = new JSONObject("{\"root\":{\"item\":{\"id\":\"01\"},\"id\":[\"01\",\"1\",\"00\",\"0\",null],\"title\":true}}");
780780
final JSONObject actualJsonOutput = XML.toJSONObject(originalXml,
781781
new XMLParserConfiguration().withKeepNumberAsString(true));
782782
Util.compareActualVsExpectedJsonObjects(actualJsonOutput,expected);
@@ -787,8 +787,8 @@ public void testToJSONArray_jsonOutput_withKeepNumberAsString() {
787787
*/
788788
@Test
789789
public void testToJSONArray_jsonOutput_withKeepBooleanAsString() {
790-
final String originalXml = "<root><id>01</id><id>1</id><id>00</id><id>0</id><item id=\"01\"/><title>True</title></root>";
791-
final JSONObject expected = new JSONObject("{\"root\":{\"item\":{\"id\":\"01\"},\"id\":[\"01\",1,\"00\",0],\"title\":\"True\"}}");
790+
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>";
791+
final JSONObject expected = new JSONObject("{\"root\":{\"item\":{\"id\":\"01\"},\"id\":[\"01\",1,\"00\",0,null],\"title\":\"True\"}}");
792792
final JSONObject actualJsonOutput = XML.toJSONObject(originalXml,
793793
new XMLParserConfiguration().withKeepBooleanAsString(true));
794794
Util.compareActualVsExpectedJsonObjects(actualJsonOutput,expected);

0 commit comments

Comments
 (0)