Close resource

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@1573188 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Sebastian Bazley 2014-03-01 16:11:01 +00:00
parent 2ea3865e0c
commit ddc06197e4
1 changed files with 3 additions and 1 deletions

View File

@ -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();
}
/**