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

TestResult

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 functions

Boolean
equals(obj: Any!)
Long

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

(Mutable)Map<String!, String!>!

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
Unit
setEndTime(currentTimeMillis: Long)

Sets the end time

Unit
setMetrics(metrics: (Mutable)Map<String!, String!>!)

Set the test metrics, overriding any previous values.

Unit

Set the stack trace.

TestResult!

Set the TestStatus.

Public constructors

TestResult

TestResult()

Public functions

equals

fun equals(obj: Any!): Boolean

getEndTime

fun getEndTime(): Long

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

getMetrics

fun getMetrics(): (Mutable)Map<String!, String!>!

Get the associated test metrics.

getStackTrace

fun getStackTrace(): String!

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

getStartTime

fun getStartTime(): Long

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

getStatus

fun getStatus(): TestResult.TestStatus!

Get the TestStatus result of the test.

hashCode

fun hashCode(): Int

setEndTime

fun setEndTime(currentTimeMillis: Long): Unit

Sets the end time

setMetrics

fun setMetrics(metrics: (Mutable)Map<String!, String!>!): Unit

Set the test metrics, overriding any previous values.

setStackTrace

fun setStackTrace(trace: String!): Unit

Set the stack trace.

setStatus

fun setStatus(status: TestResult.TestStatus!): TestResult!

Set the TestStatus.