github.com/meAmidos/gopactor (go): Package Gopactor provides a set of tools to simplify testing of actors created with Protoactor (https://github.com/AsynkronIT/protoactor-go).  Main features:  For any actor you want to test, Gopactor can intercept all it's inbound and outbound messages. It is probably exactly what you want to do when you test the actor's behavior. Moreover, interception forces a naturally asynchronous actor to act in a more synchronous way. When messages are sent and received under the control of Gopactor, it is much easier to reason about the actor's logic and examine its communication with the outside world step by step.  Protoactor uses special system messages to control the lifecycle of an actor. Gopactor can intercept some of such messages to help you ensure that your actor stops or restarts when expected.  It is a common pattern to let actors spawn child actors and communicate with them. Good as it is, this pattern often stays in the way of writing deterministic tests. Given that child-spawning and communication happen in the background asynchronously, it can be seen more like a side-effect that can interfere with your tests in many unpredictable ways.  By default, Gopactor intercepts all spawn invocations and instead of spawning what is requested, it spawns no-op null-actors. These actors are guaranteed to not communicate with their parents in any way. If you do no want Gopactor to substitute spawned actors, you can easily disable this behavior via configuration options.  Gopactor provides a bunch of assertion functions to be used with the popular testing framework Goconvey (http://goconvey.co/). For instance,  For every tested actor, you can define what you want to intercept: inbound, outbound or system messages. Or spawning of children. Or everything. Or nothing at all. You can also set a custom timeout:  Here is a short example. We'll define and test a simple worker actor that can do only one thing: respond "pong" when it receives "ping".
Keywords: actor-model|actors|akka|bdd|bdd-tests|go|goconvey|golang|protoactor|testing