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:
java.io.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
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.StringfActualprivate java.lang.StringfExpectedprivate static intMAX_CONTEXT_LENGTHprivate static longserialVersionUID
-
Constructor Summary
Constructors Constructor Description ComparisonFailure(java.lang.String message, java.lang.String expected, java.lang.String actual)Constructs a comparison failure.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetActual()Gets the actual string valuejava.lang.StringgetExpected()Gets the expected string valuejava.lang.StringgetMessage()Returns "..." in place of common prefix and "..." in place of common suffix between expected and actual.
-
-
-
Field Detail
-
MAX_CONTEXT_LENGTH
private static final int MAX_CONTEXT_LENGTH
- See Also:
- Constant Field Values
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
fExpected
private java.lang.String fExpected
-
fActual
private java.lang.String fActual
-
-
Method Detail
-
getMessage
public java.lang.String getMessage()
Returns "..." in place of common prefix and "..." in place of common suffix between expected and actual.- Overrides:
getMessagein classjava.lang.Throwable- See Also:
Throwable.getMessage()
-
getActual
public java.lang.String getActual()
Gets the actual string value- Returns:
- the actual string value
-
getExpected
public java.lang.String getExpected()
Gets the expected string value- Returns:
- the expected string value
-
-