org.apache.cactus.internal.client
public class: ServletExceptionWrapper [javadoc |
source]
java.lang.Object
java.lang.Throwable
org.apache.cactus.internal.client.ServletExceptionWrapper
All Implemented Interfaces:
Serializable
Wrapper around a
Throwable object. Whenever an exception occurs
in a test case executed on the server side, the text of this exception
along with the stack trace as a String are sent back in the HTTP response.
This is because some exceptions are not serializable and because the stack
trace is implemented as a
transient variable by the JDK so it
cannot be transported in the response. However, we need to send a real
exception object to JUnit so that the exception stack trace will be printed
in the JUnit console. This class does this by being a
Throwable
and overloading the
printStackTrace() methods to print a
text stack trace.
- version:
$ - Id: ServletExceptionWrapper.java 238991 2004-05-22 11:34:50Z vmassol $
| Methods from java.lang.Throwable: |
|---|
|
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString |
| Method from org.apache.cactus.internal.client.ServletExceptionWrapper Detail: |
public String getWrappedClassName() {
return this.className;
}
|
public void printStackTrace(PrintStream thePs) {
if (this.stackTrace == null)
{
thePs.print(getMessage());
}
else
{
thePs.print(this.stackTrace);
}
}
Simulates a printing of a stack trace by printing the string stack trace. |
public void printStackTrace(PrintWriter thePw) {
if (this.stackTrace == null)
{
thePw.print(getMessage());
}
else
{
thePw.print(this.stackTrace);
}
}
Simulates a printing of a stack trace by printing the string stack trace. |