commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1573188 - /commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/StringEscapeUtilsTest.java
Date Sat, 01 Mar 2014 16:11:02 GMT
Author: sebb
Date: Sat Mar  1 16:11:01 2014
New Revision: 1573188

URL: http://svn.apache.org/r1573188
Log:
Close resource

Modified:
    commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/StringEscapeUtilsTest.java

Modified: commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/StringEscapeUtilsTest.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/StringEscapeUtilsTest.java?rev=1573188&r1=1573187&r2=1573188&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/StringEscapeUtilsTest.java
(original)
+++ commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/StringEscapeUtilsTest.java
Sat Mar  1 16:11:01 2014
@@ -557,12 +557,14 @@ public class StringEscapeUtilsTest {
      */
     @Test
     public void testLang708() throws IOException {
-        final String input = IOUtils.toString(new FileInputStream("src/test/resources/lang-708-input.txt"),
"UTF-8");
+        final FileInputStream fis = new FileInputStream("src/test/resources/lang-708-input.txt");
+        final String input = IOUtils.toString(fis, "UTF-8");
         final String escaped = StringEscapeUtils.escapeEcmaScript(input);
         // just the end:
         assertTrue(escaped, escaped.endsWith("}]"));
         // a little more:
         assertTrue(escaped, escaped.endsWith("\"valueCode\\\":\\\"\\\"}]"));
+        fis.close();
     }
 
     /**



Mime
View raw message