ShardListener

public class ShardListener
extends CollectingTestListener implements ISupportGranularResults

java.lang.Object
   ↳ com.android.tradefed.result.CollectingTestListener
     ↳ com.android.tradefed.invoker.ShardListener


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

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

ShardListener

public ShardListener (ITestInvocationListener main)

Tạo ShardListener.

Tham số
main ITestInvocationListener: ITestInvocationListener cần chuyển tiếp kết quả. Để ngăn chặn các 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

invocationEnded

public void invocationEnded (long elapsedTime)

Tham số
elapsedTime long

invocationFailed

public void invocationFailed (FailureDescription failure)

Tham số
failure FailureDescription

invocationFailed

public void invocationFailed (Throwable cause)

Tham số
cause Throwable

invocationStarted

public void invocationStarted (IInvocationContext context)

Tham số
context IInvocationContext

setSupportGranularResults

public void setSupportGranularResults (boolean enableGranularResults)

Tham số
enableGranularResults boolean

supportGranularResults

public boolean supportGranularResults ()

Giá trị trả về
boolean

testLog

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

Tham số
dataName String

dataType LogDataType

dataStream InputStreamSource

testLogSaved

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

Tham số
dataName String

dataType LogDataType

dataStream InputStreamSource

logFile LogFile

testModuleEnded

public void testModuleEnded ()

testModuleStarted

public void testModuleStarted (IInvocationContext moduleContext)

Tham số
moduleContext IInvocationContext

testRunEnded

public void testRunEnded (long elapsedTime, 
                 runMetrics)

Tham số
elapsedTime long

runMetrics

testRunFailed

public void testRunFailed (FailureDescription failure)

Tham số
failure FailureDescription

testRunFailed

public void testRunFailed (String failureMessage)

Tham số
failureMessage String

testRunStarted

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

Tham số
name String

numTests int

attemptNumber int

startTime long