StreamProtoReceiver

public class StreamProtoReceiver
extends Object

java.lang.Object
   ↳ com.android.tradefed.result.proto.StreamProtoReceiver


A receiver that translates proto TestRecord received into Tradefed events.

Summary

Public constructors

StreamProtoReceiver(ITestInvocationListener listener, IInvocationContext mainContext, boolean reportInvocation)

Ctor.

StreamProtoReceiver(ITestInvocationListener listener, IInvocationContext mainContext, boolean reportInvocation, boolean quietParsing)

Ctor.

StreamProtoReceiver(ITestInvocationListener listener, IInvocationContext mainContext, boolean reportInvocation, boolean quietParsing, boolean reportLogs, String logNamePrefix)
StreamProtoReceiver(ITestInvocationListener listener, IInvocationContext mainContext, boolean reportInvocation, boolean quietParsing, boolean reportLogs, String logNamePrefix, boolean mergeInvocationMetrics)

Ctor.

StreamProtoReceiver(ITestInvocationListener listener, IInvocationContext mainContext, boolean reportInvocation, boolean quietParsing, String logNamePrefix)

Ctor.

Public methods

void close()
void completeModuleEvents()

If needed to ensure consistent reporting, complete the events of the module.

Throwable getError()

Returns the error caugh in the receiver thread.

int getSocketServerPort()

Returns the socket receiver that was open.

boolean hasInvocationFailed()

Returns whether or not the invocation failed has been reported.

boolean joinReceiver(long millis)

Protected methods

long getJoinTimeout(long millis)

Public constructors

StreamProtoReceiver

public StreamProtoReceiver (ITestInvocationListener listener, 
                IInvocationContext mainContext, 
                boolean reportInvocation)

Ctor.

Parameters
listener ITestInvocationListener: the ITestInvocationListener where to report the results.

mainContext IInvocationContext

reportInvocation boolean: Whether or not to report the invocation level events.

Throws
IOException

StreamProtoReceiver

public StreamProtoReceiver (ITestInvocationListener listener, 
                IInvocationContext mainContext, 
                boolean reportInvocation, 
                boolean quietParsing)

Ctor.

Parameters
listener ITestInvocationListener: the ITestInvocationListener where to report the results.

mainContext IInvocationContext

reportInvocation boolean: Whether or not to report the invocation level events.

quietParsing boolean: Whether or not to let the parser log debug information.

Throws
IOException

StreamProtoReceiver

public StreamProtoReceiver (ITestInvocationListener listener, 
                IInvocationContext mainContext, 
                boolean reportInvocation, 
                boolean quietParsing, 
                boolean reportLogs, 
                String logNamePrefix)

Parameters
listener ITestInvocationListener

mainContext IInvocationContext

reportInvocation boolean

quietParsing boolean

reportLogs boolean

logNamePrefix String

StreamProtoReceiver

public StreamProtoReceiver (ITestInvocationListener listener, 
                IInvocationContext mainContext, 
                boolean reportInvocation, 
                boolean quietParsing, 
                boolean reportLogs, 
                String logNamePrefix, 
                boolean mergeInvocationMetrics)

Ctor.

Parameters
listener ITestInvocationListener: the ITestInvocationListener where to report the results.

mainContext IInvocationContext

reportInvocation boolean: Whether or not to report the invocation level events.

quietParsing boolean: Whether or not to let the parser log debug information.

reportLogs boolean: Whether or not to report the logs

logNamePrefix String: The prefix for file logged through the parser.

mergeInvocationMetrics boolean

Throws
IOException

StreamProtoReceiver

public StreamProtoReceiver (ITestInvocationListener listener, 
                IInvocationContext mainContext, 
                boolean reportInvocation, 
                boolean quietParsing, 
                String logNamePrefix)

Ctor.

Parameters
listener ITestInvocationListener: the ITestInvocationListener where to report the results.

mainContext IInvocationContext

reportInvocation boolean: Whether or not to report the invocation level events.

quietParsing boolean: Whether or not to let the parser log debug information.

logNamePrefix String: The prefix for file logged through the parser.

Throws
IOException

Public methods

close

public void close ()

completeModuleEvents

public void completeModuleEvents ()

If needed to ensure consistent reporting, complete the events of the module.

getError

public Throwable getError ()

Returns the error caugh in the receiver thread. If none it will return null.

Returns
Throwable

getSocketServerPort

public int getSocketServerPort ()

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

Returns
int

hasInvocationFailed

public boolean hasInvocationFailed ()

Returns whether or not the invocation failed has been reported.

Returns
boolean

joinReceiver

public boolean joinReceiver (long millis)

Parameters
millis long

Returns
boolean

Protected methods

getJoinTimeout

protected long getJoinTimeout (long millis)

Parameters
millis long

Returns
long