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:
parent
2c026eb5f8
commit
f48b6439f6
1 changed files with 16 additions and 0 deletions
16
XMLTest.java
16
XMLTest.java
|
@ -321,4 +321,20 @@ public class XMLTest {
|
||||||
|
|
||||||
assertEquals(expected, result);
|
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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue