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()
返回已打开的套接字接收器。 |
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 |
ITestInvocationListener :ITestInvocationListener 报告结果的位置 |
streaming |
boolean :如果为 True,系统会打开套接字接收器以接收结果。 |
context |
IInvocationContext :有关调用的 IInvocationContext 信息 |
SubprocessTestResultsParser
public SubprocessTestResultsParser (ITestInvocationListener listener, IInvocationContext context)
结果解析器的构造函数
参数 | |
---|---|
listener |
ITestInvocationListener :ITestInvocationListener 报告结果的位置 |
context |
IInvocationContext :有关调用的 IInvocationContext 信息 |
公共方法
关闭
public void close ()
completeModuleEvents
public void completeModuleEvents ()
完成并关闭所有未结事件
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 |