|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | POINTCUT | FIELD | CONSTRUCTOR | METHOD | DETAIL: FIELD | POINTCUT | CONSTRUCTOR | METHOD |
java.lang.Object | +--java.lang.Throwable | +--org.apache.cactus.client.ServletExceptionWrapper
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 Summary | |
ServletExceptionWrapper(String theMessage)
Standard throwable constructor. |
|
ServletExceptionWrapper()
Standard throwable constructor. |
|
ServletExceptionWrapper(String theMessage,
String theClassName,
String theStackTrace)
The constructor to use to simulate a real exception. |
Method Summary | |
boolean |
instanceOf(Class theClass)
As all the server exceptions are wrapped into this ServletExceptionWrapper class, we need to be able to
know the original server exception class.
Affected by: LogAspect |
void |
printStackTrace(PrintStream thePs)
Simulates a printing of a stack trace by printing the string stack trace Affected by: LogAspect |
void |
printStackTrace(PrintWriter thePw)
Simulates a printing of a stack trace by printing the string stack trace Affected by: LogAspect |
Methods inherited from class java.lang.Throwable |
fillInStackTrace, getLocalizedMessage, getMessage, printStackTrace, toString |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public ServletExceptionWrapper(String theMessage)
theMessage
- the exception message
public ServletExceptionWrapper()
public ServletExceptionWrapper(String theMessage, String theClassName, String theStackTrace)
theMessage
- the server exception message
theClassName
- the server exception class name
theStackTrace
- the server exception stack trace
Method Detail |
public boolean instanceOf(Class theClass)
ServletExceptionWrapper
class, we need to be able to
know the original server exception class.
theClass
- the class to compare with the server exception class
ServletExceptionWrapper
(this class)
around() in LogAspect
.public void printStackTrace(PrintStream thePs)
thePs
- the stream to which to output the stack trace
around() in LogAspect
.public void printStackTrace(PrintWriter thePw)
thePw
- the writer to which to output the stack trace
around() in LogAspect
.
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTRUCTOR | METHOD | DETAIL: FIELD | CONSTRUCTOR | METHOD |