Save This Page
Home » cactus-1.8.0-src » org.apache.cactus.internal.client » [javadoc | source]
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.
Constructor:
 public ServletExceptionWrapper() 
 public ServletExceptionWrapper(String theMessage) 
    Standard throwable constructor.
    Parameters:
    theMessage - the exception message
 public ServletExceptionWrapper(String theMessage,
    String theClassName,
    String theStackTrace) 
    The constructor to use to simulate a real exception.
    Parameters:
    theMessage - the server exception message
    theClassName - the server exception class name
    theStackTrace - the server exception stack trace
Method from org.apache.cactus.internal.client.ServletExceptionWrapper Summary:
getWrappedClassName,   printStackTrace,   printStackTrace
Methods from java.lang.Throwable:
fillInStackTrace,   getCause,   getLocalizedMessage,   getMessage,   getStackTrace,   initCause,   printStackTrace,   printStackTrace,   printStackTrace,   setStackTrace,   toString
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.cactus.internal.client.ServletExceptionWrapper Detail:
 public String getWrappedClassName() 
 public  void printStackTrace(PrintStream thePs) 
    Simulates a printing of a stack trace by printing the string stack trace.
 public  void printStackTrace(PrintWriter thePw) 
    Simulates a printing of a stack trace by printing the string stack trace.