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

interface SubprocessTestResultsParser.EventHandler

Interface for event handling  

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()
int getSocketServerPort()

Returns the socket receiver that was open.

boolean joinReceiver(long millis)

If the event receiver is being used, ensure that we wait for it to terminate.

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

call parse on each line of the array to extract the events if any.

Public constructors

SubprocessTestResultsParser

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

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

void close ()

Throws
IOException

getSocketServerPort

int getSocketServerPort ()

Returns the socket receiver that was open. -1 if none.

Returns
int

joinReceiver

boolean joinReceiver (long millis)

If the event receiver is being used, ensure that we wait for it to terminate.

Parameters
millis long: timeout in milliseconds.
Returns
boolean True if receiver thread terminate before timeout, False otherwise.

parseFile

void parseFile (File file)

Parameters
file File

processNewLines

void processNewLines (String[] lines)

call parse on each line of the array to extract the events if any.

Parameters
lines String