junit.framework
Class ComparisonFailure
java.lang.Object
java.lang.Throwable
java.lang.Error
junit.framework.AssertionFailedError
junit.framework.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
Method Summary |
String |
getMessage()
Returns "..." in place of common prefix and "..." in
place of common suffix between expected and actual. |
ComparisonFailure
public ComparisonFailure(String message,
String expected,
String actual)
- Constructs a comparison failure.
- Parameters:
message
- the identifying message or nullexpected
- the expected string valueactual
- the actual string value
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
- Returns:
- the error message string of this
Throwable
object if it was created
with an
error message string; or null
if it was
created
with no error message. - See Also:
Throwable.getMessage()
Copyright © 2006, 2007 Sun Microsystems, Inc. All Rights Reserved.