SubprocessTestResultsParser

public class SubprocessTestResultsParser
extends Object

java.lang.Object
   ↳ com.android.tradefed.util.SubprocessTestResultsParser


擴充 ERROR(/FileOutputStream),在寫入檔案前剖析輸出內容,以便在啟動器端產生測試事件。

摘要

巢狀類別

class SubprocessTestResultsParser.StatusKeys

相關的測試狀態鍵。 

公用建構函式

SubprocessTestResultsParser(ITestInvocationListener listener, boolean streaming, IInvocationContext context)

結果剖析器的建構函式

SubprocessTestResultsParser(ITestInvocationListener listener, IInvocationContext context)

結果剖析器的建構函式

公用方法

void close()
void completeModuleEvents()

完成並關閉所有未完成的事件

TestDescription getCurrentTest()

傳回目前進行中的測試。

SubprocessEventHelper.InvocationFailedEventInfo getReportedInvocationFailedEventInfo()

傳回已回報的叫用失敗事件資訊。

int getSocketServerPort()

傳回已開啟的 Socket 接收器。

Long getStartTime()

傳回與子程序叫用所產生的叫用開始事件相關聯的開始時間。

boolean joinReceiver(long millis, boolean waitForConnection)

等待事件接收器處理完事件。

boolean joinReceiver(long millis)

等待事件接收器處理完事件。

void parseFile(File file)
void processNewLines(String[] lines)

對陣列的每個資料行呼叫 parse,以便擷取事件 (如果有的話)。

boolean reportedInvocationFailed()

傳回是否已回報叫用失敗。

void setIgnoreTestLog(boolean ignoreTestLog)

是否要忽略 testLog 事件,並只依賴 logAssociation。

公用建構函式

SubprocessTestResultsParser

public SubprocessTestResultsParser (ITestInvocationListener listener, 
                boolean streaming, 
                IInvocationContext context)

結果剖析器的建構函式

參數
listener ITestInvocationListenerITestInvocationListener 回報結果的位置

streaming boolean:如果為 True,系統會開啟 Socket 接收器來接收結果。

context IInvocationContext:叫用作業的 IInvocationContext 資訊

SubprocessTestResultsParser

public SubprocessTestResultsParser (ITestInvocationListener listener, 
                IInvocationContext context)

結果剖析器的建構函式

參數
listener ITestInvocationListenerITestInvocationListener 回報結果的位置

context IInvocationContext:有關叫用作業的 IInvocationContext 資訊

公用方法

關閉

public void close ()

completeModuleEvents

public void completeModuleEvents ()

完成並關閉所有未完成的事件

getCurrentTest

public TestDescription getCurrentTest ()

傳回目前進行中的測試。

傳回
TestDescription

getReportedInvocationFailedEventInfo

public SubprocessEventHelper.InvocationFailedEventInfo getReportedInvocationFailedEventInfo ()

傳回已回報的叫用失敗事件資訊。

傳回
SubprocessEventHelper.InvocationFailedEventInfo

getSocketServerPort

public int getSocketServerPort ()

傳回已開啟的 Socket 接收器。如果沒有,則為 -1。

傳回
int

getStartTime

public Long getStartTime ()

傳回與子程序叫用所產生的叫用開始事件相關聯的開始時間。

傳回
Long

joinReceiver

public boolean joinReceiver (long millis, 
                boolean waitForConnection)

等待事件接收器處理完事件。

參數
millis long:逾時時間,以毫秒為單位。

waitForConnection boolean:如果從未建立連線,則為 False 略過等待。

傳回
boolean 如果接收器執行緒在逾時前終止,則傳回 True;否則傳回 False。

joinReceiver

public boolean joinReceiver (long millis)

等待事件接收器處理完事件。即使未建立連線 (也就是尚未開始處理),也會等待。

參數
millis long:逾時時間,以毫秒為單位。

傳回
boolean 如果接收器執行緒在逾時前終止,則傳回 True;否則傳回 False。

parseFile

public void parseFile (File file)

參數
file File

processNewLines

public void processNewLines (String[] lines)

對陣列的每個資料列呼叫 parse,以便擷取事件 (如果有)。

參數
lines String

reportedInvocationFailed

public boolean reportedInvocationFailed ()

傳回是否已回報叫用失敗。

傳回
boolean

setIgnoreTestLog

public void setIgnoreTestLog (boolean ignoreTestLog)

是否要忽略 testLog 事件,並只依賴 logAssociation。

參數
ignoreTestLog boolean