org.junit
Class ComparisonFailure
AssertionError
org.junit.ComparisonFailure
public class ComparisonFailure
extends AssertionError
Thrown when an
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)
ComparisonFailure(String message, String expected, String actual) - Constructs a comparison failure.
|
@Override | String getMessage() - Returns "..." in place of common prefix and "..." in
place of common suffix between expected and actual.
|
String | getActual() - Returns the actual string value
|
String | getExpected() - Returns the expected string value
|
ComparisonFailure
public ComparisonFailure(String message,
String expected,
String actual)
Constructs a comparison failure.
message
- the identifying message or nullexpected
- the expected string valueactual
- the actual string value
String getMessage
public @Override String getMessage()
Returns "..." in place of common prefix and "..." in
place of common suffix between expected and actual.
getActual
public String getActual()
Returns the actual string value
getExpected
public String getExpected()
Returns the expected string value
- the expected string value