TestResult
public
class
TestResult
extends Object
java.lang.Object | |
↳ | com.android.tradefed.result.TestResult |
Container for a result of a single test.
Summary
Fields | |
---|---|
public
static
final
String |
IS_FLAKY
|
Public constructors | |
---|---|
TestResult()
|
Public methods | |
---|---|
void
|
addLoggedFile(String dataName, LogFile loggedFile)
Add a logged file tracking associated with that test case |
boolean
|
equals(Object obj)
|
long
|
getEndTime()
Return the |
FailureDescription
|
getFailure()
Get the associated |
|
getLoggedFiles()
Returns a copy of the map containing all the logged file associated with that test case. |
|
getMetrics()
Get the associated test metrics. |
|
getProtoMetrics()
Get the associated test metrics in proto format. |
TestStatus
|
getResultStatus()
Get the |
SkipReason
|
getSkipReason()
|
String
|
getStackTrace()
Get the associated |
long
|
getStartTime()
Return the |
TestResult.TestStatus
|
getStatus()
Get the |
int
|
hashCode()
|
static
TestResult
|
merge(
Merge the attempts for a same test case based on the merging strategy. |
void
|
setEndTime(long currentTimeMillis)
Sets the end time |
void
|
setFailure(FailureDescription failureDescription)
Set the stack trace. |
void
|
setMetrics(
Set the test metrics, overriding any previous values. |
void
|
setProtoMetrics(
Set the test proto metrics format, overriding any previous values. |
void
|
setSkipReason(SkipReason reason)
|
void
|
setStackTrace(String stackTrace)
Set the stack trace. |
void
|
setStartTime(long startTime)
Allows to set the time when the test was started, to be used with |
TestResult
|
setStatus(TestStatus status)
Set the |
TestResult
|
setStatus(TestResult.TestStatus ddmlibStatus)
|
Fields
IS_FLAKY
public static final String IS_FLAKY
Public constructors
TestResult
public TestResult ()
Public methods
addLoggedFile
public void addLoggedFile (String dataName, LogFile loggedFile)
Add a logged file tracking associated with that test case
Parameters | |
---|---|
dataName |
String |
loggedFile |
LogFile |
equals
public boolean equals (Object obj)
Parameters | |
---|---|
obj |
Object |
Returns | |
---|---|
boolean |
getEndTime
public long getEndTime ()
Return the System.currentTimeMillis()
time that the ERROR(/com.android.tradefed.result.ITestInvocationListener#testEnded(com.android.tradefed.result.TestDescription,Map))
event was received.
Returns | |
---|---|
long |
getFailure
public FailureDescription getFailure ()
Get the associated FailureDescription
. Should be null
if getStatus()
is TestStatus.PASSED
.
Returns | |
---|---|
FailureDescription |
getLoggedFiles
publicgetLoggedFiles ()
Returns a copy of the map containing all the logged file associated with that test case.
Returns | |
---|---|
|
getMetrics
publicgetMetrics ()
Get the associated test metrics.
Returns | |
---|---|
|
getProtoMetrics
publicgetProtoMetrics ()
Get the associated test metrics in proto format.
Returns | |
---|---|
|
getResultStatus
public TestStatus getResultStatus ()
Get the TestStatus
result of the test.
Returns | |
---|---|
TestStatus |
getStackTrace
public String getStackTrace ()
Get the associated String
stack trace. Should be null
if getStatus()
is TestStatus.PASSED
.
Returns | |
---|---|
String |
getStartTime
public long getStartTime ()
Return the System.currentTimeMillis()
time that the ITestLifeCycleReceiver.testStarted(com.android.tradefed.result.TestDescription)
event was received.
Returns | |
---|---|
long |
getStatus
public TestResult.TestStatus getStatus ()
Get the TestStatus
result of the test.
Returns | |
---|---|
TestResult.TestStatus |
hashCode
public int hashCode ()
Returns | |
---|---|
int |
merge
public static TestResult merge (results, MergeStrategy strategy)
Merge the attempts for a same test case based on the merging strategy.
Parameters | |
---|---|
results |
: List of TestResult that will be merged |
strategy |
MergeStrategy : the MergeStrategy to be used to determine the merging outcome. |
Returns | |
---|---|
TestResult |
the merged TestResult or null if there is nothing to merge. |
setEndTime
public void setEndTime (long currentTimeMillis)
Sets the end time
Parameters | |
---|---|
currentTimeMillis |
long |
setFailure
public void setFailure (FailureDescription failureDescription)
Set the stack trace.
Parameters | |
---|---|
failureDescription |
FailureDescription |
setMetrics
public void setMetrics (metrics)
Set the test metrics, overriding any previous values.
Parameters | |
---|---|
metrics |
|
setProtoMetrics
public void setProtoMetrics (metrics)
Set the test proto metrics format, overriding any previous values.
Parameters | |
---|---|
metrics |
|
setStackTrace
public void setStackTrace (String stackTrace)
Set the stack trace.
Parameters | |
---|---|
stackTrace |
String |
setStartTime
public void setStartTime (long startTime)
Allows to set the time when the test was started, to be used with ITestLifeCycleReceiver.testStarted(com.android.tradefed.result.TestDescription, long)
.
Parameters | |
---|---|
startTime |
long |
setStatus
public TestResult setStatus (TestStatus status)
Set the TestStatus
.
Parameters | |
---|---|
status |
TestStatus |
Returns | |
---|---|
TestResult |
setStatus
public TestResult setStatus (TestResult.TestStatus ddmlibStatus)
Parameters | |
---|---|
ddmlibStatus |
TestResult.TestStatus |
Returns | |
---|---|
TestResult |