1
0
Fork 0
mirror of https://github.com/ethauvin/JSON-java.git synced 2025-06-17 07:50:52 -07:00

manual merge of pull request #18

This commit is contained in:
stleary 2015-07-19 09:02:27 -05:00
parent 2c026eb5f8
commit f48b6439f6

View file

@ -321,4 +321,20 @@ public class XMLTest {
assertEquals(expected, result);
}
@Test
public void shouldHandleNullNodeValue()
{
JSONObject inputJSON = new JSONObject();
inputJSON.put("nullValue", JSONObject.NULL);
// This is a possible preferred result
String expectedXML = "<nullValue/>";
String actualXML = "<nullValue>null</nullValue>";
/**
* This is the current behavior. JSONObject.NULL is emitted as
* the string, "null".
*/
String resultXML = XML.toString(inputJSON);
assertEquals(actualXML, resultXML);
}
}