public class ComparisonFailure extends AssertionError
assertEquals(String, String)
fails. Create and throw
a ComparisonFailure
manually if you want to show users the difference between two complex
strings.
Inspired by a patch from Alex Chaffee ([email protected])Constructor and Description |
---|
ComparisonFailure(String message,
String expected,
String actual)
Constructs a comparison failure.
|
Modifier and Type | Method and Description |
---|---|
String |
getActual()
Returns the actual string value
|
String |
getExpected()
Returns the expected string value
|
String |
getMessage()
Returns "..." in place of common prefix and "..." in
place of common suffix between expected and actual.
|
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
public String getMessage()
getMessage
in class Throwable
Throwable.getMessage()
public String getActual()
public String getExpected()