-
Notifications
You must be signed in to change notification settings - Fork 109
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #205 from jamezp/LOGMGR-210
[LOGMGR-210] Use the StackTraceFormatter to format exceptions in structured formatters.
- Loading branch information
Showing
2 changed files
with
10 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,13 +23,16 @@ | |
import java.io.StringWriter; | ||
|
||
import org.junit.Assert; | ||
import org.junit.Assume; | ||
import org.junit.Test; | ||
|
||
/** | ||
* @author <a href="mailto:[email protected]">James R. Perkins</a> | ||
*/ | ||
public class StackTraceFormatterTests { | ||
|
||
private static final boolean IS_IBM_JDK = System.getProperty("java.vendor").startsWith("IBM"); | ||
|
||
@Test | ||
public void compareSimpleStackTrace() { | ||
final RuntimeException e = new RuntimeException(); | ||
|
@@ -57,6 +60,7 @@ public void compareCauseStackTrace() { | |
|
||
@Test | ||
public void compareSuppressedAndCauseStackTrace() { | ||
Assume.assumeFalse("The IBM JDK does not show print circular references.", IS_IBM_JDK); | ||
final RuntimeException r1 = new RuntimeException("Exception 1"); | ||
final RuntimeException r2 = new RuntimeException("Exception 2", r1); | ||
final RuntimeException r3 = new RuntimeException("Exception 3", r2); | ||
|
@@ -76,6 +80,7 @@ public void compareSuppressedAndCauseStackTrace() { | |
|
||
@Test | ||
public void compareNestedSuppressedStackTrace() { | ||
Assume.assumeFalse("The IBM JDK does not show print circular references.", IS_IBM_JDK); | ||
final RuntimeException r1 = new RuntimeException("Exception 1"); | ||
final RuntimeException r2 = new RuntimeException("Exception 2", r1); | ||
final RuntimeException r3 = new RuntimeException("Exception 3", r2); | ||
|
@@ -99,6 +104,7 @@ public void compareNestedSuppressedStackTrace() { | |
|
||
@Test | ||
public void compareMultiNestedSuppressedStackTrace() { | ||
Assume.assumeFalse("The IBM JDK does not show print circular references.", IS_IBM_JDK); | ||
final Throwable cause = createMultiNestedCause(); | ||
|
||
final StringWriter writer = new StringWriter(); | ||
|
@@ -112,6 +118,7 @@ public void compareMultiNestedSuppressedStackTrace() { | |
|
||
@Test | ||
public void compareMultiNestedSuppressedAndNestedCauseStackTrace() { | ||
Assume.assumeFalse("The IBM JDK does not show print circular references.", IS_IBM_JDK); | ||
final Throwable rootCause = createMultiNestedCause(); | ||
final RuntimeException cause = new RuntimeException("This is the parent", rootCause); | ||
|
||
|