{% 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

@NonNull boolean
@NonNull long

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

@NonNull Map<@NonNull String, @NonNull String>

Get the associated test metrics.

@NonNull String

Get the associated String stack trace.

@NonNull long

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

@NonNull TestResult.TestStatus

Get the TestStatus result of the test.

@NonNull int
@NonNull void
setEndTime(@NonNull long currentTimeMillis)

Sets the end time

@NonNull void

Set the test metrics, overriding any previous values.

@NonNull void

Set the stack trace.

@NonNull TestResult

Set the TestStatus.

Public constructors

TestResult

public TestResult()

Public methods

equals

@NonNull
public boolean equals(@NonNull Object obj)

getEndTime

@NonNull
public long getEndTime()

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

getMetrics

@NonNull
public Map<@NonNull String, @NonNull StringgetMetrics()

Get the associated test metrics.

getStackTrace

@NonNull
public String getStackTrace()

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

getStartTime

@NonNull
public long getStartTime()

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

getStatus

@NonNull
public TestResult.TestStatus getStatus()

Get the TestStatus result of the test.

hashCode

@NonNull
public int hashCode()

setEndTime

@NonNull
public void setEndTime(@NonNull long currentTimeMillis)

Sets the end time

setMetrics

@NonNull
public void setMetrics(@NonNull Map<@NonNull String, @NonNull String> metrics)

Set the test metrics, overriding any previous values.

setStackTrace

@NonNull
public void setStackTrace(@NonNull String trace)

Set the stack trace.

setStatus

@NonNull
public TestResult setStatus(@NonNull TestResult.TestStatus status)

Set the TestStatus.