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 () |
TestDescription | getCurrentTest () 返回当前正在进行的测试。 |
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 ()
getCurrentTest
public TestDescription getCurrentTest ()
返回当前正在进行的测试。
退货 | |
---|---|
TestDescription |
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 |
reportInvocationFailed
public boolean reportedInvocationFailed ()
返回是否报告调用失败。
退货 | |
---|---|
boolean |
setIgnoreTestLog
public void setIgnoreTestLog (boolean ignoreTestLog)
是否忽略testLog事件并仅依赖logAssociation。
参量 | |
---|---|
ignoreTestLog | boolean |
Content and code samples on this page are subject to the licenses described in the Content License. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2020-09-08 UTC.