These utilities are intended solely for usage within the JUnit framework itself. Any usage by external parties is not supported. Use at your own risk!
|Modifier and Type||Method and Description|
Reads the stacktrace of the supplied
Throw the supplied
public static java.lang.RuntimeException throwAsUncheckedException(java.lang.Throwable t)
Throwable, masked as an unchecked exception.
Throwable will not be wrapped. Rather, it
will be thrown as is using an exploit of the Java language
that relies on a combination of generics and type erasure to trick
the Java compiler into believing that the thrown exception is an
unchecked exception even if it is a checked exception.
This method should be used sparingly.
Throwableto throw as an unchecked exception; never
public static java.lang.String readStackTrace(java.lang.Throwable throwable)
Throwableinto a String.