ComparisonFailure

   
ComparisonFailure

Description

ComparisonFailure (see Figure B-3) is a specialized subclass of AssertionFailedError . It is thrown only by the versions of assertEquals( ) that compare String s.

Figure B-3. The class ComparisonFailure
figs/utf_ab03.gif

Declaration

 public class ComparisonFailure extends AssertionFailedError 

Constructors


ComparisonFailure(String message, String expected, String actual)

The constructor for ComparisonFailure .

Public Methods


String getMessage( )

Returns the failure description message. The redundant parts of the compared String s are replaced with " .. ." so that only the parts that differ are reported .

Protected/Private Methods

None.

Attributes


private String fActual

private String fExpected

The private attributes containing copies of the strings being compared.



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

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