remove commons-io test dependency which was used only in one test

Project: http://git-wip-us.apache.org/repos/asf/commons-text/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-text/commit/98d62f36
Tree: http://git-wip-us.apache.org/repos/asf/commons-text/tree/98d62f36
Diff: http://git-wip-us.apache.org/repos/asf/commons-text/diff/98d62f36

Branch: refs/heads/master
Commit: 98d62f36fc3dfba2693ddf5c301de15fe40320ee
Parents: a659f62
Author: Pascal Schumacher <pascalschumac...@gmx.net>
Authored: Sun Dec 18 17:36:18 2016 +0100
Committer: Pascal Schumacher <pascalschumac...@gmx.net>
Committed: Sun Dec 18 17:36:18 2016 +0100

----------------------------------------------------------------------
 pom.xml                                                   |  6 ------
 .../org/apache/commons/text/StringEscapeUtilsTest.java    | 10 +++++-----
 2 files changed, 5 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-text/blob/98d62f36/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 366f424..72621f1 100644
--- a/pom.xml
+++ b/pom.xml
@@ -97,12 +97,6 @@
       <version>1.3</version>
       <scope>test</scope>
     </dependency>
-    <dependency>
-      <groupId>commons-io</groupId>
-      <artifactId>commons-io</artifactId>
-      <version>2.5</version>
-      <scope>test</scope>
-    </dependency>
   </dependencies>
 
   <distributionManagement>

http://git-wip-us.apache.org/repos/asf/commons-text/blob/98d62f36/src/test/java/org/apache/commons/text/StringEscapeUtilsTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/text/StringEscapeUtilsTest.java 
b/src/test/java/org/apache/commons/text/StringEscapeUtilsTest.java
index e732b6c..c0f7d05 100644
--- a/src/test/java/org/apache/commons/text/StringEscapeUtilsTest.java
+++ b/src/test/java/org/apache/commons/text/StringEscapeUtilsTest.java
@@ -25,14 +25,15 @@ import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
 
-import java.io.FileInputStream;
 import java.io.IOException;
 import java.io.StringWriter;
 import java.lang.reflect.Constructor;
 import java.lang.reflect.Modifier;
 import java.nio.charset.Charset;
+import java.nio.charset.StandardCharsets;
+import java.nio.file.Files;
+import java.nio.file.Paths;
 
-import org.apache.commons.io.IOUtils;
 import org.junit.Test;
 
 /**
@@ -478,14 +479,13 @@ public class StringEscapeUtilsTest {
      */
     @Test
     public void testLang708() throws IOException {
-        final FileInputStream fis = new 
FileInputStream("src/test/resources/stringEscapeUtilsTestData.txt");
-        final String input = IOUtils.toString(fis, "UTF-8");
+        byte[] inputBytes = 
Files.readAllBytes(Paths.get("src/test/resources/stringEscapeUtilsTestData.txt"));
+        final String input = new String(inputBytes, StandardCharsets.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();
     }
 
     /**

Reply via email to