object TestClock extends Serializable
- Alphabetic
- By Inheritance
- TestClock
- Serializable
- Serializable
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Type Members
-
final
case class
Data(instant: Instant, sleeps: List[(Instant, Promise[Nothing, Unit])], timeZone: ZoneId) extends Product with Serializable
Datarepresents the state of theTestClock, including the clock time and time zone. -
final
case class
Sleep(duration: zio.Duration, promise: Promise[Nothing, Unit], fiberId: FiberId) extends Product with Serializable
Sleeprepresents the state of a scheduled effect, including the time the effect is scheduled to run, a promise that can be completed to resume execution of the effect, and the fiber executing the effect. - sealed abstract class SuspendedWarningData extends AnyRef
- final case class Test(clockState: Atomic[Data], live: Live, annotations: Annotations, warningState: Synchronized[WarningData], suspendedWarningState: Synchronized[SuspendedWarningData]) extends TestClock with TestClockPlatformSpecific with Product with Serializable
-
sealed abstract
class
WarningData extends AnyRef
WarningDatadescribes the state of the warning message that is displayed if a test is using time by is not advancing theTestClock.WarningDatadescribes the state of the warning message that is displayed if a test is using time by is not advancing theTestClock. The possible states areStartif a test has not used time,Pendingif a test has used time but has not adjusted theTestClock, andDoneif a test has adjusted theTestClockor the warning message has already been displayed.
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
adjust(duration: ⇒ zio.Duration)(implicit trace: Trace): UIO[Unit]
Accesses a
TestClockinstance in the environment and increments the time by the specified duration, running any actions scheduled for on or before the new time in order. - def adjustWith[R, E, A](duration: ⇒ zio.Duration)(zio: ZIO[R, E, A])(implicit trace: Trace): ZIO[R, E, A]
- val any: ZLayer[TestClock, Nothing, TestClock]
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
- val default: ZLayer[Live with Annotations, Nothing, TestClock]
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
def
live(data: Data)(implicit trace: Trace): ZLayer[Annotations with Live, Nothing, TestClock]
Constructs a new
Testobject that implements theTestClockinterface.Constructs a new
Testobject that implements theTestClockinterface. This can be useful for mixing in with implementations of other interfaces. -
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
def
save(implicit trace: Trace): UIO[UIO[Unit]]
Accesses a
TestClockinstance in the environment and saves the clock state in an effect which, when run, will restore theTestClockto the saved state. -
def
setTime(instant: ⇒ Instant)(implicit trace: Trace): UIO[Unit]
Accesses a
TestClockinstance in the environment and sets the clock time to the specifiedInstant, running any actions scheduled for on or before the new time in order. -
def
setTimeZone(zone: ⇒ ZoneId)(implicit trace: Trace): UIO[Unit]
Accesses a
TestClockinstance in the environment, setting the time zone to the specified time zone.Accesses a
TestClockinstance in the environment, setting the time zone to the specified time zone. The clock time in terms of nanoseconds since the epoch will not be altered and no scheduled actions will be run as a result of this effect. -
def
sleeps(implicit trace: Trace): UIO[List[Instant]]
Accesses a
TestClockinstance in the environment and returns a list of times that effects are scheduled to run. -
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
timeZone(implicit trace: Trace): UIO[ZoneId]
Accesses a
TestClockinstance in the environment and returns the current time zone. -
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
- object SuspendedWarningData
- object WarningData