| Modifier and Type | Field and Description |
|---|---|
| private String |
| Access | Constructor and Description |
|---|---|
| public | AssertFailure(String
the message associated with
the error. message, Throwable errors can be nested together;
if this error has another error associated with it,
it is specified here. The 'outermost' error should be
the most severe error; inner errors should be providing
additional information about what went wrong. nestedError)This constructor takes the pieces of information expected for each error. |
| public | AssertFailure(String
the message associated with the error. message)This constructor takes the just the message for this error. |
| public |
| Modifier and Type | Method and Description |
|---|---|
| private String | Returns: stack traces for all live threads as a string or an error message.Dumps stack traces for all the threads if the JVM supports it. |
| public String | Returns: - thread dump string.Returns the thread dump stored in this AssertFailure as a string. |
| public void | printStackTrace()
Overrides java. |
| public void | printStackTrace(PrintStream
PrintStream to use for outputOverrides java. |
| public void | printStackTrace(PrintWriter
PrintWriter to use for outputOverrides java. |
| private boolean |
| threadDump | back to summary |
|---|---|
| private String threadDump | |
| AssertFailure | back to summary |
|---|---|
| public AssertFailure(String message, Throwable nestedError) This constructor takes the pieces of information expected for each error.
| |
| AssertFailure | back to summary |
|---|---|
| public AssertFailure(String message) This constructor takes the just the message for this error.
| |
| AssertFailure | back to summary |
|---|---|
| public AssertFailure() This constructor expects no arguments or nested error. | |
| dumpThreads | back to summary |
|---|---|
| private String dumpThreads() Dumps stack traces for all the threads if the JVM supports it. The result is returned as a string, ready to print. If the JVM doesn't have the method Thread.getAllStackTraces i.e, we are on a JVM < 1.5, or if we don't have the permissions: java.lang.RuntimePermission "getStackTrace" and "modifyThreadGroup", a message saying so is returned instead.
| |
| getThreadDump | back to summary |
|---|---|
| public String getThreadDump() Returns the thread dump stored in this AssertFailure as a string.
| |
| printStackTrace | back to summary |
|---|---|
| public void printStackTrace() Overrides java. Overrides printStackTrace() in java.lang.Throwable to include the thread dump after the normal stack trace. | |
| printStackTrace | back to summary |
|---|---|
| public void printStackTrace(PrintStream s) Overrides java. Overrides printStackTrace(PrintStream s) in java.lang.Throwable to include the thread dump after the normal stack trace.
| |
| printStackTrace | back to summary |
|---|---|
| public void printStackTrace(PrintWriter s) Overrides java. Overrides printStackTrace(PrintWriter s) in java.lang.Throwable to include the thread dump after the normal stack trace.
| |
| supportsThreadDump | back to summary |
|---|---|
| private boolean supportsThreadDump() Tells if generating a thread dump is supported in the running JVM. | |