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
public class ComparisonFailure extends AssertionFailedError
Thrown when an assert equals for Strings failed. Inspired by a patch from Alex Chaffee mailto:alex@purpletech.com- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ComparisonFailure(String message, String expected, String actual)Constructs a comparison failure.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetActual()Gets the actual string valueStringgetExpected()Gets the expected string valueStringgetMessage()Returns "..." 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
-
-
-
-
Method Detail
-
getMessage
public String getMessage()
Returns "..." in place of common prefix and "..." in place of common suffix between expected and actual.- Overrides:
getMessagein classThrowable- See Also:
Throwable.getMessage()
-
getActual
public String getActual()
Gets the actual string value- Returns:
- the actual string value
-
getExpected
public String getExpected()
Gets the expected string value- Returns:
- the expected string value
-
-