From a348025ccb0b76c547e98b5aee9af13a86d3e706 Mon Sep 17 00:00:00 2001 From: Roland Date: Sat, 16 Jul 2011 18:42:24 -0400 Subject: [PATCH] improve testing docs --- akka-docs/scala/testing.rst | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/akka-docs/scala/testing.rst b/akka-docs/scala/testing.rst index f3bb07c5bb..8b7b270bff 100644 --- a/akka-docs/scala/testing.rst +++ b/akka-docs/scala/testing.rst @@ -375,6 +375,19 @@ with message flows: This feature is useful e.g. when testing a logging system, where you want to ignore regular messages and are only interested in your specific ones. +Expecting Exceptions +-------------------- + +One case which is not handled by the :obj:`testActor` is if an exception is +thrown while processing the message sent to the actor under test. This can be +tested by using a :class:`Future` based invocation:: + + // assuming ScalaTest ShouldMatchers + + evaluating { + (someActor ? badOperation).await.get + } should produce [UnhandledMessageException] + .. _TestKit.within: Timing Assertions @@ -468,7 +481,7 @@ using a small example:: var dest1 : ActorRef = _ var dest2 : ActorRef = _ def receive = { - case (d1, d2) => + case (d1: ActorRef, d2: ActorRef) => dest1 = d1 dest2 = d2 case x =>