{% setvar book_path %}/reference/androidx/_book.yaml{% endsetvar %} {% include "_shared/_reference-head-tags.html" %}

TestResult

public class TestResult


Container for a result of a single test.

This is a copy of com.android.ddmlib.testrunner.TestResult.

Summary

Nested types

TestResult.TestStatus

Public constructors

Public methods

boolean
long

Return the System#currentTimeMillis() time that the testEnded event was received.

Map<StringString>

Get the associated test metrics.

String

Get the associated String stack trace.

long

Return the System#currentTimeMillis() time that the testStarted event was received.

TestResult.TestStatus

Get the TestStatus result of the test.

int
void
setEndTime(long currentTimeMillis)

Sets the end time

void

Set the test metrics, overriding any previous values.

void

Set the stack trace.

TestResult

Set the TestStatus.

Public constructors

TestResult

public TestResult()

Public methods

equals

public boolean equals(Object obj)

getEndTime

public long getEndTime()

Return the System#currentTimeMillis() time that the testEnded event was received.

getMetrics

public Map<StringStringgetMetrics()

Get the associated test metrics.

getStackTrace

public String getStackTrace()

Get the associated String stack trace. Should be null if getStatus is TestStatus#PASSED.

getStartTime

public long getStartTime()

Return the System#currentTimeMillis() time that the testStarted event was received.

getStatus

public TestResult.TestStatus getStatus()

Get the TestStatus result of the test.

hashCode

public int hashCode()

setEndTime

public void setEndTime(long currentTimeMillis)

Sets the end time

setMetrics

public void setMetrics(Map<StringString> metrics)

Set the test metrics, overriding any previous values.

setStackTrace

public void setStackTrace(String trace)

Set the stack trace.

setStatus

public TestResult setStatus(TestResult.TestStatus status)

Set the TestStatus.