Skip to content

Commit

Permalink
manual merge of pull request stleary#18
Browse files Browse the repository at this point in the history
  • Loading branch information
stleary committed Jul 19, 2015
1 parent 2c026eb commit f48b643
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions XMLTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -321,4 +321,20 @@ public void shouldHandleIllegalJSONNodeNames()

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);
}
}

0 comments on commit f48b643

Please sign in to comment.