fix CI build error

This commit is contained in:
stleary 2020-07-24 03:24:41 -05:00
parent 78528102d0
commit 98cd8ef8b2

View File

@ -934,16 +934,24 @@ public class XMLTest {
@Test @Test
public void testIssue537CaseSensitiveHexEscapeFullFile(){ public void testIssue537CaseSensitiveHexEscapeFullFile(){
try { try {
try( InputStream xmlStream = null;
InputStream xmlStream = XMLTest.class.getClassLoader().getResourceAsStream("Issue537.xml"); try {
Reader xmlReader = new InputStreamReader(xmlStream); xmlStream = XMLTest.class.getClassLoader().getResourceAsStream("Issue537.xml");
){ Reader xmlReader = new InputStreamReader(xmlStream);
JSONObject actual = XML.toJSONObject(xmlReader, true); JSONObject actual = XML.toJSONObject(xmlReader, true);
try( InputStream jsonStream = null;
InputStream jsonStream = XMLTest.class.getClassLoader().getResourceAsStream("Issue537.json"); try {
){ jsonStream = XMLTest.class.getClassLoader().getResourceAsStream("Issue537.json");
final JSONObject expected = new JSONObject(new JSONTokener(jsonStream)); final JSONObject expected = new JSONObject(new JSONTokener(jsonStream));
Util.compareActualVsExpectedJsonObjects(actual,expected); Util.compareActualVsExpectedJsonObjects(actual,expected);
} finally {
if (jsonStream != null) {
jsonStream.close();
}
}
} finally {
if (xmlStream != null) {
xmlStream.close();
} }
} }
} catch (IOException e) { } catch (IOException e) {