FakeLifecycleManager


class FakeLifecycleManager


Fake implementation of LifecycleManager used to validate state transitions.

Summary

Nested types

Set of possible states of the runtime.

Public companion properties

List<String>

Public constructors

FakeLifecycleManager(hasCreatePermission: Boolean)

Public functions

Unit

Allows an additional call to update to not be blocked.

open Unit
configure(config: Config)

Sets or changes the configuration to use, which will affect the availability of properties or features in other managers.

open Unit

Executes the runtime initialization logic.

open Unit

Pauses execution while retaining the state in memory.

open Unit

Resumes execution from a paused or init state.

open Unit

Stops the execution and releases all resources.

open suspend ComparableTimeMark

Retrieves the latest time mark.

Public properties

open Config

the current Config of the session

Boolean

if false, create will throw an exception during testing

Boolean

if true, configure will emulate the failure case for missing permissions

Boolean

if false, configure will throw an exception if the config enables plane tracking

FakeLifecycleManager.State

the current State of the runtime

TestTimeSource

the TestTimeSource used for this runtime

Public companion properties

TestPermissions

val TestPermissionsList<String>

Public constructors

FakeLifecycleManager

Added in 1.0.0-alpha12
FakeLifecycleManager(hasCreatePermission: Boolean = true)

Public functions

allowOneMoreCallToUpdate

Added in 1.0.0-alpha12
fun allowOneMoreCallToUpdate(): Unit

Allows an additional call to update to not be blocked.

Requires that update has been called exactly once before each call to this method. Failure to do so will result in an IllegalStateException.

configure

Added in 1.0.0-alpha12
open fun configure(config: Config): Unit

Sets or changes the configuration to use, which will affect the availability of properties or features in other managers. It is necessary to have called create before calling this method.

create

Added in 1.0.0-alpha12
open fun create(): Unit

Executes the runtime initialization logic. It is necessary to call resume after calling this method to start the runtime's execution logic.

pause

Added in 1.0.0-alpha12
open fun pause(): Unit

Pauses execution while retaining the state in memory.

resume

Added in 1.0.0-alpha12
open fun resume(): Unit

Resumes execution from a paused or init state. It is necessary to have called create before calling this method.

stop

Added in 1.0.0-alpha12
open fun stop(): Unit

Stops the execution and releases all resources. It is not valid to call any other method after calling stop. The runtime must not be resumed when this method is called.

update

open suspend fun update(): ComparableTimeMark

Retrieves the latest time mark.

The first call to this method will execute immediately. Subsequent calls will be blocked until allowOneMoreCallToUpdate is called.

Public properties

config

Added in 1.0.0-alpha12
open var configConfig

the current Config of the session

hasCreatePermission

Added in 1.0.0-alpha12
var hasCreatePermissionBoolean

if false, create will throw an exception during testing

hasMissingPermission

Added in 1.0.0-alpha12
var hasMissingPermissionBoolean

if true, configure will emulate the failure case for missing permissions

shouldSupportPlaneTracking

Added in 1.0.0-alpha12
var shouldSupportPlaneTrackingBoolean

if false, configure will throw an exception if the config enables plane tracking

state

Added in 1.0.0-alpha12
val stateFakeLifecycleManager.State

the current State of the runtime

timeSource

Added in 1.0.0-alpha12
val timeSourceTestTimeSource

the TestTimeSource used for this runtime