SubprocessTestResultsParser
public
class
SubprocessTestResultsParser
extends Object
implements
Closeable
| java.lang.Object | |
| ↳ | com.android.tradefed.util.SubprocessTestResultsParser |
Extends FileOutputStream to parse the output before writing to the file so we can
generate the test events on the launcher side.
Summary
Nested classes | |
|---|---|
class |
SubprocessTestResultsParser.StatusKeys
Relevant test status keys. |
Public constructors | |
|---|---|
SubprocessTestResultsParser(ITestInvocationListener listener, boolean streaming, IInvocationContext context)
Constructor for the result parser |
|
SubprocessTestResultsParser(ITestInvocationListener listener, IInvocationContext context)
Constructor for the result parser |
|
Public methods | |
|---|---|
void
|
close()
|
void
|
completeModuleEvents()
Complete and close any left open events |
TestDescription
|
getCurrentTest()
Returns the test that is currently in progress. |
SubprocessEventHelper.InvocationFailedEventInfo
|
getReportedInvocationFailedEventInfo()
Returns reported invocation failure event info. |
int
|
getSocketServerPort()
Returns the socket receiver that was open. |
Long
|
getStartTime()
Returns the start time associated with the invocation start event from the subprocess invocation. |
boolean
|
joinReceiver(long millis, boolean waitForConnection)
Wait for the event receiver to finish processing events. |
boolean
|
joinReceiver(long millis)
Wait for the event receiver to finish processing events. |
void
|
parseFile(File file)
|
void
|
processNewLines(String[] lines)
call parse on each line of the array to extract the events if any. |
boolean
|
reportedInvocationFailed()
Returns whether or not an invocation failed was reported. |
void
|
setIgnoreTestLog(boolean ignoreTestLog)
Whether or not to ignore testLog events and only rely on logAssociation. |
Public constructors
SubprocessTestResultsParser
public SubprocessTestResultsParser (ITestInvocationListener listener, boolean streaming, IInvocationContext context)
Constructor for the result parser
| Parameters | |
|---|---|
listener |
ITestInvocationListener: ITestInvocationListener where to report the results |
streaming |
boolean: if True, a socket receiver will be open to receive results. |
context |
IInvocationContext: a IInvocationContext information about the invocation |
| Throws | |
|---|---|
IOException |
|
SubprocessTestResultsParser
public SubprocessTestResultsParser (ITestInvocationListener listener, IInvocationContext context)
Constructor for the result parser
| Parameters | |
|---|---|
listener |
ITestInvocationListener: ITestInvocationListener where to report the results |
context |
IInvocationContext: a IInvocationContext information about the invocation |
Public methods
close
public void close ()
| Throws | |
|---|---|
IOException |
|
completeModuleEvents
public void completeModuleEvents ()
Complete and close any left open events
getCurrentTest
public TestDescription getCurrentTest ()
Returns the test that is currently in progress.
| Returns | |
|---|---|
TestDescription |
|
getReportedInvocationFailedEventInfo
public SubprocessEventHelper.InvocationFailedEventInfo getReportedInvocationFailedEventInfo ()
Returns reported invocation failure event info.
| Returns | |
|---|---|
SubprocessEventHelper.InvocationFailedEventInfo |
|
getSocketServerPort
public int getSocketServerPort ()
Returns the socket receiver that was open. -1 if none.
| Returns | |
|---|---|
int |
|
getStartTime
public Long getStartTime ()
Returns the start time associated with the invocation start event from the subprocess invocation.
| Returns | |
|---|---|
Long |
|
joinReceiver
public boolean joinReceiver (long millis,
boolean waitForConnection)Wait for the event receiver to finish processing events.
| Parameters | |
|---|---|
millis |
long: timeout in milliseconds. |
waitForConnection |
boolean: False to skip waiting if a connection was never established. |
| Returns | |
|---|---|
boolean |
True if receiver thread terminate before timeout, False otherwise. |
joinReceiver
public boolean joinReceiver (long millis)
Wait for the event receiver to finish processing events. Will wait even if a connection wasn't established, i.e. processing hasn't begun yet.
| Parameters | |
|---|---|
millis |
long: timeout in milliseconds. |
| Returns | |
|---|---|
boolean |
True if receiver thread terminate before timeout, False otherwise. |
parseFile
public void parseFile (File file)
| Parameters | |
|---|---|
file |
File |
processNewLines
public void processNewLines (String[] lines)
call parse on each line of the array to extract the events if any.
| Parameters | |
|---|---|
lines |
String |
reportedInvocationFailed
public boolean reportedInvocationFailed ()
Returns whether or not an invocation failed was reported.
| Returns | |
|---|---|
boolean |
|
setIgnoreTestLog
public void setIgnoreTestLog (boolean ignoreTestLog)
Whether or not to ignore testLog events and only rely on logAssociation.
| Parameters | |
|---|---|
ignoreTestLog |
boolean |
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2026-06-22 UTC.