Package generic.test
Class TestReportingException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.lang.RuntimeException
-
- generic.test.TestReportingException
-
- All Implemented Interfaces:
java.io.Serializable
public class TestReportingException extends java.lang.RuntimeExceptionARuntimeExceptionthat will print a custom stack trace.This class will print not only the trace info for the exception passed at construction time, but will also print a trace for the test thread at the time of the exception. Also, the trace information printed will be filtered of entries that are not useful for debugging, like Java class entries.
- See Also:
- Serialized Form
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static TestReportingExceptionfromSwingThread(java.lang.String message, java.lang.Throwable t)Creates a newTestReportingExceptionusing an exception that was generated on the Swing thread.java.lang.StringgetMessage()java.lang.StackTraceElement[]getStackTrace()static java.lang.StringgetSwingThreadTraceString(java.lang.Throwable throwable)voidprintStackTrace(java.io.PrintStream s)voidprintStackTrace(java.io.PrintWriter s)
-
-
-
Method Detail
-
fromSwingThread
public static TestReportingException fromSwingThread(java.lang.String message, java.lang.Throwable t)
Creates a newTestReportingExceptionusing an exception that was generated on the Swing thread.- Parameters:
message- an optional custom message that will be printed first in the stack tracet- the original exception- Returns:
- the new
TestReportingException
-
getSwingThreadTraceString
public static java.lang.String getSwingThreadTraceString(java.lang.Throwable throwable)
-
printStackTrace
public void printStackTrace(java.io.PrintStream s)
- Overrides:
printStackTracein classjava.lang.Throwable
-
printStackTrace
public void printStackTrace(java.io.PrintWriter s)
- Overrides:
printStackTracein classjava.lang.Throwable
-
getStackTrace
public java.lang.StackTraceElement[] getStackTrace()
- Overrides:
getStackTracein classjava.lang.Throwable
-
getMessage
public java.lang.String getMessage()
- Overrides:
getMessagein classjava.lang.Throwable
-
-