Skip to content

Commit

Permalink
#2812 - Fixing PatternSpec for gracefulStop by testing for juc.Timeo…
Browse files Browse the repository at this point in the history
…utException (common ancestor)
  • Loading branch information
viktorklang committed Dec 18, 2012
1 parent 6af4ddc commit 6ff9d69
Showing 1 changed file with 3 additions and 2 deletions.
Expand Up @@ -8,6 +8,7 @@ import language.postfixOps

import akka.testkit.AkkaSpec
import akka.actor.{ Props, Actor }
import java.util.concurrent.TimeoutException
import scala.concurrent.{ Future, Promise, Await }
import scala.concurrent.duration._

Expand Down Expand Up @@ -39,10 +40,10 @@ class PatternSpec extends AkkaSpec {
Await.ready(gracefulStop(target, 1 millis), 1 second)
}

"complete Future with AskTimeoutException when actor not terminated within timeout" in {
"complete Future with TimeoutException when actor not terminated within timeout" in {
val target = system.actorOf(Props[TargetActor])
target ! Work(250 millis)
intercept[AskTimeoutException] { Await.result(gracefulStop(target, 10 millis), 200 millis) }
intercept[TimeoutException] { Await.result(gracefulStop(target, 10 millis), 200 millis) }
}
}

Expand Down

0 comments on commit 6ff9d69

Please sign in to comment.