Package generic.test

Class TestReportingException

  • All Implemented Interfaces:
    java.io.Serializable

    public class TestReportingException
    extends java.lang.RuntimeException
    A RuntimeException that 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 Detail

      • fromSwingThread

        public static TestReportingException fromSwingThread​(java.lang.String message,
                                                             java.lang.Throwable t)
        Creates a new TestReportingException using an exception that was generated on the Swing thread.
        Parameters:
        message - an optional custom message that will be printed first in the stack trace
        t - 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:
        printStackTrace in class java.lang.Throwable
      • printStackTrace

        public void printStackTrace​(java.io.PrintWriter s)
        Overrides:
        printStackTrace in class java.lang.Throwable
      • getStackTrace

        public java.lang.StackTraceElement[] getStackTrace()
        Overrides:
        getStackTrace in class java.lang.Throwable
      • getMessage

        public java.lang.String getMessage()
        Overrides:
        getMessage in class java.lang.Throwable