mirror of
https://github.com/stleary/JSON-java.git
synced 2026-05-19 00:00:46 -04:00
Revert "Merge pull request #888 from rikkarth/fix/887"
This reverts commit14f71274f7, reversing changes made to054786e300.
This commit is contained in:
@@ -265,13 +265,11 @@ public class XMLTest {
|
||||
" </address>\n"+
|
||||
"</addresses>";
|
||||
|
||||
// TODO: fails in strict mode because -23x.45 was not surrounded by quotes.
|
||||
// Should be split into a strictMode test, and a similar non-strictMode test
|
||||
String expectedStr =
|
||||
"{\"addresses\":{\"address\":{\"street\":\"[CDATA[Baker street 5]\","+
|
||||
"\"name\":\"Joe Tester\",\"NothingHere\":\"\",\"TrueValue\":true,\n"+
|
||||
"\"name\":\"Joe Tester\",\"NothingHere\":\"\",TrueValue:true,\n"+
|
||||
"\"FalseValue\":false,\"NullValue\":null,\"PositiveValue\":42,\n"+
|
||||
"\"NegativeValue\":-23,\"DoubleValue\":-23.45,\"Nan\":\"-23x.45\",\n"+
|
||||
"\"NegativeValue\":-23,\"DoubleValue\":-23.45,\"Nan\":-23x.45,\n"+
|
||||
"\"ArrayOfNum\":\"1, 2, 3, 4.1, 5.2\"\n"+
|
||||
"},\"xsi:noNamespaceSchemaLocation\":"+
|
||||
"\"test.xsd\",\"xmlns:xsi\":\"http://www.w3.org/2001/"+
|
||||
@@ -1182,7 +1180,7 @@ public class XMLTest {
|
||||
|
||||
@Test
|
||||
public void shouldCreateExplicitEndTagWithEmptyValueWhenConfigured(){
|
||||
String jsonString = "{\"outer\":{\"innerOne\":\"\", \"innerTwo\":\"two\"}}";
|
||||
String jsonString = "{outer:{innerOne:\"\", innerTwo:\"two\"}}";
|
||||
JSONObject jsonObject = new JSONObject(jsonString);
|
||||
String expectedXmlString = "<encloser><outer><innerOne></innerOne><innerTwo>two</innerTwo></outer></encloser>";
|
||||
String xmlForm = XML.toString(jsonObject,"encloser", new XMLParserConfiguration().withCloseEmptyTag(true));
|
||||
@@ -1193,7 +1191,7 @@ public class XMLTest {
|
||||
|
||||
@Test
|
||||
public void shouldNotCreateExplicitEndTagWithEmptyValueWhenNotConfigured(){
|
||||
String jsonString = "{\"outer\":{\"innerOne\":\"\", \"innerTwo\":\"two\"}}";
|
||||
String jsonString = "{outer:{innerOne:\"\", innerTwo:\"two\"}}";
|
||||
JSONObject jsonObject = new JSONObject(jsonString);
|
||||
String expectedXmlString = "<encloser><outer><innerOne/><innerTwo>two</innerTwo></outer></encloser>";
|
||||
String xmlForm = XML.toString(jsonObject,"encloser", new XMLParserConfiguration().withCloseEmptyTag(false));
|
||||
|
||||
Reference in New Issue
Block a user