=pro #3759 Changed to using non-deprecated ScalaTest Matchers
This commit is contained in:
parent
b8c7d7badd
commit
003609c9c5
246 changed files with 2822 additions and 2822 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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")) {
|
||||
|
|
|
|||
|
|
@ -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")
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,20 +28,20 @@ class AgentDocSpec extends AkkaSpec {
|
|||
//#read-apply
|
||||
val result = agent()
|
||||
//#read-apply
|
||||
result must be === 0
|
||||
result should equal(0)
|
||||
}
|
||||
{
|
||||
//#read-get
|
||||
val result = agent.get
|
||||
//#read-get
|
||||
result must be === 0
|
||||
result should equal(0)
|
||||
}
|
||||
|
||||
{
|
||||
//#read-future
|
||||
val future = agent.future
|
||||
//#read-future
|
||||
Await.result(future, 5 seconds) must be === 0
|
||||
Await.result(future, 5 seconds) should equal(0)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -67,7 +67,7 @@ class AgentDocSpec extends AkkaSpec {
|
|||
agent sendOff longRunningOrBlockingFunction
|
||||
//#send-off
|
||||
|
||||
Await.result(agent.future, 5 seconds) must be === 16
|
||||
Await.result(agent.future, 5 seconds) should equal(16)
|
||||
}
|
||||
|
||||
"alter and alterOff" in {
|
||||
|
|
@ -91,7 +91,7 @@ class AgentDocSpec extends AkkaSpec {
|
|||
val f4: Future[Int] = agent alterOff longRunningOrBlockingFunction
|
||||
//#alter-off
|
||||
|
||||
Await.result(f4, 5 seconds) must be === 16
|
||||
Await.result(f4, 5 seconds) should equal(16)
|
||||
}
|
||||
|
||||
"transfer example" in {
|
||||
|
|
@ -120,9 +120,9 @@ class AgentDocSpec extends AkkaSpec {
|
|||
val toValue = to.future // -> 70
|
||||
//#transfer-example
|
||||
|
||||
Await.result(fromValue, 5 seconds) must be === 50
|
||||
Await.result(toValue, 5 seconds) must be === 70
|
||||
ok must be === true
|
||||
Await.result(fromValue, 5 seconds) should equal(50)
|
||||
Await.result(toValue, 5 seconds) should equal(70)
|
||||
ok should equal(true)
|
||||
}
|
||||
|
||||
"monadic example" in {
|
||||
|
|
@ -149,8 +149,8 @@ class AgentDocSpec extends AkkaSpec {
|
|||
} yield value1 + value2
|
||||
//#monadic-example
|
||||
|
||||
agent3() must be === 4
|
||||
agent4() must be === 4
|
||||
agent5() must be === 8
|
||||
agent3() should equal(4)
|
||||
agent4() should equal(4)
|
||||
agent5() should equal(8)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ package docs.dispatcher
|
|||
import language.postfixOps
|
||||
|
||||
import org.scalatest.{ BeforeAndAfterAll, WordSpec }
|
||||
import org.scalatest.matchers.MustMatchers
|
||||
import org.scalatest.Matchers
|
||||
import akka.testkit.AkkaSpec
|
||||
import akka.event.Logging
|
||||
import akka.event.LoggingAdapter
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ object MyUnboundedMailbox {
|
|||
|
||||
private final val queue = new ConcurrentLinkedQueue[Envelope]()
|
||||
|
||||
// these must be implemented; queue used as example
|
||||
// these should be implemented; queue used as example
|
||||
def enqueue(receiver: ActorRef, handle: Envelope): Unit =
|
||||
queue.offer(handle)
|
||||
def dequeue(): Envelope = queue.poll()
|
||||
|
|
|
|||
|
|
@ -77,7 +77,7 @@ class FutureDocSpec extends AkkaSpec {
|
|||
future pipeTo actor
|
||||
//#pipe-to
|
||||
|
||||
result must be("HELLO")
|
||||
result should be("HELLO")
|
||||
}
|
||||
|
||||
"demonstrate usage of mapTo" in {
|
||||
|
|
@ -90,7 +90,7 @@ class FutureDocSpec extends AkkaSpec {
|
|||
|
||||
val future: Future[String] = ask(actor, msg).mapTo[String]
|
||||
//#map-to
|
||||
Await.result(future, timeout.duration) must be("HELLO")
|
||||
Await.result(future, timeout.duration) should be("HELLO")
|
||||
}
|
||||
|
||||
"demonstrate usage of simple future eval" in {
|
||||
|
|
@ -104,7 +104,7 @@ class FutureDocSpec extends AkkaSpec {
|
|||
}
|
||||
future foreach println
|
||||
//#future-eval
|
||||
Await.result(future, 3 seconds) must be("HelloWorld")
|
||||
Await.result(future, 3 seconds) should be("HelloWorld")
|
||||
}
|
||||
|
||||
"demonstrate usage of map" in {
|
||||
|
|
@ -118,8 +118,8 @@ class FutureDocSpec extends AkkaSpec {
|
|||
f2 foreach println
|
||||
//#map
|
||||
val result = Await.result(f2, 3 seconds)
|
||||
result must be(10)
|
||||
f1.value must be(Some(Success("HelloWorld")))
|
||||
result should be(10)
|
||||
f1.value should be(Some(Success("HelloWorld")))
|
||||
}
|
||||
|
||||
"demonstrate wrong usage of nested map" in {
|
||||
|
|
@ -152,7 +152,7 @@ class FutureDocSpec extends AkkaSpec {
|
|||
f3 foreach println
|
||||
//#flat-map
|
||||
val result = Await.result(f3, 3 seconds)
|
||||
result must be(30)
|
||||
result should be(30)
|
||||
}
|
||||
|
||||
"demonstrate usage of filter" in {
|
||||
|
|
@ -170,9 +170,9 @@ class FutureDocSpec extends AkkaSpec {
|
|||
failedFilter foreach println
|
||||
//#filter
|
||||
val result = Await.result(future2, 3 seconds)
|
||||
result must be(4)
|
||||
result should be(4)
|
||||
val result2 = Await.result(failedFilter, 3 seconds)
|
||||
result2 must be(0) //Can only be 0 when there was a MatchError
|
||||
result2 should be(0) //Can only be 0 when there was a MatchError
|
||||
}
|
||||
|
||||
"demonstrate usage of for comprehension" in {
|
||||
|
|
@ -190,7 +190,7 @@ class FutureDocSpec extends AkkaSpec {
|
|||
f foreach println
|
||||
//#for-comprehension
|
||||
val result = Await.result(f, 3 seconds)
|
||||
result must be(24)
|
||||
result should be(24)
|
||||
}
|
||||
|
||||
"demonstrate wrong way of composing" in {
|
||||
|
|
@ -214,7 +214,7 @@ class FutureDocSpec extends AkkaSpec {
|
|||
|
||||
val result = Await.result(f3, 3 seconds).asInstanceOf[Int]
|
||||
//#composing-wrong
|
||||
result must be(3)
|
||||
result should be(3)
|
||||
}
|
||||
|
||||
"demonstrate composing" in {
|
||||
|
|
@ -240,7 +240,7 @@ class FutureDocSpec extends AkkaSpec {
|
|||
f3 foreach println
|
||||
//#composing
|
||||
val result = Await.result(f3, 3 seconds).asInstanceOf[Int]
|
||||
result must be(3)
|
||||
result should be(3)
|
||||
}
|
||||
|
||||
"demonstrate usage of sequence with actors" in {
|
||||
|
|
@ -257,7 +257,7 @@ class FutureDocSpec extends AkkaSpec {
|
|||
val oddSum = futureList.map(_.sum)
|
||||
oddSum foreach println
|
||||
//#sequence-ask
|
||||
Await.result(oddSum, 3 seconds).asInstanceOf[Int] must be(10000)
|
||||
Await.result(oddSum, 3 seconds).asInstanceOf[Int] should be(10000)
|
||||
}
|
||||
|
||||
"demonstrate usage of sequence" in {
|
||||
|
|
@ -266,7 +266,7 @@ class FutureDocSpec extends AkkaSpec {
|
|||
val oddSum = futureList.map(_.sum)
|
||||
oddSum foreach println
|
||||
//#sequence
|
||||
Await.result(oddSum, 3 seconds).asInstanceOf[Int] must be(10000)
|
||||
Await.result(oddSum, 3 seconds).asInstanceOf[Int] should be(10000)
|
||||
}
|
||||
|
||||
"demonstrate usage of traverse" in {
|
||||
|
|
@ -275,7 +275,7 @@ class FutureDocSpec extends AkkaSpec {
|
|||
val oddSum = futureList.map(_.sum)
|
||||
oddSum foreach println
|
||||
//#traverse
|
||||
Await.result(oddSum, 3 seconds).asInstanceOf[Int] must be(10000)
|
||||
Await.result(oddSum, 3 seconds).asInstanceOf[Int] should be(10000)
|
||||
}
|
||||
|
||||
"demonstrate usage of fold" in {
|
||||
|
|
@ -285,7 +285,7 @@ class FutureDocSpec extends AkkaSpec {
|
|||
val futureSum = Future.fold(futures)(0)(_ + _)
|
||||
futureSum foreach println
|
||||
//#fold
|
||||
Await.result(futureSum, 3 seconds) must be(1001000)
|
||||
Await.result(futureSum, 3 seconds) should be(1001000)
|
||||
}
|
||||
|
||||
"demonstrate usage of reduce" in {
|
||||
|
|
@ -295,7 +295,7 @@ class FutureDocSpec extends AkkaSpec {
|
|||
val futureSum = Future.reduce(futures)(_ + _)
|
||||
futureSum foreach println
|
||||
//#reduce
|
||||
Await.result(futureSum, 3 seconds) must be(1001000)
|
||||
Await.result(futureSum, 3 seconds) should be(1001000)
|
||||
}
|
||||
|
||||
"demonstrate usage of recover" in {
|
||||
|
|
@ -308,7 +308,7 @@ class FutureDocSpec extends AkkaSpec {
|
|||
}
|
||||
future foreach println
|
||||
//#recover
|
||||
Await.result(future, 3 seconds) must be(0)
|
||||
Await.result(future, 3 seconds) should be(0)
|
||||
}
|
||||
|
||||
"demonstrate usage of recoverWith" in {
|
||||
|
|
@ -323,7 +323,7 @@ class FutureDocSpec extends AkkaSpec {
|
|||
}
|
||||
future foreach println
|
||||
//#try-recover
|
||||
Await.result(future, 3 seconds) must be(0)
|
||||
Await.result(future, 3 seconds) should be(0)
|
||||
}
|
||||
|
||||
"demonstrate usage of zip" in {
|
||||
|
|
@ -333,7 +333,7 @@ class FutureDocSpec extends AkkaSpec {
|
|||
val future3 = future1 zip future2 map { case (a, b) => a + " " + b }
|
||||
future3 foreach println
|
||||
//#zip
|
||||
Await.result(future3, 3 seconds) must be("foo bar")
|
||||
Await.result(future3, 3 seconds) should be("foo bar")
|
||||
}
|
||||
|
||||
"demonstrate usage of andThen" in {
|
||||
|
|
@ -349,7 +349,7 @@ class FutureDocSpec extends AkkaSpec {
|
|||
}
|
||||
result foreach println
|
||||
//#and-then
|
||||
Await.result(result, 3 seconds) must be("foo bar")
|
||||
Await.result(result, 3 seconds) should be("foo bar")
|
||||
}
|
||||
|
||||
"demonstrate usage of fallbackTo" in {
|
||||
|
|
@ -360,7 +360,7 @@ class FutureDocSpec extends AkkaSpec {
|
|||
val future4 = future1 fallbackTo future2 fallbackTo future3
|
||||
future4 foreach println
|
||||
//#fallback-to
|
||||
Await.result(future4, 3 seconds) must be("foo")
|
||||
Await.result(future4, 3 seconds) should be("foo")
|
||||
}
|
||||
|
||||
"demonstrate usage of onSuccess & onFailure & onComplete" in {
|
||||
|
|
@ -372,7 +372,7 @@ class FutureDocSpec extends AkkaSpec {
|
|||
case x: String => println("Got some random string: " + x)
|
||||
}
|
||||
//#onSuccess
|
||||
Await.result(future, 3 seconds) must be("foo")
|
||||
Await.result(future, 3 seconds) should be("foo")
|
||||
}
|
||||
{
|
||||
val future = Future.failed[String](new IllegalStateException("OHNOES"))
|
||||
|
|
@ -395,7 +395,7 @@ class FutureDocSpec extends AkkaSpec {
|
|||
case Failure(failure) => doSomethingOnFailure(failure)
|
||||
}
|
||||
//#onComplete
|
||||
Await.result(future, 3 seconds) must be("foo")
|
||||
Await.result(future, 3 seconds) should be("foo")
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -411,9 +411,9 @@ class FutureDocSpec extends AkkaSpec {
|
|||
val theFuture = promise.future
|
||||
promise.success("hello")
|
||||
//#promise
|
||||
Await.result(future, 3 seconds) must be("Yay!")
|
||||
Await.result(future, 3 seconds) should be("Yay!")
|
||||
intercept[IllegalArgumentException] { Await.result(otherFuture, 3 seconds) }
|
||||
Await.result(theFuture, 3 seconds) must be("hello")
|
||||
Await.result(theFuture, 3 seconds) should be("hello")
|
||||
}
|
||||
|
||||
"demonstrate usage of pattern.after" in {
|
||||
|
|
|
|||
|
|
@ -120,11 +120,11 @@ class IODocSpec extends AkkaSpec {
|
|||
watch(client)
|
||||
|
||||
val c1, c2 = expectMsgType[Tcp.Connected]
|
||||
c1.localAddress must be(c2.remoteAddress)
|
||||
c2.localAddress must be(c1.remoteAddress)
|
||||
c1.localAddress should be(c2.remoteAddress)
|
||||
c2.localAddress should be(c1.remoteAddress)
|
||||
|
||||
client ! ByteString("hello")
|
||||
expectMsgType[ByteString].utf8String must be("hello")
|
||||
expectMsgType[ByteString].utf8String should be("hello")
|
||||
|
||||
client ! "close"
|
||||
expectMsg("connection closed")
|
||||
|
|
|
|||
|
|
@ -138,10 +138,10 @@ class PipelinesDocSpec extends AkkaSpec {
|
|||
|
||||
val encoded: (Iterable[Message], Iterable[ByteString]) = cmd(msg)
|
||||
//#build-pipeline
|
||||
encoded._1 must have size 0
|
||||
encoded._2 must have size 1
|
||||
encoded._1 should have size 0
|
||||
encoded._2 should have size 1
|
||||
|
||||
evt(encoded._2.head)._1 must be === Seq(msg)
|
||||
evt(encoded._2.head)._1 should equal(Seq(msg))
|
||||
}
|
||||
|
||||
"demonstrate Injector/Sink" in {
|
||||
|
|
@ -163,7 +163,7 @@ class PipelinesDocSpec extends AkkaSpec {
|
|||
val encoded = expectMsgType[Success[ByteString]].get
|
||||
|
||||
injector.injectEvent(encoded)
|
||||
expectMsgType[Try[Message]].get must be === msg
|
||||
expectMsgType[Try[Message]].get should equal(msg)
|
||||
}
|
||||
|
||||
"demonstrate management port and context" in {
|
||||
|
|
@ -174,7 +174,7 @@ class PipelinesDocSpec extends AkkaSpec {
|
|||
val encoded = expectMsgType[ByteString]
|
||||
proc ! encoded
|
||||
val decoded = expectMsgType[Message]
|
||||
decoded must be === msg
|
||||
decoded should equal(msg)
|
||||
|
||||
within(1.5.seconds, 3.seconds) {
|
||||
expectMsgType[Tick]
|
||||
|
|
|
|||
|
|
@ -37,9 +37,9 @@ class RemoteDeploymentDocSpec extends AkkaSpec("""
|
|||
val ref = system.actorOf(Props[SampleActor].
|
||||
withDeploy(Deploy(scope = RemoteScope(address))))
|
||||
//#deploy
|
||||
ref.path.address must be(address)
|
||||
ref.path.address should be(address)
|
||||
ref ! "test"
|
||||
expectMsgType[ActorRef].path.address must be(address)
|
||||
expectMsgType[ActorRef].path.address should be(address)
|
||||
}
|
||||
|
||||
"demonstrate address extractor" in {
|
||||
|
|
@ -47,7 +47,7 @@ class RemoteDeploymentDocSpec extends AkkaSpec("""
|
|||
val one = AddressFromURIString("akka.tcp://sys@host:1234")
|
||||
val two = Address("akka.tcp", "sys", "host", 1234) // this gives the same
|
||||
//#make-address
|
||||
one must be === two
|
||||
one should equal(two)
|
||||
}
|
||||
|
||||
"demonstrate sampleActor" in {
|
||||
|
|
|
|||
|
|
@ -102,15 +102,15 @@ class CustomRouterDocSpec extends AkkaSpec(CustomRouterDocSpec.config) with Impl
|
|||
val routees = for (n <- 1 to 7) yield TestRoutee(n)
|
||||
|
||||
val r1 = logic.select("msg", routees)
|
||||
r1.asInstanceOf[SeveralRoutees].routees must be(
|
||||
r1.asInstanceOf[SeveralRoutees].routees should be(
|
||||
Vector(TestRoutee(1), TestRoutee(2), TestRoutee(3)))
|
||||
|
||||
val r2 = logic.select("msg", routees)
|
||||
r2.asInstanceOf[SeveralRoutees].routees must be(
|
||||
r2.asInstanceOf[SeveralRoutees].routees should be(
|
||||
Vector(TestRoutee(4), TestRoutee(5), TestRoutee(6)))
|
||||
|
||||
val r3 = logic.select("msg", routees)
|
||||
r3.asInstanceOf[SeveralRoutees].routees must be(
|
||||
r3.asInstanceOf[SeveralRoutees].routees should be(
|
||||
Vector(TestRoutee(7), TestRoutee(1), TestRoutee(2)))
|
||||
//#unit-test-logic
|
||||
|
||||
|
|
|
|||
|
|
@ -375,7 +375,7 @@ class RouterDocSpec extends AkkaSpec(RouterDocSpec.config) with ImplicitSender {
|
|||
import akka.routing.Broadcast
|
||||
router ! Broadcast("Watch out for Davy Jones' locker")
|
||||
//#broadcastDavyJonesWarning
|
||||
receiveN(5, 5.seconds.dilated) must have length (5)
|
||||
receiveN(5, 5.seconds.dilated) should have length (5)
|
||||
}
|
||||
|
||||
"demonstrate PoisonPill" in {
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@ package docs.serialization {
|
|||
""")
|
||||
//#serialize-messages-config
|
||||
val a = ActorSystem("system", config)
|
||||
a.settings.SerializeAllMessages must be(true)
|
||||
a.settings.SerializeAllMessages should be(true)
|
||||
shutdown(a)
|
||||
}
|
||||
|
||||
|
|
@ -78,7 +78,7 @@ package docs.serialization {
|
|||
""")
|
||||
//#serialize-creators-config
|
||||
val a = ActorSystem("system", config)
|
||||
a.settings.SerializeAllCreators must be(true)
|
||||
a.settings.SerializeAllCreators should be(true)
|
||||
shutdown(a)
|
||||
}
|
||||
|
||||
|
|
@ -123,9 +123,9 @@ package docs.serialization {
|
|||
""")
|
||||
//#serialization-bindings-config
|
||||
val a = ActorSystem("system", config)
|
||||
SerializationExtension(a).serializerFor(classOf[String]).getClass must equal(classOf[JavaSerializer])
|
||||
SerializationExtension(a).serializerFor(classOf[Customer]).getClass must equal(classOf[JavaSerializer])
|
||||
SerializationExtension(a).serializerFor(classOf[java.lang.Boolean]).getClass must equal(classOf[MyOwnSerializer])
|
||||
SerializationExtension(a).serializerFor(classOf[String]).getClass should equal(classOf[JavaSerializer])
|
||||
SerializationExtension(a).serializerFor(classOf[Customer]).getClass should equal(classOf[JavaSerializer])
|
||||
SerializationExtension(a).serializerFor(classOf[java.lang.Boolean]).getClass should equal(classOf[MyOwnSerializer])
|
||||
shutdown(a)
|
||||
}
|
||||
|
||||
|
|
@ -149,7 +149,7 @@ package docs.serialization {
|
|||
val back = serializer.fromBinary(bytes, manifest = None)
|
||||
|
||||
// Voilá!
|
||||
back must equal(original)
|
||||
back should equal(original)
|
||||
|
||||
//#programmatic
|
||||
shutdown(system)
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ import akka.actor.Actor
|
|||
import akka.actor.Props
|
||||
import akka.testkit.TestKit
|
||||
import org.scalatest.WordSpecLike
|
||||
import org.scalatest.matchers.MustMatchers
|
||||
import org.scalatest.Matchers
|
||||
import org.scalatest.BeforeAndAfterAll
|
||||
import akka.testkit.ImplicitSender
|
||||
|
||||
|
|
@ -23,7 +23,7 @@ object MySpec {
|
|||
|
||||
//#implicit-sender
|
||||
class MySpec(_system: ActorSystem) extends TestKit(_system) with ImplicitSender
|
||||
with WordSpecLike with MustMatchers with BeforeAndAfterAll {
|
||||
with WordSpecLike with Matchers with BeforeAndAfterAll {
|
||||
//#implicit-sender
|
||||
|
||||
def this() = this(ActorSystem("MySpec"))
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ import scala.util.Random
|
|||
|
||||
import org.scalatest.BeforeAndAfterAll
|
||||
import org.scalatest.WordSpecLike
|
||||
import org.scalatest.matchers.ShouldMatchers
|
||||
import org.scalatest.Matchers
|
||||
|
||||
import com.typesafe.config.ConfigFactory
|
||||
|
||||
|
|
@ -31,7 +31,7 @@ class TestKitUsageSpec
|
|||
extends TestKit(ActorSystem("TestKitUsageSpec",
|
||||
ConfigFactory.parseString(TestKitUsageSpec.config)))
|
||||
with DefaultTimeout with ImplicitSender
|
||||
with WordSpecLike with ShouldMatchers with BeforeAndAfterAll {
|
||||
with WordSpecLike with Matchers with BeforeAndAfterAll {
|
||||
import TestKitUsageSpec._
|
||||
|
||||
val echoRef = system.actorOf(Props[EchoActor])
|
||||
|
|
|
|||
|
|
@ -131,7 +131,7 @@ class TestkitDocSpec extends AkkaSpec with DefaultTimeout with ImplicitSender {
|
|||
// hypothetical message stimulating a '42' answer
|
||||
val future = actorRef ? Say42
|
||||
val Success(result: Int) = future.value.get
|
||||
result must be(42)
|
||||
result should be(42)
|
||||
//#test-behavior
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue