junit.framework
Class ComparisonFailure

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Error
          extended by junit.framework.AssertionFailedError
              extended by junit.framework.ComparisonFailure
All Implemented Interfaces:
Serializable

public class ComparisonFailure
extends AssertionFailedError

Thrown when an assert equals for Strings failed. Inspired by a patch from Alex Chaffee mailto:alex@purpletech.com

See Also:
Serialized Form

Field Summary
private  String fActual
           
private  String fExpected
           
 
Constructor Summary
ComparisonFailure(String message, String expected, String actual)
          Constructs a comparison failure.
 
Method Summary
 String getMessage()
          Returns "..." in place of common prefix and "..." in place of common suffix between expected and actual.
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

fExpected

private String fExpected

fActual

private String fActual
Constructor Detail

ComparisonFailure

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

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

getMessage

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

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