AssertionFailedError

   
AssertionFailedError

Description

AssertionFailedError (see Figure B-2) is a class representing an assertion failure. Aside from being a distinct subclass, it is otherwise identical to Error . Thus, it is Throwable and contains a stack trace.

The assert methods in Assert throw an AssertionFailedError (or a subclass of it) when an assertion fails. The AssertionFailedError conveniently captures the stack trace of the code location from which it was thrown, making it easy to find the assertion that failed.

Figure B-2. The class AssertionFailedError
figs/utf_ab02.gif

Declaration

 public class AssertionFailedError extends java.lang.Error 

Constructors


public AssertionFailedError( )

public AssertionFailedError(String message)

The constructors for AssertionFailedError .

Public Methods

None.

Protected/Private Methods

None.

Attributes

None.



Unit Test Frameworks
Unit Test Frameworks
ISBN: 0596006896
EAN: 2147483647
Year: 2006
Pages: 146
Authors: Paul Hamill

Similar book on Amazon

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net