BugreportCollector
public
class
BugreportCollector
extends Object
implements
ITestInvocationListener
java.lang.Object | |
↳ | com.android.tradefed.result.BugreportCollector |
ITestInvocationListener
truyền qua thu thập báo cáo lỗi khi các sự kiện có thể định cấu hình xảy ra, sau đó gọi ITestInvocationListener#testLog
trên các thành phần con sau khi thu thập mỗi báo cáo lỗi.
Hành vi: (FIXME: hoàn tất phần này)
- Ghi lại sau mỗi lần nếu có bất kỳ trường hợp kiểm thử nào không thành công
- Ghi lại sau mỗi trường hợp kiểm thử
- Ghi lại sau mỗi trường hợp kiểm thử không thành công
- Quay hình
Tóm tắt
Lớp lồng ghép | |
---|---|
enum |
BugreportCollector.Filter
|
enum |
BugreportCollector.Freq
|
enum |
BugreportCollector.Noun
|
class |
BugreportCollector.Predicate
Một mệnh đề đầy đủ mô tả thời điểm ghi lại báo cáo lỗi. |
enum |
BugreportCollector.Relation
|
interface |
BugreportCollector.SubPredicate
|
Trường | |
---|---|
public
static
final
BugreportCollector.Predicate |
AFTER_FAILED_TESTCASES
Một mệnh đề được xác định trước sẽ kích hoạt sau mỗi trường hợp kiểm thử không thành công |
public
static
final
BugreportCollector.Predicate |
AT_START
Một thuộc tính xác định trước sẽ kích hoạt khi lệnh gọi đầu tiên bắt đầu |
Hàm khởi tạo công khai | |
---|---|
BugreportCollector(ITestInvocationListener listener, ITestDevice testDevice)
|
Phương thức công khai | |
---|---|
void
|
addPredicate(BugreportCollector.Predicate p)
|
void
|
blockUntilIdle()
Chặn cho đến khi trình thu thập không thu thập bất kỳ báo cáo lỗi nào. |
TestSummary
|
getSummary()
|
void
|
invocationEnded(long elapsedTime)
|
void
|
invocationFailed(Throwable cause)
|
void
|
invocationStarted(IInvocationContext context)
|
void
|
setAsynchronous(boolean asynchronous)
Đặt xem tính năng thu thập báo cáo lỗi có thu thập báo cáo lỗi trong một luồng khác hay không ( |
void
|
setDescriptiveName(String name)
Đặt tên mô tả để sử dụng khi ghi lại báo cáo lỗi. |
void
|
setDeviceWaitTime(int waitTime)
Thiết lập thời gian (tính bằng giây) để chờ thiết bị có kết nối mạng trước khi chúng ta cố gắng ghi lại báo cáo lỗi. |
void
|
testAssumptionFailure(TestDescription test, String trace)
|
void
|
testEnded(TestDescription test,
|
void
|
testFailed(TestDescription test, String trace)
|
void
|
testIgnored(TestDescription test)
|
void
|
testLog(String dataName, LogDataType dataType, InputStreamSource dataStream)
|
void
|
testRunEnded(long elapsedTime,
|
void
|
testRunFailed(String errorMessage)
|
void
|
testRunStarted(String runName, int testCount)
|
void
|
testRunStopped(long elapsedTime)
|
void
|
testStarted(TestDescription test)
|
Trường
AFTER_FAILED_TESTCASES
public static final BugreportCollector.Predicate AFTER_FAILED_TESTCASES
Một mệnh đề được xác định trước sẽ kích hoạt sau mỗi trường hợp kiểm thử không thành công
AT_START
public static final BugreportCollector.Predicate AT_START
Một thuộc tính xác định trước sẽ kích hoạt khi lệnh gọi đầu tiên bắt đầu
Hàm khởi tạo công khai
BugreportCollector
public BugreportCollector (ITestInvocationListener listener, ITestDevice testDevice)
Tham số | |
---|---|
listener |
ITestInvocationListener |
testDevice |
ITestDevice |
Phương thức công khai
addPredicate
public void addPredicate (BugreportCollector.Predicate p)
Tham số | |
---|---|
p |
BugreportCollector.Predicate |
blockUntilIdle
public void blockUntilIdle ()
Chặn cho đến khi trình thu thập không thu thập bất kỳ báo cáo lỗi nào. Nếu trình thu thập không chủ động thu thập báo cáo lỗi, hãy trả về ngay lập tức
getSummary
public TestSummary getSummary ()
Giá trị trả về | |
---|---|
TestSummary |
invocationEnded
public void invocationEnded (long elapsedTime)
Tham số | |
---|---|
elapsedTime |
long |
invocationFailed
public void invocationFailed (Throwable cause)
Tham số | |
---|---|
cause |
Throwable |
invocationStarted
public void invocationStarted (IInvocationContext context)
Tham số | |
---|---|
context |
IInvocationContext |
setAsynchronous
public void setAsynchronous (boolean asynchronous)
Đặt xem tính năng thu thập báo cáo lỗi có thu thập báo cáo lỗi trong một luồng khác hay không (asynchronous = true
) hoặc chặn phương thức gọi cho đến khi thu thập được báo cáo lỗi (asynchronous = false
).
Tham số | |
---|---|
asynchronous |
boolean |
setDescriptiveName
public void setDescriptiveName (String name)
Đặt tên mô tả để sử dụng khi ghi lại báo cáo lỗi. Nếu là null
, BugreportCollector
sẽ quay lại hành vi mặc định là chuyển đổi tuần tự tên của sự kiện đã thu thập báo cáo lỗi.
Tham số | |
---|---|
name |
String |
setDeviceWaitTime
public void setDeviceWaitTime (int waitTime)
Thiết lập thời gian (tính bằng giây) để chờ thiết bị có kết nối mạng trước khi chúng ta cố gắng ghi lại báo cáo lỗi. Nếu giá trị là âm, hệ thống sẽ không thực hiện kiểm tra. Mọi DeviceNotAvailableException
gặp phải trong quá trình kiểm tra này sẽ được ghi lại và bỏ qua.
Tham số | |
---|---|
waitTime |
int |
testAssumptionFailure
public void testAssumptionFailure (TestDescription test, String trace)
Tham số | |
---|---|
test |
TestDescription |
trace |
String |
testEnded
public void testEnded (TestDescription test,testMetrics)
Tham số | |
---|---|
test |
TestDescription |
testMetrics |
|
testFailed
public void testFailed (TestDescription test, String trace)
Tham số | |
---|---|
test |
TestDescription |
trace |
String |
testIgnored
public void testIgnored (TestDescription test)
Tham số | |
---|---|
test |
TestDescription |
testLog
public void testLog (String dataName, LogDataType dataType, InputStreamSource dataStream)
Tham số | |
---|---|
dataName |
String |
dataType |
LogDataType |
dataStream |
InputStreamSource |
testRunEnded
public void testRunEnded (long elapsedTime,runMetrics)
Tham số | |
---|---|
elapsedTime |
long |
runMetrics |
|
testRunFailed
public void testRunFailed (String errorMessage)
Tham số | |
---|---|
errorMessage |
String |
testRunStarted
public void testRunStarted (String runName, int testCount)
Tham số | |
---|---|
runName |
String |
testCount |
int |
testRunStopped
public void testRunStopped (long elapsedTime)
Tham số | |
---|---|
elapsedTime |
long |
testStarted
public void testStarted (TestDescription test)
Tham số | |
---|---|
test |
TestDescription |