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 (alex@purpletech.com)
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, toString
public String getActual()
public String getExpected()
public String getMessage()
getMessage
in class Throwable
Throwable
instance (which may be null
).Throwable.getMessage()