Skip to content

Commit f69466f

Browse files
committed
recreate original documented issue
1 parent 1f4e836 commit f69466f

1 file changed

Lines changed: 43 additions & 1 deletion

File tree

XMLTest.java

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -438,5 +438,47 @@ public void contentOperations() {
438438
assertTrue("7. inner array size 2", jsonArray.length() == 2);
439439
assertTrue("7. inner array item 0", "val1".equals(jsonArray.get(0)));
440440
assertTrue("7. inner array item 1", "".equals(jsonArray.get(1)));
441-
}
441+
442+
/**
443+
* Confirm behavior of original issue
444+
*/
445+
String jsonStr =
446+
"{"+
447+
"\"Profile\": {"+
448+
"\"list\": {"+
449+
"\"history\": {"+
450+
"\"entries\": ["+
451+
"{"+
452+
"\"deviceId\": \"id\","+
453+
"\"content\": {"+
454+
"\"material\": ["+
455+
"{"+
456+
"\"stuff\": false"+
457+
"}"+
458+
"]"+
459+
"}"+
460+
"}"+
461+
"]"+
462+
"}"+
463+
"}"+
464+
"}"+
465+
"}";
466+
jsonObject = new JSONObject(jsonStr);
467+
xmlStr = XML.toString(jsonObject);
468+
/**
469+
* This is the created XML. Looks like content was mistaken for
470+
* complex (child node + text) XML.
471+
* <Profile>
472+
* <list>
473+
* <history>
474+
* <entries>
475+
* <deviceId>id</deviceId>
476+
* {&quot;material&quot;:[{&quot;stuff&quot;:false}]}
477+
* </entries>
478+
* </history>
479+
* </list>
480+
* </Profile>
481+
*/
482+
assertTrue("nothing to test here, see comment on created XML, above", true);
483+
}
442484
}

0 commit comments

Comments
 (0)