junit.framework

Class ComparisonFailure

public class ComparisonFailure extends AssertionFailedError

Thrown when an assert equals for Strings failed. Inspired by a patch from Alex Chaffee mailto:alex@purpletech.com
Constructor Summary
ComparisonFailure(String message, String expected, String actual)
Constructs a comparison failure.
Method Summary
StringgetActual()
Gets the actual string value
StringgetExpected()
Gets the expected string value
StringgetMessage()
Returns "..." in place of common prefix and "..." in place of common suffix between expected and actual.

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

getActual

public String getActual()
Gets the actual string value

Returns: the actual string value

getExpected

public String getExpected()
Gets the expected string value

Returns: the expected string value

getMessage

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

See Also: java.lang.Throwable#getMessage()