it is not more verbose

Am 20.12.2016 um 15:15 schrieb Gary Gregory:
Why make the test code more verbose than it has to be?

Gary
---------- Forwarded message ----------
From: <[email protected]>
Date: Tue, Dec 20, 2016 at 1:01 AM
Subject: [lang] remove commons-io test dependency
To: [email protected]


Repository: commons-lang
Updated Branches:
   refs/heads/master c63653983 -> 7cf5e01c2


remove commons-io test dependency


Project: http://git-wip-us.apache.org/repos/asf/commons-lang/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-lang/commit/7cf5e01c
Tree: http://git-wip-us.apache.org/repos/asf/commons-lang/tree/7cf5e01c
Diff: http://git-wip-us.apache.org/repos/asf/commons-lang/diff/7cf5e01c

Branch: refs/heads/master
Commit: 7cf5e01c2a152a0b612cb19e02213879a57c14d2
Parents: c636539
Author: pascalschumacher <[email protected]>
Authored: Tue Dec 20 10:01:04 2016 +0100
Committer: pascalschumacher <[email protected]>
Committed: Tue Dec 20 10:01:04 2016 +0100

----------------------------------------------------------------------
  pom.xml                                                   |  7 -------
  .../org/apache/commons/lang3/StringEscapeUtilsTest.java   | 10 +++++-----
  2 files changed, 5 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-lang/blob/7cf5e01c/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 12354b0..0d06563 100644
--- a/pom.xml
+++ b/pom.xml
@@ -520,13 +520,6 @@
      </dependency>

      <dependency>
-      <groupId>commons-io</groupId>
-      <artifactId>commons-io</artifactId>
-      <version>2.5</version>
-      <scope>test</scope>
-    </dependency>
-
-    <dependency>
        <groupId>org.apache.bcel</groupId>
        <artifactId>bcel</artifactId>
        <version>6.0</version>

http://git-wip-us.apache.org/repos/asf/commons-lang/blob/
7cf5e01c/src/test/java/org/apache/commons/lang3/StringEscapeUtilsTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/lang3/StringEscapeUtilsTest.java
b/src/test/java/org/apache/commons/lang3/StringEscapeUtilsTest.java
index 28be437..815dc96 100644
--- a/src/test/java/org/apache/commons/lang3/StringEscapeUtilsTest.java
+++ b/src/test/java/org/apache/commons/lang3/StringEscapeUtilsTest.java
@@ -22,14 +22,15 @@ import static org.junit.Assert.assertNotNull;
  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.apache.commons.lang3.text.translate.CharSequenceTranslator;
  import org.apache.commons.lang3.text.translate.NumericEntityEscaper;
  import org.junit.Test;
@@ -555,14 +556,13 @@ public class StringEscapeUtilsTest {
       */
      @Test
      public void testLang708() throws IOException {
-        final FileInputStream fis = new FileInputStream("src/test/
resources/lang-708-input.txt");
-        final String input = IOUtils.toString(fis, "UTF-8");
+        final byte[] inputBytes = Files.readAllBytes(Paths.get("
src/test/resources/lang-708-input.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();
      }

      /**






---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to