Package junit.framework
Class ComparisonFailure
java.lang.Object
java.lang.Throwable
java.lang.Error
java.lang.AssertionError
junit.framework.AssertionFailedError
junit.framework.ComparisonFailure
- All Implemented Interfaces:
Serializable
Thrown when an assert equals for Strings failed.
Inspired by a patch from Alex Chaffee mailto:alex@purpletech.com
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionComparisonFailure
(String message, String expected, String actual) Constructs a comparison failure. -
Method Summary
Modifier and TypeMethodDescriptionGets the actual string valueGets the expected string valueReturns "..." in place of common prefix and "..." in place of common suffix between expected and actual.Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Field Details
-
MAX_CONTEXT_LENGTH
private static final int MAX_CONTEXT_LENGTH- See Also:
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
fExpected
-
fActual
-
-
Constructor Details
-
ComparisonFailure
Constructs a comparison failure.- Parameters:
message
- the identifying message or nullexpected
- the expected string valueactual
- the actual string value
-
-
Method Details
-
getMessage
Returns "..." in place of common prefix and "..." in place of common suffix between expected and actual.- Overrides:
getMessage
in classThrowable
- See Also:
-
getActual
Gets the actual string value- Returns:
- the actual string value
-
getExpected
Gets the expected string value- Returns:
- the expected string value
-