BugreportCollector
public class BugreportCollector
extends Object
implements ITestInvocationListener
java.lang.Object | |
↳ | com.android.tradefed.result.BugreportCollector |
传递ITestInvocationListener
,它在发生可配置事件时收集ITestInvocationListener
,然后在收集每个ITestInvocationListener#testLog
报告后在其子ITestInvocationListener#testLog
上调用ITestInvocationListener#testLog
。
- 在每个测试用例失败后捕获
- 在每个测试用例之后捕获
- 在每个失败的测试用例之后捕获
- 捕获
概要
嵌套类 | |
---|---|
enum | BugreportCollector.Filter |
enum | BugreportCollector.Freq |
enum | BugreportCollector.Noun |
class | BugreportCollector.Predicate 描述何时捕获错误报告的完整谓词。 |
enum | BugreportCollector.Relation |
interface | BugreportCollector.SubPredicate
|
领域 | |
---|---|
public static final BugreportCollector.Predicate | AFTER_FAILED_TESTCASES 在每个失败的测试用例之后触发的预定义谓词 |
public static final BugreportCollector.Predicate | AT_START 在第一个调用开始时触发的预定义谓词 |
公共建设者 | |
---|---|
BugreportCollector (ITestInvocationListener listener, ITestDevice testDevice) |
公开方法 | |
---|---|
void | addPredicate ( BugreportCollector.Predicate p) |
void | blockUntilIdle () 阻止直到收集器未收集任何错误报告。 |
TestSummary | getSummary () |
void | invocationEnded (long elapsedTime) |
void | invocationFailed (Throwable cause) |
void | invocationStarted (IInvocationContext context) |
void | setAsynchronous (boolean asynchronous) 设置bugreport集合是应该在另一个线程中收集bugreport( |
void | setDescriptiveName (String name) 设置在记录错误报告时要使用的描述性名称。 |
void | setDeviceWaitTime (int waitTime) 设置等待设备在线之前等待捕获错误报告的时间(以秒为单位)。 |
void | testAssumptionFailure (TestDescription test, String trace) |
void | testEnded (TestDescription test, testMetrics) testEnded (TestDescription test, testMetrics) |
void | testFailed (TestDescription test, String trace) |
void | testIgnored (TestDescription test) |
void | testLog (String dataName, LogDataType dataType, InputStreamSource dataStream) |
void | testRunEnded (long elapsedTime, runMetrics) testRunEnded (long elapsedTime, runMetrics) |
void | testRunFailed (String errorMessage) |
void | testRunStarted (String runName, int testCount) |
void | testRunStopped (long elapsedTime) |
void | testStarted (TestDescription test)
|
领域
AFTER_FAILED_TESTCASES
public static final BugreportCollector.Predicate AFTER_FAILED_TESTCASES
在每个失败的测试用例之后触发的预定义谓词
公共建设者
BugreportCollector
public BugreportCollector (ITestInvocationListener listener, ITestDevice testDevice)
参量 | |
---|---|
listener | ITestInvocationListener |
testDevice | ITestDevice |
公开方法
addPredicate
public void addPredicate (BugreportCollector.Predicate p)
参量 | |
---|---|
p | BugreportCollector.Predicate |
blockUntilIdle
public void blockUntilIdle ()
阻止直到收集器未收集任何错误报告。如果收集器没有积极收集错误报告,请立即返回
getSummary
public TestSummary getSummary ()
退货 | |
---|---|
TestSummary |
调用结束
public void invocationEnded (long elapsedTime)
参量 | |
---|---|
elapsedTime | long |
调用失败
public void invocationFailed (Throwable cause)
参量 | |
---|---|
cause | Throwable |
调用开始
public void invocationStarted (IInvocationContext context)
参量 | |
---|---|
context | IInvocationContext |
setAsynchronous
public void setAsynchronous (boolean asynchronous)
设置bugreport集合是应该在另一个线程中收集bugreport( asynchronous = true
),还是阻止调用者直到捕获bugreport( asynchronous = false
)。
参量 | |
---|---|
asynchronous | boolean |
setDescriptiveName
public void setDescriptiveName (String name)
设置在记录错误报告时要使用的描述性名称。如果为null
,则BugreportCollector
将退回到默认行为,即序列化导致收集错误报告的事件的名称。
参量 | |
---|---|
name | String |
setDeviceWaitTime
public void setDeviceWaitTime (int waitTime)
设置等待设备在线之前等待捕获错误报告的时间(以秒为单位)。如果为负,则不执行任何检查。在此检查过程中遇到的任何DeviceNotAvailableException
将被记录并忽略。
参量 | |
---|---|
waitTime | int |
testAssumptionFailure
public void testAssumptionFailure (TestDescription test, String trace)
参量 | |
---|---|
test | TestDescription |
trace | String |
testEnded
public void testEnded (TestDescription test,testMetrics)
参量 | |
---|---|
test | TestDescription |
testMetrics |
测试失败
public void testFailed (TestDescription test, String trace)
参量 | |
---|---|
test | TestDescription |
trace | String |
testIgnored
public void testIgnored (TestDescription test)
参量 | |
---|---|
test | TestDescription |
测试日志
public void testLog (String dataName, LogDataType dataType, InputStreamSource dataStream)
参量 | |
---|---|
dataName | String |
dataType | LogDataType |
dataStream | InputStreamSource |
testRunEnded
public void testRunEnded (long elapsedTime,runMetrics)
参量 | |
---|---|
elapsedTime | long |
runMetrics |
testRunFailed
public void testRunFailed (String errorMessage)
参量 | |
---|---|
errorMessage | String |
testRunStarted
public void testRunStarted (String runName, int testCount)
参量 | |
---|---|
runName | String |
testCount | int |
testRunStopped
public void testRunStopped (long elapsedTime)
参量 | |
---|---|
elapsedTime | long |
testStarted
public void testStarted (TestDescription test)
参量 | |
---|---|
test | TestDescription |
Content and code samples on this page are subject to the licenses described in the Content License. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2020-09-08 UTC.