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

Fixes NPE in XML

This commit is contained in:
John J. Aylward 2015-10-12 13:48:05 -04:00
parent 1a5718dc39
commit 4b0db65877

View file

@ -1,12 +1,17 @@
package org.json.junit; package org.json.junit;
import static org.junit.Assert.*; import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import java.io.*; import java.io.IOException;
import org.json.*; import org.json.JSONArray;
import org.junit.*; import org.json.JSONException;
import org.junit.rules.*; import org.json.JSONObject;
import org.json.XML;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TemporaryFolder;
/** /**
@ -180,9 +185,8 @@ public class XMLTest {
/** /**
* Null JSONObject in XML.toString() * Null JSONObject in XML.toString()
* Expects NullPointerException
*/ */
@Test(expected=NullPointerException.class) @Test
public void shouldHandleNullJSONXML() { public void shouldHandleNullJSONXML() {
JSONObject jsonObject= null; JSONObject jsonObject= null;
XML.toString(jsonObject); XML.toString(jsonObject);