You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by rg...@apache.org on 2015/12/06 23:50:19 UTC

logging-log4j2 git commit: Try to print the full stack trace and identify the failing file in the test

Repository: logging-log4j2
Updated Branches:
  refs/heads/master 0e21f2a56 -> 97f038bf3


Try to print the full stack trace and identify the failing file in the test


Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/97f038bf
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/97f038bf
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/97f038bf

Branch: refs/heads/master
Commit: 97f038bf34671269a803335d3dcdef0a3e80ff6e
Parents: 0e21f2a
Author: Ralph Goers <rg...@apache.org>
Authored: Sun Dec 6 15:50:07 2015 -0700
Committer: Ralph Goers <rg...@apache.org>
Committed: Sun Dec 6 15:50:07 2015 -0700

----------------------------------------------------------------------
 .../log4j/core/appender/rolling/RollingAppenderSizeTest.java | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/97f038bf/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/RollingAppenderSizeTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/RollingAppenderSizeTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/RollingAppenderSizeTest.java
index ce39d6d..4b0726c 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/RollingAppenderSizeTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/RollingAppenderSizeTest.java
@@ -23,6 +23,7 @@ import java.nio.charset.Charset;
 import java.util.Arrays;
 import java.util.Collection;
 
+import org.apache.commons.compress.compressors.CompressorException;
 import org.apache.commons.compress.compressors.CompressorInputStream;
 import org.apache.commons.compress.compressors.CompressorStreamFactory;
 import org.apache.commons.compress.utils.IOUtils;
@@ -107,7 +108,12 @@ public class RollingAppenderSizeTest {
             if (file.getName().endsWith(fileExtension)) {
                 CompressorInputStream in = null;
                 try (FileInputStream fis = new FileInputStream(file)) {
-                    in = new CompressorStreamFactory().createCompressorInputStream(ext.name().toLowerCase(), fis);
+                    try {
+                        in = new CompressorStreamFactory().createCompressorInputStream(ext.name().toLowerCase(), fis);
+                    } catch (CompressorException ce) {
+                        ce.printStackTrace();
+                        fail("Error creating intput stream from " + file.toString() + ": " + ce.getMessage());
+                    }
                     ByteArrayOutputStream baos = new ByteArrayOutputStream();
                     IOUtils.copy(in, baos);
                     String text = new String(baos.toByteArray(), Charset.defaultCharset());