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 | Field and Description |
|---|---|
| private static final String | |
| private static final Predicate |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static List | Returns: an immutable list of all throwables found, including the supplied one; nevernullthe rootThrowable)Throwable to explore; never nullFind all causes and suppressed exceptions in the stack trace of the
supplied |
| public static void | pruneStackTrace(Throwable
the throwable, List<String> Throwable whose stack trace should be pruned;
never nullthe class names that should stop the pruning if encountered;
never classNames)nullPrune the stack trace of the supplied |
| public static String | |
| private static <T extends Throwable> T | |
| public static RuntimeException | Returns: this method always throws an exception and therefore never returns anything; the return type is merely present to allow this method to be supplied as the operand in athrow statementthe t)Throwable to throw as an unchecked exception;
never nullThrow the supplied |
| JUNIT_PLATFORM_LAUNCHER_PACKAGE_PREFIX | back to summary |
|---|---|
| private static final String JUNIT_PLATFORM_LAUNCHER_PACKAGE_PREFIX | |
| STACK_TRACE_ELEMENT_FILTER | back to summary |
|---|---|
| private static final Predicate<String> STACK_TRACE_ELEMENT_FILTER | |
| ExceptionUtils | back to summary |
|---|---|
| private ExceptionUtils() | |
| findNestedThrowables | back to summary |
|---|---|
| public static List Find all causes and suppressed exceptions in the stack trace of the
supplied | |
| pruneStackTrace | back to summary |
|---|---|
| public static void pruneStackTrace(Throwable throwable, List<String> classNames) Prune the stack trace of the supplied Prune all stack trace elements up one
of the supplied If the Additionally, all elements prior to and including the first JUnit Platform Launcher call will be removed. | |
| readStackTrace | back to summary |
|---|---|
| public static String readStackTrace(Throwable throwable) Read the stacktrace of the supplied | |
| throwAs | back to summary |
|---|---|
private static <T extends Throwable> T throwAs(Throwable t) throws Throwable-:T
| |
| throwAsUncheckedException | back to summary |
|---|---|
| public static RuntimeException throwAsUncheckedException(Throwable t) Throw the supplied The supplied WarningThis method should be used sparingly.
| |