public class ComparisonFailure
extends AssertionFailedError
| java.lang.Object | |||||
| java.lang.Throwable | |||||
| java.lang.Error | |||||
| java.lang.AssertionError | |||||
| junit.framework.AssertionFailedError | |||||
| junit.framework.ComparisonFailure | |||||
当一个断言等于字符串失败时抛出。 受Alex Chaffee mailto:[email protected]的补丁启发
Public constructors |
|
|---|---|
ComparisonFailure(String message, String expected, String actual) 构造比较失败。 |
|
公共方法(Public methods) |
|
|---|---|
String |
getActual() 获取实际的字符串值 |
String |
getExpected() 获取预期的字符串值 |
String |
getMessage() 返回“...”代替通用前缀和“...”代替预期和实际之间的通用后缀。 |
继承方法(Inherited methods) |
|
|---|---|
java.lang.Throwable
|
|
java.lang.Object
|
|
ComparisonFailure (String message, String expected, String actual)
构造比较失败。
| 参数(Parameters) | |
|---|---|
message |
String: the identifying message or null |
expected |
String: the expected string value |
actual |
String: the actual string value |
String getActual ()
获取实际的字符串值
| 返回(Returns) | |
|---|---|
String |
the actual string value |
String getExpected ()
获取预期的字符串值
| 返回(Returns) | |
|---|---|
String |
the expected string value |
String getMessage ()
返回“...”代替通用前缀和“...”代替预期和实际之间的通用后缀。
| 返回(Returns) | |
|---|---|
String |
the detail message string of this Throwable instance (which may be null). |
也可以看看: