You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by gg...@apache.org on 2015/06/29 21:40:30 UTC
logging-log4j2 git commit: [LOG4J2-684]
ExtendedThrowablePatternConverter does not print suppressed exceptions. Test
indentation.
Repository: logging-log4j2
Updated Branches:
refs/heads/master 825f15574 -> 565e9c22b
[LOG4J2-684] ExtendedThrowablePatternConverter does not print suppressed
exceptions. Test indentation.
Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/565e9c22
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/565e9c22
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/565e9c22
Branch: refs/heads/master
Commit: 565e9c22bed92184daa4021a6c4305f2751e51d0
Parents: 825f155
Author: ggregory <gg...@apache.org>
Authored: Mon Jun 29 12:40:28 2015 -0700
Committer: ggregory <gg...@apache.org>
Committed: Mon Jun 29 12:40:28 2015 -0700
----------------------------------------------------------------------
.../log4j/core/impl/ThrowableProxyTest.java | 40 ++++++++++----------
1 file changed, 20 insertions(+), 20 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/565e9c22/log4j-core/src/test/java/org/apache/logging/log4j/core/impl/ThrowableProxyTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/impl/ThrowableProxyTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/impl/ThrowableProxyTest.java
index c3128d4..ed5d3aa 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/impl/ThrowableProxyTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/impl/ThrowableProxyTest.java
@@ -242,28 +242,28 @@ public class ThrowableProxyTest {
}
@Test
- public void testSuppressedExceptions() {
- Exception e = new Exception();
- e.addSuppressed(new IOException("Suppressed #1"));
- e.addSuppressed(new IOException("Suppressed #2"));
- LogManager.getLogger().error("Error", e);
- final ThrowableProxy proxy = new ThrowableProxy(e);
- String extendedStackTraceAsString = proxy.getExtendedStackTraceAsString();
- assertTrue(extendedStackTraceAsString.contains("Suppressed #1"));
- assertTrue(extendedStackTraceAsString.contains("Suppressed #2"));
- }
+ public void testSuppressedExceptions() {
+ Exception e = new Exception("Root exception");
+ e.addSuppressed(new IOException("Suppressed #1"));
+ e.addSuppressed(new IOException("Suppressed #2"));
+ LogManager.getLogger().error("Error", e);
+ final ThrowableProxy proxy = new ThrowableProxy(e);
+ String extendedStackTraceAsString = proxy.getExtendedStackTraceAsString();
+ assertTrue(extendedStackTraceAsString.contains("\tSuppressed: java.io.IOException: Suppressed #1"));
+ assertTrue(extendedStackTraceAsString.contains("\tSuppressed: java.io.IOException: Suppressed #1"));
+ }
@Test
- public void testCauseSuppressedExceptions() {
- Exception cause = new Exception();
- cause.addSuppressed(new IOException("Suppressed #1"));
- cause.addSuppressed(new IOException("Suppressed #2"));
- LogManager.getLogger().error("Error", cause);
- final ThrowableProxy proxy = new ThrowableProxy(new Exception(cause));
- String extendedStackTraceAsString = proxy.getExtendedStackTraceAsString();
- assertTrue(extendedStackTraceAsString.contains("Suppressed #1"));
- assertTrue(extendedStackTraceAsString.contains("Suppressed #2"));
- }
+ public void testCauseSuppressedExceptions() {
+ Exception cause = new Exception("Nested exception");
+ cause.addSuppressed(new IOException("Suppressed #1"));
+ cause.addSuppressed(new IOException("Suppressed #2"));
+ LogManager.getLogger().error("Error", new Exception(cause));
+ final ThrowableProxy proxy = new ThrowableProxy(new Exception("Root exception", cause));
+ String extendedStackTraceAsString = proxy.getExtendedStackTraceAsString();
+ assertTrue(extendedStackTraceAsString.contains("\tSuppressed: java.io.IOException: Suppressed #1"));
+ assertTrue(extendedStackTraceAsString.contains("\tSuppressed: java.io.IOException: Suppressed #1"));
+ }
/**
* Tests LOG4J2-934.