BugreportCollector

public class BugreportCollector
extends Object implements ITestInvocationListener

java.lang.Object
   ↳ com.android.tradefed.result.BugreportCollector


ITestInvocationListener ที่ส่งผ่านซึ่งรวบรวมข้อบกพร่องเมื่อเกิดเหตุการณ์ที่กําหนดค่าได้ จากนั้นเรียก 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)

ตั้งค่าว่าการเก็บรวบรวมรายงานข้อบกพร่องควรรวบรวมรายงานข้อบกพร่องในชุดข้อความอื่นหรือไม่ (asynchronous = true) หรือบล็อกผู้โทรจนกว่าจะมีการบันทึกรายงานข้อบกพร่อง (asynchronous = false)

void setDescriptiveName(String name)

ตั้งค่าชื่อที่สื่อความหมายที่จะใช้เมื่อบันทึกการรายงานข้อบกพร่อง

void setDeviceWaitTime(int waitTime)

ตั้งค่าเวลา (เป็นวินาที) เพื่อรอให้อุปกรณ์ออนไลน์ก่อนที่จะพยายามบันทึกรายงานข้อบกพร่อง

void testAssumptionFailure(TestDescription test, String trace)

void 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)

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

พรอมต์ที่กําหนดไว้ล่วงหน้าซึ่งจะทํางานหลังจากแต่ละชุดทดสอบที่ทําไม่สําเร็จ

AT_START

public static final BugreportCollector.Predicate AT_START

พรอมต์ที่กําหนดไว้ล่วงหน้าซึ่งเริ่มทํางานเมื่อการเรียกใช้ครั้งแรกเริ่มต้น

ตัวสร้างแบบสาธารณะ

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

invocationEnded

public void invocationEnded (long elapsedTime)

พารามิเตอร์
elapsedTime long

invocationFailed

public void invocationFailed (Throwable cause)

พารามิเตอร์
cause Throwable

invocationStarted

public void invocationStarted (IInvocationContext context)

พารามิเตอร์
context IInvocationContext

setAsynchronous

public void setAsynchronous (boolean asynchronous)

ตั้งค่าว่าการเก็บรวบรวมรายงานข้อบกพร่องควรรวบรวมรายงานข้อบกพร่องในชุดข้อความอื่นหรือไม่ (asynchronous = true) หรือบล็อกผู้โทรจนกว่าจะมีการบันทึกรายงานข้อบกพร่อง (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

testFailed

public void testFailed (TestDescription test, 
                String trace)

พารามิเตอร์
test TestDescription

trace String

testIgnored

public void testIgnored (TestDescription test)

พารามิเตอร์
test TestDescription

testLog

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