SubprocessTestResultsParser

public class SubprocessTestResultsParser
extends Object implements Closeable

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


扩展了 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()

返回已打开的套接字接收器。

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,则会打开一个套接字接收器来接收结果。

context IInvocationContext:有关调用的 IInvocationContext 信息

抛出
IOException

SubprocessTestResultsParser

public SubprocessTestResultsParser (ITestInvocationListener listener, 
                IInvocationContext context)

结果解析器的构造函数

参数
listener ITestInvocationListenerITestInvocationListener 报告结果的位置

context IInvocationContext:有关调用的 IInvocationContext 信息

公共方法

关闭

public void close ()

抛出
IOException

completeModuleEvents

public void completeModuleEvents ()

完成并关闭所有未完成的活动

getCurrentTest

public TestDescription getCurrentTest ()

返回当前正在进行的测试。

返回
TestDescription

getReportedInvocationFailedEventInfo

public SubprocessEventHelper.InvocationFailedEventInfo getReportedInvocationFailedEventInfo ()

返回报告的调用失败事件信息。

返回
SubprocessEventHelper.InvocationFailedEventInfo

getSocketServerPort

public int getSocketServerPort ()

返回已打开的套接字接收器。如果没有,则为 -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