NameMangleListener

public abstract class NameMangleListener
extends Object implements ITestInvocationListener

java.lang.Object
   ↳ com.android.tradefed.result.NameMangleListener


A proxy listener to translate test method, class, and package names as results are reported.

Summary

Public constructors

NameMangleListener(ITestInvocationListener listener)

Public methods

TestSummary getSummary()

void invocationEnded(long elapsedTime)

void invocationFailed(Throwable cause)

void invocationStarted(IInvocationContext context)

void testAssumptionFailure(TestDescription test, String trace)

void testEnded(TestDescription test, testMetrics)

void testFailed(TestDescription test, String trace)

void testIgnored(TestDescription test)

void testLog(String dataName, LogDataType dataType, InputStreamSource dataStream)

void testRunEnded(long elapsedTime, runMetrics)

void testRunFailed(String errorMessage)

void testRunStarted(String runName, int testCount)

void testRunStopped(long elapsedTime)

void testStarted(TestDescription test)

Protected methods

TestDescription mangleTestId(TestDescription test)

This method is run on all TestDescriptions that are passed to the testStarted(com.android.tradefed.result.TestDescription), testFailed(com.android.tradefed.result.TestDescription, String), and ITestLifeCycleReceiver.testEnded(com.android.tradefed.result.TestDescription, HashMap) callbacks.

String mangleTestRunName(String name)

This method is run on all test run names that are passed to the testRunStarted(String, int) callback.

Public constructors

NameMangleListener

public NameMangleListener (ITestInvocationListener listener)

Parameters
listener ITestInvocationListener

Public methods

getSummary

public TestSummary getSummary ()

Returns
TestSummary

invocationEnded

public void invocationEnded (long elapsedTime)

Parameters
elapsedTime long

invocationFailed

public void invocationFailed (Throwable cause)

Parameters
cause Throwable

invocationStarted

public void invocationStarted (IInvocationContext context)

Parameters
context IInvocationContext

testAssumptionFailure

public void testAssumptionFailure (TestDescription test, 
                String trace)

Parameters
test TestDescription

trace String

testEnded

public void testEnded (TestDescription test, 
                 testMetrics)

Parameters
test TestDescription

testMetrics

testFailed

public void testFailed (TestDescription test, 
                String trace)

Parameters
test TestDescription

trace String

testIgnored

public void testIgnored (TestDescription test)

Parameters
test TestDescription

testLog

public void testLog (String dataName, 
                LogDataType dataType, 
                InputStreamSource dataStream)

Parameters
dataName String

dataType LogDataType

dataStream InputStreamSource

testRunEnded

public void testRunEnded (long elapsedTime, 
                 runMetrics)

Parameters
elapsedTime long

runMetrics

testRunFailed

public void testRunFailed (String errorMessage)

Parameters
errorMessage String

testRunStarted

public void testRunStarted (String runName, 
                int testCount)

Parameters
runName String

testCount int

testRunStopped

public void testRunStopped (long elapsedTime)

Parameters
elapsedTime long

testStarted

public void testStarted (TestDescription test)

Parameters
test TestDescription

Protected methods

mangleTestId

protected TestDescription mangleTestId (TestDescription test)

This method is run on all TestDescriptions that are passed to the testStarted(com.android.tradefed.result.TestDescription), testFailed(com.android.tradefed.result.TestDescription, String), and ITestLifeCycleReceiver.testEnded(com.android.tradefed.result.TestDescription, HashMap) callbacks. The method should return a possibly-different TestDescription that will be passed to the downstream ITestInvocationListener that was specified during construction.

The implementation should be careful to not modify the original TestDescription.

The default implementation passes the incoming identifier through unmodified.

Parameters
test TestDescription

Returns
TestDescription

mangleTestRunName

protected String mangleTestRunName (String name)

This method is run on all test run names that are passed to the testRunStarted(String, int) callback. The method should return a possibly-different test run name that will be passed to the downstream ITestInvocationListener that was specified during construction.

The implementation should be careful to not modify the original run name.

The default implementation passes the incoming test run name through unmodified.

Parameters
name String

Returns
String