ComparisonFailure (JUnit API)

Junit API


junit.framework Class ComparisonFailure

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

public class ComparisonFailure
extends AssertionFailedError

Thrown when an assert equals for Strings failed. Inspired by a patch from Alex Chaffee mailto:[email protected]

See Also:
Serialized Form

 
 java.lang.String
 
 
 

ComparisonFailure

public ComparisonFailure(java.lang.String message,
                         java.lang.String expected,
                         java.lang.String actual)
Constructs a comparison failure.

Parameters:
message - the identifying message or null
expected - the expected string value
actual - the actual string value

getMessage

public java.lang.String getMessage()
Returns "..." in place of common prefix and "..." in place of common suffix between expected and actual.

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