final class ActorTestKit extends AnyRef
Java API: Test kit for asynchronous testing of typed actors.
Provides a typed actor system started on creation, that can be used for multiple test cases and is
shut down when shutdown
is called.
The actor system has a custom guardian that allows for spawning arbitrary actors using the spawn
methods.
Designed to work with any test framework, but framework glue code that calls shutdownTestKit
after all tests has
run needs to be provided by the user or with TestKitJunitResource.
Use TestKit.create
factories to construct manually or TestKitJunitResource to use together with JUnit tests
For synchronous testing of a Behavior
see BehaviorTestKit
- Source
- ActorTestKit.scala
- Alphabetic
- By Inheritance
- ActorTestKit
- AnyRef
- Any
- by any2stringadd
- by StringFormat
- by Ensuring
- by ArrowAssoc
- Hide All
- Show All
- Public
- All
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
def
+(other: String): String
- Implicit
- This member is added by an implicit conversion from ActorTestKit to any2stringadd[ActorTestKit] performed by method any2stringadd in scala.Predef.
- Definition Classes
- any2stringadd
-
def
->[B](y: B): (ActorTestKit, B)
- Implicit
- This member is added by an implicit conversion from ActorTestKit to ArrowAssoc[ActorTestKit] performed by method ArrowAssoc in scala.Predef.
- Definition Classes
- ArrowAssoc
- Annotations
- @inline()
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate() @throws( ... )
-
def
createTestProbe[M](name: String, clazz: Class[M]): TestProbe[M]
Shortcut for creating a new named test probe for the testkit actor system
Shortcut for creating a new named test probe for the testkit actor system
- M
the type of messages the probe should accept
-
def
createTestProbe[M](name: String): TestProbe[M]
Shortcut for creating a new named test probe for the testkit actor system
Shortcut for creating a new named test probe for the testkit actor system
- M
the type of messages the probe should accept
-
def
createTestProbe[M](clazz: Class[M]): TestProbe[M]
Shortcut for creating a new test probe for the testkit actor system
Shortcut for creating a new test probe for the testkit actor system
- M
the type of messages the probe should accept
-
def
createTestProbe[M](): TestProbe[M]
Shortcut for creating a new test probe for the testkit actor system
Shortcut for creating a new test probe for the testkit actor system
- M
the type of messages the probe should accept
-
def
ensuring(cond: (ActorTestKit) ⇒ Boolean, msg: ⇒ Any): ActorTestKit
- Implicit
- This member is added by an implicit conversion from ActorTestKit to Ensuring[ActorTestKit] performed by method Ensuring in scala.Predef.
- Definition Classes
- Ensuring
-
def
ensuring(cond: (ActorTestKit) ⇒ Boolean): ActorTestKit
- Implicit
- This member is added by an implicit conversion from ActorTestKit to Ensuring[ActorTestKit] performed by method Ensuring in scala.Predef.
- Definition Classes
- Ensuring
-
def
ensuring(cond: Boolean, msg: ⇒ Any): ActorTestKit
- Implicit
- This member is added by an implicit conversion from ActorTestKit to Ensuring[ActorTestKit] performed by method Ensuring in scala.Predef.
- Definition Classes
- Ensuring
-
def
ensuring(cond: Boolean): ActorTestKit
- Implicit
- This member is added by an implicit conversion from ActorTestKit to Ensuring[ActorTestKit] performed by method Ensuring in scala.Predef.
- Definition Classes
- Ensuring
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
formatted(fmtstr: String): String
- Implicit
- This member is added by an implicit conversion from ActorTestKit to StringFormat[ActorTestKit] performed by method StringFormat in scala.Predef.
- Definition Classes
- StringFormat
- Annotations
- @inline()
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
def
scheduler: Scheduler
The scheduler of the testkit actor system
-
def
shutdownTestKit(): Unit
Terminate the actor system and the testkit
-
def
spawn[T](behavior: Behavior[T], name: String, props: typed.Props): typed.ActorRef[T]
Spawn a new named actor under the testkit user guardian with the given props and return the ActorRef for the spawned actor, note that spawning actors with the same name in multiple test cases will cause failures.
-
def
spawn[T](behavior: Behavior[T], props: typed.Props): typed.ActorRef[T]
Spawn a new auto-named actor under the testkit user guardian with the given props and return the ActorRef for the spawned actor
-
def
spawn[T](behavior: Behavior[T], name: String): typed.ActorRef[T]
Spawn a new named actor under the testkit user guardian and return the ActorRef for the spawned actor, note that spawning actors with the same name in multiple test cases will cause failures.
-
def
spawn[T](behavior: Behavior[T]): typed.ActorRef[T]
Spawn a new auto-named actor under the testkit user guardian and return the ActorRef for the spawned actor
-
def
stop[T](ref: typed.ActorRef[T], max: Duration): Unit
Stop the actor under test and wait
max
until it terminates.Stop the actor under test and wait
max
until it terminates. It can only be used for actors that were spawned by thisActorTestKit
. Other actors will not be stopped by this method. -
def
stop[T](ref: typed.ActorRef[T]): Unit
Stop the actor under test and wait until it terminates.
Stop the actor under test and wait until it terminates. It can only be used for actors that were spawned by this
ActorTestKit
. Other actors will not be stopped by this method. -
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
system: typed.ActorSystem[Void]
The actor system running for this testkit.
The actor system running for this testkit. Interaction with the user guardian is done through methods on the testkit which is why it is typed to
Void
. - def testKitSettings: TestKitSettings
-
def
timeout: Timeout
The default timeout as specified with the config/akka.actor.testkit.typed.TestKitSettings
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
def
→[B](y: B): (ActorTestKit, B)
- Implicit
- This member is added by an implicit conversion from ActorTestKit to ArrowAssoc[ActorTestKit] performed by method ArrowAssoc in scala.Predef.
- Definition Classes
- ArrowAssoc