ComparisonFailure (JUnit API)
From Junit
|
|
|||||||||
| 上一个类 下一个类 | 框架 无框架 | ||||||||
| 摘要: 嵌套 | 字段 | 构造器 | 方法 | 详细信息: 字段 | 构造器 | 方法 | ||||||||
org.junit Class ComparisonFailure
java.lang.Objectjava.lang.Throwable
java.lang.Error
java.lang.AssertionError
org.junit.ComparisonFailure
- 所有已实现接口:
- Serializable
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)
- 另请参见:
- Serialized Form
| 构造器摘要 | |
|---|---|
ComparisonFailure(String message,
String expected,
String actual)
Constructs a comparison failure. |
|
| 方法摘要 | |
|---|---|
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. |
| 类方法继承: java.lang.Throwable |
|---|
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString |
| 类方法继承: java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| 构造器详细信息 |
|---|
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
| 方法详细信息 |
|---|
getMessage
public String getMessage()
- Returns "..." in place of common prefix and "..." in
place of common suffix between expected and actual.
- 重写:
getMessagein classThrowable
getActual
public String getActual()
- Returns the actual string value
- 返回:
- the actual string value
getExpected
public String getExpected()
- Returns the expected string value
- 返回:
- the expected string value
|
|
|||||||||
| 上一个类 下一个类 | 框架 无框架 | ||||||||
| 摘要: 嵌套 | 字段 | 构造器 | 方法 | 详细信息: 字段 | 构造器 | 方法 | ||||||||