Throwables.
| Modifier and Type | Field and Description |
|---|---|
| private static final Function | |
| private static final String | |
| private static final String | |
| private static final String |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| private static <T extends Throwable> T | |
| public static <T extends Throwable> List | |
| public static void | appendStackTraceInCurrentThreadToThrowable(Throwable
the given t, String Throwable.the name of the method used as the starting point of the current thread's stack trace. methodToStartFrom)Appends the stack trace of the current thread to the one in the given |
| private static <T extends Throwable> T | buildAssertionErrorWithLineNumbersButNoActualOrExpectedValues(T error, StackTraceElement testStackTraceElement)
|
| private static String | buildErrorMessageWithLineNumber(String originalErrorMessage, StackTraceElement testStackTraceElement)
|
| private static <T extends Throwable> T | buildOpentest4jAssertionFailedErrorWithLineNumbers(T error, StackTraceElement testStackTraceElement)
|
| private static <T extends Throwable> T | |
| public static List | |
| public static StackTraceElement | |
| public static Throwable | Returns: the root cause if any, elsenull.the throwable)Throwable to get root cause from.Get the root cause (i.e., the last non-null cause) from a |
| public static String | Returns: the stack trace as aString.the throwable)Throwable to get stack trace from. |
| private static boolean | |
| private static boolean | |
| private static boolean | |
| private static <T extends Throwable> boolean | |
| private static boolean | |
| public static void | removeAssertJRelatedElementsFromStackTrace(Throwable
the throwable)Throwable to filter stack trace.Removes the AssertJ-related elements from the |
| private static String | |
| private static List | |
| private static List |
| ERROR_DESCRIPTION_EXTRACTOR | back to summary |
|---|---|
| private static final Function<Throwable, String> ERROR_DESCRIPTION_EXTRACTOR | |
| JAVA_BASE | back to summary |
|---|---|
| private static final String JAVA_BASE | |
| JDK_BASE | back to summary |
|---|---|
| private static final String JDK_BASE | |
| ORG_ASSERTJ | back to summary |
|---|---|
| private static final String ORG_ASSERTJ | |
| Throwables | back to summary |
|---|---|
| private Throwables() | |
| addLineNumberToErrorMessage | back to summary |
|---|---|
| private static <T extends Throwable> T addLineNumberToErrorMessage(T error) | |
| addLineNumberToErrorMessages | back to summary |
|---|---|
| public static <T extends Throwable> List | |
| appendStackTraceInCurrentThreadToThrowable | back to summary |
|---|---|
| public static void appendStackTraceInCurrentThreadToThrowable(Throwable t, String methodToStartFrom) Appends the stack trace of the current thread to the one in the given | |
| buildAssertionErrorWithLineNumbersButNoActualOrExpectedValues | back to summary |
|---|---|
| private static <T extends Throwable> T buildAssertionErrorWithLineNumbersButNoActualOrExpectedValues(T error, StackTraceElement testStackTraceElement) throws ReflectiveOperationException | |
| buildErrorMessageWithLineNumber | back to summary |
|---|---|
| private static String buildErrorMessageWithLineNumber(String originalErrorMessage, StackTraceElement testStackTraceElement) | |
| buildOpentest4jAssertionFailedErrorWithLineNumbers | back to summary |
|---|---|
| private static <T extends Throwable> T buildOpentest4jAssertionFailedErrorWithLineNumbers(T error, StackTraceElement testStackTraceElement) throws ReflectiveOperationException | |
| createNewInstanceWithLineNumberInErrorMessage | back to summary |
|---|---|
| private static <T extends Throwable> T createNewInstanceWithLineNumberInErrorMessage(T error, StackTraceElement testStackTraceElement) throws ReflectiveOperationException | |
| describeErrors | back to summary |
|---|---|
| public static List | |
| getFirstStackTraceElementFromTest | back to summary |
|---|---|
| public static StackTraceElement getFirstStackTraceElementFromTest(StackTraceElement[] stacktrace) | |
| getRootCause | back to summary |
|---|---|
| public static Throwable getRootCause(Throwable throwable) Get the root cause (i.e., the last non-null cause) from a | |
| getStackTrace | back to summary |
|---|---|
| public static String getStackTrace(Throwable throwable) Get the stack trace from a
The result of this method vary by JDK version as this method uses
| |
| isFromAssertJ | back to summary |
|---|---|
| private static boolean isFromAssertJ(StackTraceElement stackTrace) | |
| isFromJavaOrJdkPackages | back to summary |
|---|---|
| private static boolean isFromJavaOrJdkPackages(StackTraceElement stackTrace) | |
| isInstanceOf | back to summary |
|---|---|
| private static boolean isInstanceOf(Object object, String className) | |
| isOpentest4jAssertionFailedError | back to summary |
|---|---|
| private static <T extends Throwable> boolean isOpentest4jAssertionFailedError(T error) | |
| isProxiedAssertionClass | back to summary |
|---|---|
| private static boolean isProxiedAssertionClass(String className) | |
| removeAssertJRelatedElementsFromStackTrace | back to summary |
|---|---|
| public static void removeAssertJRelatedElementsFromStackTrace(Throwable throwable) Removes the AssertJ-related elements from the Therefore, instead of seeing this:
We get this:
| |
| simpleClassNameOf | back to summary |
|---|---|
| private static String simpleClassNameOf(StackTraceElement testStackTraceElement) | |
| stackTraceInCurrentThread | back to summary |
|---|---|
| private static List | |
| stackTraceInCurrentThread | back to summary |
|---|---|
| private static List | |