Skip to content

Commit 4b0db65

Browse files
author
John J. Aylward
committed
Fixes NPE in XML
1 parent 1a5718d commit 4b0db65

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

XMLTest.java

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
11
package org.json.junit;
22

3-
import static org.junit.Assert.*;
3+
import static org.junit.Assert.assertEquals;
4+
import static org.junit.Assert.assertTrue;
45

5-
import java.io.*;
6+
import java.io.IOException;
67

7-
import org.json.*;
8-
import org.junit.*;
9-
import org.junit.rules.*;
8+
import org.json.JSONArray;
9+
import org.json.JSONException;
10+
import org.json.JSONObject;
11+
import org.json.XML;
12+
import org.junit.Rule;
13+
import org.junit.Test;
14+
import org.junit.rules.TemporaryFolder;
1015

1116

1217
/**
@@ -180,9 +185,8 @@ public void shouldHandleInvalidCDATABangInTag() {
180185

181186
/**
182187
* Null JSONObject in XML.toString()
183-
* Expects NullPointerException
184188
*/
185-
@Test(expected=NullPointerException.class)
189+
@Test
186190
public void shouldHandleNullJSONXML() {
187191
JSONObject jsonObject= null;
188192
XML.toString(jsonObject);

0 commit comments

Comments
 (0)