Skip to content

Commit

Permalink
fix CI build error
Browse files Browse the repository at this point in the history
  • Loading branch information
stleary committed Jul 24, 2020
1 parent 7852810 commit 98cd8ef
Showing 1 changed file with 15 additions and 7 deletions.
22 changes: 15 additions & 7 deletions src/test/java/org/json/junit/XMLTest.java
Expand Up @@ -934,16 +934,24 @@ public void testIssue537CaseSensitiveHexEscapeMinimal(){
@Test
public void testIssue537CaseSensitiveHexEscapeFullFile(){
try {
try(
InputStream xmlStream = XMLTest.class.getClassLoader().getResourceAsStream("Issue537.xml");
Reader xmlReader = new InputStreamReader(xmlStream);
){
InputStream xmlStream = null;
try {
xmlStream = XMLTest.class.getClassLoader().getResourceAsStream("Issue537.xml");
Reader xmlReader = new InputStreamReader(xmlStream);
JSONObject actual = XML.toJSONObject(xmlReader, true);
try(
InputStream jsonStream = XMLTest.class.getClassLoader().getResourceAsStream("Issue537.json");
){
InputStream jsonStream = null;
try {
jsonStream = XMLTest.class.getClassLoader().getResourceAsStream("Issue537.json");
final JSONObject expected = new JSONObject(new JSONTokener(jsonStream));
Util.compareActualVsExpectedJsonObjects(actual,expected);
} finally {
if (jsonStream != null) {
jsonStream.close();
}
}
} finally {
if (xmlStream != null) {
xmlStream.close();
}
}
} catch (IOException e) {
Expand Down

0 comments on commit 98cd8ef

Please sign in to comment.