=pro #3759 Changed to using non-deprecated ScalaTest Matchers

This commit is contained in:
Björn Antonsson 2013-12-17 14:25:56 +01:00
parent b8c7d7badd
commit 003609c9c5
246 changed files with 2822 additions and 2822 deletions

View file

@ -15,7 +15,7 @@ import akka.event.Logging
import scala.concurrent.Future
import akka.actor.{ ActorRef, ActorSystem }
import org.scalatest.{ BeforeAndAfterAll, WordSpec }
import org.scalatest.matchers.MustMatchers
import org.scalatest.Matchers
import akka.testkit._
import akka.util._
import scala.concurrent.duration._
@ -326,7 +326,7 @@ class ActorDocSpec extends AkkaSpec(Map("akka.loglevel" -> "INFO")) {
implicit val timeout = Timeout(5 seconds)
val future = myActor ? "hello"
//#using-implicit-timeout
Await.result(future, timeout.duration) must be("hello")
Await.result(future, timeout.duration) should be("hello")
}
@ -337,7 +337,7 @@ class ActorDocSpec extends AkkaSpec(Map("akka.loglevel" -> "INFO")) {
import akka.pattern.ask
val future = myActor.ask("hello")(5 seconds)
//#using-explicit-timeout
Await.result(future, 5 seconds) must be("hello")
Await.result(future, 5 seconds) should be("hello")
}
"using receiveTimeout" in {
@ -474,7 +474,7 @@ class ActorDocSpec extends AkkaSpec(Map("akka.loglevel" -> "INFO")) {
val b = system.actorOf(Props(classOf[Follower], this))
watch(b)
system.stop(a)
expectMsgType[akka.actor.Terminated].actor must be === b
expectMsgType[akka.actor.Terminated].actor should equal(b)
}
}
@ -536,12 +536,12 @@ class ActorDocSpec extends AkkaSpec(Map("akka.loglevel" -> "INFO")) {
implicit val me = testActor
actor ! 42
expectMsg(42)
lastSender must be === actor
lastSender should equal(actor)
actor ! me
expectMsg("reply")
lastSender.path.elements.mkString("/", "/", "") must be === "/user"
lastSender.path.elements.mkString("/", "/", "") should equal("/user")
expectMsg("reply")
lastSender.path.elements.mkString("/", "/", "") must be === "/user"
lastSender.path.elements.mkString("/", "/", "") should equal("/user")
}
"using ActorDSL outside of akka.actor package" in {

View file

@ -13,7 +13,7 @@ import scala.concurrent.duration._
//#imports1
import org.scalatest.{ BeforeAndAfterAll, WordSpec }
import org.scalatest.matchers.MustMatchers
import org.scalatest.Matchers
import akka.testkit._
class SchedulerDocSpec extends AkkaSpec(Map("akka.loglevel" -> "INFO")) {

View file

@ -8,7 +8,7 @@ import scala.concurrent.{ Promise, Future, Await }
import scala.concurrent.duration._
import akka.actor.{ ActorContext, TypedActor, TypedProps }
import org.scalatest.{ BeforeAndAfterAll, WordSpec }
import org.scalatest.matchers.MustMatchers
import org.scalatest.Matchers
import akka.testkit._
//Mr funny man avoids printing to stdout AND keeping docs alright
@ -124,11 +124,11 @@ class TypedActorDocSpec extends AkkaSpec(Map("akka.loglevel" -> "INFO")) {
//#typed-actor-call-strict
//#typed-actor-calls
Await.result(fSquare, 3 seconds) must be === 100
Await.result(fSquare, 3 seconds) should equal(100)
oSquare must be === Some(100)
oSquare should equal(Some(100))
iSquare must be === 100
iSquare should equal(100)
//#typed-actor-stop
TypedActor(system).stop(mySquarer)
@ -174,6 +174,6 @@ class TypedActorDocSpec extends AkkaSpec(Map("akka.loglevel" -> "INFO")) {
TypedActor(system).poisonPill(awesomeFooBar)
//#typed-actor-supercharge-usage
Await.result(f, 3 seconds) must be === "YES"
Await.result(f, 3 seconds) should equal("YES")
}
}