TestCaseStartedEvent


class TestCaseStartedEvent : TestPlatformEvent


Represents the start of an individual test case. One TestCaseStartedEvent should always be emitted for each individual test case in a test run. However, there are a couple of test statuses that do not require an explicit TestCaseStartedEvent.

  • androidx.test.services.events.TestStatus.Status.IGNORED: The test was never started and will not be run.
  • androidx.test.services.events.TestStatus.Status.CANCELLED: The test was supposed to run, but this client encountered a state that required it to exit before the test could run.
See also
TestCaseFinishedEvent

to indicate the end of a test case

TestCaseErrorEvent

for reporting various errors encountered during a test run.

Summary

Public constructors

Creates a TestCaseStartedEvent from an Parcel.

TestCaseStartedEvent(testCase: TestCaseInfo, timeStamp: TimeStamp)

Creates a TestCaseStartedEvent.

Public functions

TestPlatformEvent.EventType!

The ITestPlatformEvent#send(TestPlatformEvent) service method receives an instance of the TestPlatformEvent base class, so the CREATOR factory in this class is being used to create the event instances, not the CREATOR of one of its derived instances.

Unit
writeToParcel(parcel: Parcel!, i: Int)

Public properties

TestCaseInfo

The test case that started.

TimeStamp

The time this test case started.

Public constructors

TestCaseStartedEvent

TestCaseStartedEvent(source: Parcel!)

Creates a TestCaseStartedEvent from an Parcel.

Parameters
source: Parcel!

Parcel to create the TestCaseStartedEvent from.

TestCaseStartedEvent

TestCaseStartedEvent(testCase: TestCaseInfo, timeStamp: TimeStamp)

Creates a TestCaseStartedEvent.

Parameters
testCase: TestCaseInfo

the test case that started.

timeStamp: TimeStamp

the time the test case began.

Public functions

instanceType

fun instanceType(): TestPlatformEvent.EventType!

The ITestPlatformEvent#send(TestPlatformEvent) service method receives an instance of the TestPlatformEvent base class, so the CREATOR factory in this class is being used to create the event instances, not the CREATOR of one of its derived instances.

Therefore the createFromParcel method first needs to read a String containing the EventType enum value of the correct derived type to instantiate. Derived classes should override this method to return the applicable event type.

Also note that this means only this base class provides a CREATOR, since the derived classes don't need one.

Returns
TestPlatformEvent.EventType!

the EventType of the final derived event class that extends this base class

writeToParcel

fun writeToParcel(parcel: Parcel!, i: Int): Unit

Public properties

testCase

val testCaseTestCaseInfo

The test case that started.

timeStamp

val timeStampTimeStamp

The time this test case started.