Failure (JUnit API)
From Junit
|
|
|||||||||
| 上一个类 下一个类 | 框架 无框架 | ||||||||
| 摘要: 嵌套 | 字段 | 构造器 | 方法 | 详细信息: 字段 | 构造器 | 方法 | ||||||||
org.junit.runner.notification Class Failure
java.lang.Objectorg.junit.runner.notification.Failure
public class Failure
- extends Object
A Failure holds a description of the failed test and the
exception that was thrown while running it. In most cases the Description
will be of a single test. However, if problems are encountered while constructing the
test (for example, if a BeforeClass method is not static), it may describe
something other than a single test.
| 构造器摘要 | |
|---|---|
Failure(Description description,
Throwable thrownException)
Constructs a Failure with the given description and exception. |
|
| 方法摘要 | |
|---|---|
Description |
getDescription()
|
Throwable |
getException()
|
String |
getMessage()
Convenience method |
String |
getTestHeader()
|
String |
getTrace()
Convenience method |
String |
toString()
|
| 类方法继承: java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| 构造器详细信息 |
|---|
Failure
public Failure(Description description, Throwable thrownException)
- Constructs a
Failurewith the given description and exception.- 参数:
description- aDescriptionof the test that failedthrownException- the exception that was thrown while running the test
| 方法详细信息 |
|---|
getTestHeader
public String getTestHeader()
- 返回:
- a user-understandable label for the test
getDescription
public Description getDescription()
- 返回:
- the raw description of the context of the failure.
getException
public Throwable getException()
- 返回:
- the exception thrown
toString
public String toString()
getTrace
public String getTrace()
- Convenience method
- 返回:
- the printed form of the exception
getMessage
public String getMessage()
- Convenience method
- 返回:
- the message of the thrown exception
|
|
|||||||||
| 上一个类 下一个类 | 框架 无框架 | ||||||||
| 摘要: 嵌套 | 字段 | 构造器 | 方法 | 详细信息: 字段 | 构造器 | 方法 | ||||||||