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:
parent
1a5718dc39
commit
4b0db65877
1 changed files with 11 additions and 7 deletions
18
XMLTest.java
18
XMLTest.java
|
@ -1,12 +1,17 @@
|
|||
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.junit.*;
|
||||
import org.junit.rules.*;
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONException;
|
||||
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()
|
||||
* Expects NullPointerException
|
||||
*/
|
||||
@Test(expected=NullPointerException.class)
|
||||
@Test
|
||||
public void shouldHandleNullJSONXML() {
|
||||
JSONObject jsonObject= null;
|
||||
XML.toString(jsonObject);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue