JUnit-addons
version 1.4

junitx.framework
Class AssertionFailedError

java.lang.Object
  |
  +--java.lang.Throwable
        |
        +--java.lang.Error
              |
              +--junit.framework.AssertionFailedError
                    |
                    +--junitx.framework.AssertionFailedError
All Implemented Interfaces:
java.io.Serializable

public class AssertionFailedError
extends junit.framework.AssertionFailedError

Similar to the official class but supports chained exceptions.

Usage

To use this new class, you'll have to invoke the fail method of the junitx.framework.Assert class:
    junitx.framework.Assert.fail(exception);
 

Version:
$Revision: 1.1 $ $Date: 2003/03/21 06:13:48 $
Author:
Vladimir R. Bossicard
See Also:
Serialized Form

Constructor Summary
AssertionFailedError(java.lang.String message, java.lang.Throwable cause)
          Constructs a new throwable with the specified detail message and cause.
AssertionFailedError(java.lang.Throwable cause)
          Constructs a new throwable with the specified cause and a detail message of (cause==null ? null : cause.toString()) (which typically contains the class and detail message of cause).
 
Method Summary
 java.lang.Throwable getCause()
          Returns the cause of this throwable or null if the cause is nonexistent or unknown.
 void printStackTrace()
          Prints this throwable and its backtrace to the standard error stream.
 void printStackTrace(java.io.PrintStream s)
          Prints this throwable and its backtrace to the specified print stream.
 void printStackTrace(java.io.PrintWriter s)
          Prints this throwable and its backtrace to the specified print writer.
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getLocalizedMessage, getMessage, getStackTrace, initCause, setStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AssertionFailedError

public AssertionFailedError(java.lang.Throwable cause)
Constructs a new throwable with the specified cause and a detail message of (cause==null ? null : cause.toString()) (which typically contains the class and detail message of cause).

Parameters:
cause - the cause (which is saved for later retrieval by the getCause() method). (A null value is permitted, and indicates that the cause is nonexistent or unknown.)

AssertionFailedError

public AssertionFailedError(java.lang.String message,
                            java.lang.Throwable cause)
Constructs a new throwable with the specified detail message and cause. Note that the detail message associated with cause is not automatically incorporated in this throwable's detail message.

Parameters:
message - the detail message (which is saved for later retrieval by the getMessage() method).
cause - the cause (which is saved for later retrieval by the getCause() method). (A null value is permitted, and indicates that the cause is nonexistent or unknown.)
Method Detail

getCause

public java.lang.Throwable getCause()
Returns the cause of this throwable or null if the cause is nonexistent or unknown. (The cause is the throwable that caused this throwable to get thrown.)

Overrides:
getCause in class java.lang.Throwable

printStackTrace

public void printStackTrace()
Prints this throwable and its backtrace to the standard error stream. This method prints a stack trace for this Throwable object on the error output stream that is the value of the field System.err. The first line of output contains the result of the toString() method for this object. Remaining lines represent data previously recorded by the method fillInStackTrace().

Overrides:
printStackTrace in class java.lang.Throwable
See Also:
Throwable.printStackTrace()

printStackTrace

public void printStackTrace(java.io.PrintStream s)
Prints this throwable and its backtrace to the specified print stream. s - PrintStream to use for output

Overrides:
printStackTrace in class java.lang.Throwable
See Also:
Throwable.printStackTrace(PrintStream)

printStackTrace

public void printStackTrace(java.io.PrintWriter s)
Prints this throwable and its backtrace to the specified print writer.

Overrides:
printStackTrace in class java.lang.Throwable
Parameters:
s - PrintWriter to use for output
See Also:
Throwable.printStackTrace(PrintWriter)

JUnit-addons
version 1.4

Copyright © 2002-2003 Vladimir R. Bossicard. All Rights Reserved.