Trình nghe Shard

public class ShardListener
extends CollectingTestListener implements ISupportGranularResults

java.lang.Object
   ↳ com.android.tradefed.result.collectingTestListener
     ↳ com.android.tradefed.Callbackr.ShardListener


ITestInvocationListener thu thập kết quả từ một phân đoạn lệnh gọi (còn gọi là lệnh phân tách lệnh gọi để chạy trên nhiều tài nguyên song song) và chuyển tiếp chúng đến tài nguyên khác trình nghe.

Tóm tắt

Hàm khởi tạo công khai

ShardListener(ITestInvocationListener main)

Tạo ShardListener.

Phương thức công khai

void invocationEnded(long elapsedTime)

void invocationFailed(FailureDescription failure)

void invocationFailed(Throwable cause)

void invocationStarted(IInvocationContext context)

void setSupportGranularResults(boolean enableGranularResults)
boolean supportGranularResults()

void testLog(String dataName, LogDataType dataType, InputStreamSource dataStream)

void testLogSaved(String dataName, LogDataType dataType, InputStreamSource dataStream, LogFile logFile)

void testModuleEnded()

void testModuleStarted(IInvocationContext moduleContext)

void testRunEnded(long elapsedTime, runMetrics)

void testRunFailed(FailureDescription failure)

void testRunFailed(String failureMessage)

void testRunStarted(String name, int numTests, int attemptNumber, long startTime)

Hàm khởi tạo công khai

Trình nghe Shard

public ShardListener (ITestInvocationListener main)

Tạo ShardListener.

Tham số
main ITestInvocationListener: ITestInvocationListener kết quả sẽ được chuyển tiếp. Để ngăn chặn xung đột với các ShardListener khác, đối tượng này sẽ đồng bộ hoá trên main khi chuyển tiếp kết quả. Và kết quả sẽ chỉ được gửi sau khi phân đoạn lệnh gọi hoàn tất.

Phương thức công khai

gọi đã kết thúc

public void invocationEnded (long elapsedTime)

Tham số
elapsedTime long

kích hoạt không thành công

public void invocationFailed (FailureDescription failure)

Tham số
failure FailureDescription

kích hoạt không thành công

public void invocationFailed (Throwable cause)

Tham số
cause Throwable

đã gọi

public void invocationStarted (IInvocationContext context)

Tham số
context IInvocationContext

setSupportGranularKết quả

public void setSupportGranularResults (boolean enableGranularResults)

Tham số
enableGranularResults boolean

supportGranularKết quả

public boolean supportGranularResults ()

Giá trị trả về
boolean

nhật ký kiểm thử

public void testLog (String dataName, 
                LogDataType dataType, 
                InputStreamSource dataStream)

Tham số
dataName String

dataType LogDataType

dataStream InputStreamSource

testLog đã lưu

public void testLogSaved (String dataName, 
                LogDataType dataType, 
                InputStreamSource dataStream, 
                LogFile logFile)

Tham số
dataName String

dataType LogDataType

dataStream InputStreamSource

logFile LogFile

thử nghiệmMô-đun đã kết thúc

public void testModuleEnded ()

testModuleStarted

public void testModuleStarted (IInvocationContext moduleContext)

Tham số
moduleContext IInvocationContext

testRun kết thúc

public void testRunEnded (long elapsedTime, 
                 runMetrics)

Tham số
elapsedTime long

runMetrics

testRunFailed không thành công

public void testRunFailed (FailureDescription failure)

Tham số
failure FailureDescription

testRunFailed không thành công

public void testRunFailed (String failureMessage)

Tham số
failureMessage String

Đã bắt đầu kiểm thử

public void testRunStarted (String name, 
                int numTests, 
                int attemptNumber, 
                long startTime)

Tham số
name String

numTests int

attemptNumber int

startTime long