Skip to content

Commit f48b643

Browse files
committed
manual merge of pull request stleary#18
1 parent 2c026eb commit f48b643

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

XMLTest.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,4 +321,20 @@ public void shouldHandleIllegalJSONNodeNames()
321321

322322
assertEquals(expected, result);
323323
}
324+
325+
@Test
326+
public void shouldHandleNullNodeValue()
327+
{
328+
JSONObject inputJSON = new JSONObject();
329+
inputJSON.put("nullValue", JSONObject.NULL);
330+
// This is a possible preferred result
331+
String expectedXML = "<nullValue/>";
332+
String actualXML = "<nullValue>null</nullValue>";
333+
/**
334+
* This is the current behavior. JSONObject.NULL is emitted as
335+
* the string, "null".
336+
*/
337+
String resultXML = XML.toString(inputJSON);
338+
assertEquals(actualXML, resultXML);
339+
}
324340
}

0 commit comments

Comments
 (0)