Class JUnit4StackTraceWriter
- java.lang.Object
-
- org.apache.maven.surefire.common.junit4.JUnit4StackTraceWriter
-
- All Implemented Interfaces:
StackTraceWriter
public class JUnit4StackTraceWriter extends java.lang.Object implements StackTraceWriter
Writes out a specificFailure
for surefire as a stacktrace.
-
-
Field Summary
Fields Modifier and Type Field Description private org.junit.runner.notification.Failure
junitFailure
-
Constructor Summary
Constructors Constructor Description JUnit4StackTraceWriter(org.junit.runner.notification.Failure junitFailure)
Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description SafeThrowable
getThrowable()
Returns the exception associated with this failure.private static boolean
isMultiLineExceptionMessage(java.lang.Throwable t)
java.lang.String
smartTrimmedStackTrace()
Get the "smart" trimmed (1-2 lines) stacktrace.java.lang.String
writeTraceToString()
Write the throwable to a string, without trimming.java.lang.String
writeTrimmedTraceToString()
At the moment, returns the same aswriteTraceToString()
.
-
-
-
Method Detail
-
writeTraceToString
public java.lang.String writeTraceToString()
Description copied from interface:StackTraceWriter
Write the throwable to a string, without trimming.- Specified by:
writeTraceToString
in interfaceStackTraceWriter
- Returns:
- the trace
-
smartTrimmedStackTrace
public java.lang.String smartTrimmedStackTrace()
Description copied from interface:StackTraceWriter
Get the "smart" trimmed (1-2 lines) stacktrace.- Specified by:
smartTrimmedStackTrace
in interfaceStackTraceWriter
- Returns:
- the trace
-
writeTrimmedTraceToString
public java.lang.String writeTrimmedTraceToString()
At the moment, returns the same aswriteTraceToString()
.- Specified by:
writeTrimmedTraceToString
in interfaceStackTraceWriter
- Returns:
- the trace
- See Also:
StackTraceWriter.writeTrimmedTraceToString()
-
getThrowable
public SafeThrowable getThrowable()
Returns the exception associated with this failure.- Specified by:
getThrowable
in interfaceStackTraceWriter
- Returns:
- the throwable
- See Also:
StackTraceWriter.getThrowable()
-
isMultiLineExceptionMessage
private static boolean isMultiLineExceptionMessage(java.lang.Throwable t)
-
-