kind of new to akka actors
but will like the know the use and differences between the TestKit , TastActorRef and TestProbe
as used in akka unit testing.
I have seen them used for unit testing akka systems but do not seem to understand the concept
tried searching the internet but looks like documentation is sparse.
Any brief explanation is welcomed.
thanks ll .
An Akka MessageDispatcher is what makes Akka Actors “tick”, it is the engine of the machine so to speak. All MessageDispatcher implementations are also an ExecutionContext , which means that they can be used to execute arbitrary code, for instance Future s .
Companion object ActorSystem An actor system is a hierarchical group of actors which share common configuration, e.g. dispatchers, deployments, remote capabilities and addresses. It is also the entry point for creating or looking up actors. There are several possibilities for creating actors (see akka.
Akka's approach to handling concurrency is based on the Actor Model. In an actor-based system, everything is an actor, in much the same way that everything is an object in object-oriented design.
Props is a configuration object using in creating an Actor; it is immutable, so it is thread-safe and fully shareable.
Your searching skills need some honing, I think:
http://doc.akka.io/docs/akka/snapshot/scala/testing.html
http://doc.akka.io/docs/akka/snapshot/java/testing.html
But in short:
TestKit can be used as base-class for your tests, it provides an internal actor which can receive replies and a host of assertion methods for these replies
TestProbe is a wrapped-up TestKit which you can inject into message flows
These two were about integration testing, the next is for unit testing:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With