org.apache.cactus.util
Class ChainedRuntimeException

java.lang.Object
  extended byjava.lang.Throwable
      extended byjava.lang.Exception
          extended byjava.lang.RuntimeException
              extended byorg.apache.cactus.util.ChainedRuntimeException
All Implemented Interfaces:
java.io.Serializable

public class ChainedRuntimeException
extends java.lang.RuntimeException

Represent an exception that should stop the running test. It is a runtime exception but it will be caught by JUnit so the application will not stop. The test will be reported as failed. It implements chaining.

Version:
$Id: ChainedRuntimeException.java,v 1.5 2003/05/26 11:45:22 cmlenz Exp $
Author:
Vincent Massol
See Also:
Serialized Form

Field Summary
protected  java.lang.Throwable originalException
          Original exception which caused this exception.
 
Constructor Summary
ChainedRuntimeException(java.lang.String theMessage)
          Create a ChainedRuntimeException and set the exception error message.
ChainedRuntimeException(java.lang.String theMessage, java.lang.Throwable theException)
          Create a ChainedRuntimeException, set the exception error message along with the exception object that caused this exception.
ChainedRuntimeException(java.lang.Throwable theException)
          Create a ChainedRuntimeException, and set exception object that caused this exception.
 
Method Summary
 void printStackTrace()
          Print the full stack trace, including the original exception.
 void printStackTrace(java.io.PrintStream thePs)
          Print the full stack trace, including the original exception.
 void printStackTrace(java.io.PrintWriter thePw)
          Print the full stack trace, including the original exception.
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, setStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

originalException

protected java.lang.Throwable originalException
Original exception which caused this exception.

Constructor Detail

ChainedRuntimeException

public ChainedRuntimeException(java.lang.String theMessage)
Create a ChainedRuntimeException and set the exception error message.

Parameters:
theMessage - the message of the exception

ChainedRuntimeException

public ChainedRuntimeException(java.lang.String theMessage,
                               java.lang.Throwable theException)
Create a ChainedRuntimeException, set the exception error message along with the exception object that caused this exception.

Parameters:
theMessage - the detail of the error message
theException - the original exception

ChainedRuntimeException

public ChainedRuntimeException(java.lang.Throwable theException)
Create a ChainedRuntimeException, and set exception object that caused this exception. The message is set by default to be the one from the original exception.

Parameters:
theException - the original exception
Method Detail

printStackTrace

public void printStackTrace()
Print the full stack trace, including the original exception.


printStackTrace

public void printStackTrace(java.io.PrintStream thePs)
Print the full stack trace, including the original exception.

Parameters:
thePs - the byte stream in which to print the stack trace

printStackTrace

public void printStackTrace(java.io.PrintWriter thePw)
Print the full stack trace, including the original exception.

Parameters:
thePw - the character stream in which to print the stack trace


Copyright © 2000-2003 Apache Software Foundation. All Rights Reserved.