Class

zio.test.environment.TestClock

Test

Related Doc: package TestClock

Permalink

final case class Test(clockState: Ref[Data], fiberState: FiberRef[FiberData], live: Live.Service, warningState: RefM[WarningData]) extends clock.Clock.Service with Service with Product with Serializable

Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Test
  2. Product
  3. Equals
  4. Service
  5. Restorable
  6. Service
  7. Serializable
  8. Serializable
  9. AnyRef
  10. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Test(clockState: Ref[Data], fiberState: FiberRef[FiberData], live: Live.Service, warningState: RefM[WarningData])

    Permalink

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. def adjust(duration: Duration): UIO[Unit]

    Permalink

    Increments the wall clock time by the specified duration.

    Increments the wall clock time by the specified duration. Any effects that were scheduled to occur on or before the new wall clock time will immediately be run.

    Definition Classes
    TestService
  5. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  6. val clockState: Ref[Data]

    Permalink
  7. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  8. def currentDateTime: UIO[OffsetDateTime]

    Permalink

    Returns the current fiber time as an OffsetDateTime.

    Returns the current fiber time as an OffsetDateTime.

    Definition Classes
    Test → Service
  9. def currentTime(unit: TimeUnit): UIO[Long]

    Permalink

    Returns the current fiber time in the specified time unit.

    Returns the current fiber time in the specified time unit.

    Definition Classes
    Test → Service
  10. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  11. val fiberState: FiberRef[FiberData]

    Permalink
  12. val fiberTime: UIO[Duration]

    Permalink

    Returns the current fiber time for this fiber.

    Returns the current fiber time for this fiber. The fiber time is backed by a FiberRef and is incremented for the duration each fiber is sleeping. When a fiber is joined the fiber time will be set to the maximum of the fiber time of the parent and child fibers. Thus, the fiber time reflects the duration of sleeping that has occurred for this fiber to reach its current state, properly reflecting forks and joins.

    for {
      _      <- TestClock.set(Duration.Infinity)
      _      <- ZIO.sleep(2.millis).zipPar(ZIO.sleep(1.millis))
      result <- TestClock.fiberTime
    } yield result.toNanos == 2000000L
    Definition Classes
    TestService
  13. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  14. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  15. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  16. val live: Live.Service

    Permalink
  17. val nanoTime: UIO[Long]

    Permalink

    Returns the current fiber time in nanoseconds.

    Returns the current fiber time in nanoseconds.

    Definition Classes
    Test → Service
  18. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  19. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  20. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  21. def runAll: UIO[Unit]

    Permalink

    Runs all scheduled effects.

    Runs all scheduled effects. After this any scheduled effects will be run immediately

    Definition Classes
    TestService
  22. val save: UIO[UIO[Unit]]

    Permalink

    Saves the TestClock's current state in an effect which, when run, will restore the TestClock state to the saved state

    Saves the TestClock's current state in an effect which, when run, will restore the TestClock state to the saved state

    Definition Classes
    TestRestorable
  23. def setDateTime(dateTime: OffsetDateTime): UIO[Unit]

    Permalink

    Sets the wall clock time to the specified OffsetDateTime.

    Sets the wall clock time to the specified OffsetDateTime. Any effects that were scheduled to occur on or before the new time will immediately be run.

    Definition Classes
    TestService
  24. def setTime(duration: Duration): UIO[Unit]

    Permalink

    Sets the wall clock time to the specified time in terms of duration since the epoch.

    Sets the wall clock time to the specified time in terms of duration since the epoch. Any effects that were scheduled to occur on or before the new time will immediately be run.

    Definition Classes
    TestService
  25. def setTimeZone(zone: ZoneId): UIO[Unit]

    Permalink

    Sets the time zone to the specified time zone.

    Sets the time zone to the specified time zone. The wall clock time in terms of nanoseconds since the epoch will not be adjusted and no scheduled effects will be run as a result of this method.

    Definition Classes
    TestService
  26. def sleep(duration: Duration): UIO[Unit]

    Permalink

    Semantically blocks the current fiber until the wall clock time is equal to or greater than the specified duration.

    Semantically blocks the current fiber until the wall clock time is equal to or greater than the specified duration. Once the wall clock time is adjusted to on or after the duration, the fiber will automatically be resumed.

    Definition Classes
    Test → Service
  27. lazy val sleeps: UIO[List[Duration]]

    Permalink

    Returns a list of the wall clock times at which all queued effects are scheduled to resume.

    Returns a list of the wall clock times at which all queued effects are scheduled to resume.

    Definition Classes
    TestService
  28. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  29. lazy val timeZone: UIO[ZoneId]

    Permalink

    Returns the time zone.

    Returns the time zone.

    Definition Classes
    TestService
  30. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  31. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  32. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  33. val warningState: RefM[WarningData]

    Permalink

Inherited from Product

Inherited from Equals

Inherited from Service

Inherited from Restorable

Inherited from clock.Clock.Service

Inherited from Serializable

Inherited from Serializable

Inherited from AnyRef

Inherited from Any

Ungrouped