You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by se...@apache.org on 2020/08/07 23:03:32 UTC

[commons-io] branch master updated: Quieten test and check it works

This is an automated email from the ASF dual-hosted git repository.

sebb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-io.git


The following commit(s) were added to refs/heads/master by this push:
     new 61031aa  Quieten test and check it works
61031aa is described below

commit 61031aa21cba8ae03e5192ad83a6ef5742177f7c
Author: Sebb <se...@apache.org>
AuthorDate: Sat Aug 8 00:03:23 2020 +0100

    Quieten test and check it works
---
 src/test/java/org/apache/commons/io/IOExceptionListTestCase.java | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/src/test/java/org/apache/commons/io/IOExceptionListTestCase.java b/src/test/java/org/apache/commons/io/IOExceptionListTestCase.java
index 1dc889e..b016c6e 100644
--- a/src/test/java/org/apache/commons/io/IOExceptionListTestCase.java
+++ b/src/test/java/org/apache/commons/io/IOExceptionListTestCase.java
@@ -22,6 +22,8 @@ import static org.junit.jupiter.api.Assertions.assertNull;
 import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import java.io.EOFException;
+import java.io.PrintWriter;
+import java.io.StringWriter;
 import java.util.Collections;
 import java.util.List;
 
@@ -56,6 +58,11 @@ public class IOExceptionListTestCase {
         final EOFException cause = new EOFException();
         final List<EOFException> list = Collections.singletonList(cause);
         final IOExceptionList sqlExceptionList = new IOExceptionList(list);
-        sqlExceptionList.printStackTrace();
+        StringWriter sw = new StringWriter();
+        PrintWriter pw = new PrintWriter(sw);
+        sqlExceptionList.printStackTrace(pw);
+        String st = sw.toString();
+        assertTrue(st.startsWith("org.apache.commons.io.IOExceptionList: 1 exceptions: [java.io.EOFException]"));
+        assertTrue(st.contains("Caused by: java.io.EOFException"));
     }
 }