diff --git a/akka-actor-tests/src/test/scala/akka/actor/ActorDSLSpec.scala b/akka-actor-tests/src/test/scala/akka/actor/ActorDSLSpec.scala index 1803d595c4..3bd53c83c3 100644 --- a/akka-actor-tests/src/test/scala/akka/actor/ActorDSLSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/actor/ActorDSLSpec.scala @@ -36,7 +36,7 @@ class ActorDSLSpec extends AkkaSpec { //#inbox implicit val i = inbox() echo ! "hello" - i.receive() should be("hello") + i.receive() should ===("hello") //#inbox } @@ -50,7 +50,7 @@ class ActorDSLSpec extends AkkaSpec { i watch target //#watch target ! PoisonPill - i receive 1.second should be(Terminated(target)(true, false)) + i receive 1.second should ===(Terminated(target)(true, false)) } "support queueing multiple queries" in { @@ -61,11 +61,11 @@ class ActorDSLSpec extends AkkaSpec { Future { Thread.sleep(100); i.select() { case "world" ⇒ 1 } } recover { case x ⇒ x }, Future { Thread.sleep(200); i.select() { case "hello" ⇒ 2 } } recover { case x ⇒ x })) Thread.sleep(1000) - res.isCompleted should be(false) + res.isCompleted should ===(false) i.receiver ! 42 i.receiver ! "hello" i.receiver ! "world" - Await.result(res, 5 second) should be(Seq(42, 1, 2)) + Await.result(res, 5 second) should ===(Seq(42, 1, 2)) } "support selective receives" in { @@ -75,8 +75,8 @@ class ActorDSLSpec extends AkkaSpec { val result = i.select() { case "world" ⇒ true } - result should be(true) - i.receive() should be("hello") + result should ===(true) + i.receive() should ===("hello") } "have a maximum queue size" in { @@ -92,7 +92,7 @@ class ActorDSLSpec extends AkkaSpec { i.receiver ! 42 expectNoMsg(1 second) val gotit = for (_ ← 1 to 1000) yield i.receive() - gotit should be((1 to 1000) map (_ ⇒ 0)) + gotit should ===((1 to 1000) map (_ ⇒ 0)) intercept[TimeoutException] { i.receive(1 second) } @@ -126,7 +126,7 @@ class ActorDSLSpec extends AkkaSpec { implicit val i = inbox() a ! "hello" - i.receive() should be("hi") + i.receive() should ===("hi") } "support becomeStacked" in { @@ -231,7 +231,7 @@ class ActorDSLSpec extends AkkaSpec { }) //#nested-actor expectMsg("hello from akka://ActorDSLSpec/user/fred/barney") - lastSender should be(a) + lastSender should ===(a) } "support Stash" in { diff --git a/akka-actor-tests/src/test/scala/akka/actor/ActorLookupSpec.scala b/akka-actor-tests/src/test/scala/akka/actor/ActorLookupSpec.scala index 92a9d09f3c..d5e96d60a7 100644 --- a/akka-actor-tests/src/test/scala/akka/actor/ActorLookupSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/actor/ActorLookupSpec.scala @@ -56,14 +56,14 @@ class ActorLookupSpec extends AkkaSpec with DefaultTimeout { "An ActorSystem" must { "find actors by looking up their path" in { - system.actorFor(c1.path) should be(c1) - system.actorFor(c2.path) should be(c2) - system.actorFor(c21.path) should be(c21) - system.actorFor(system / "c1") should be(c1) - system.actorFor(system / "c2") should be(c2) - system.actorFor(system / "c2" / "c21") should be(c21) - system.actorFor(system child "c2" child "c21") should be(c21) // test Java API - system.actorFor(system / Seq("c2", "c21")) should be(c21) + system.actorFor(c1.path) should ===(c1) + system.actorFor(c2.path) should ===(c2) + system.actorFor(c21.path) should ===(c21) + system.actorFor(system / "c1") should ===(c1) + system.actorFor(system / "c2") should ===(c2) + system.actorFor(system / "c2" / "c21") should ===(c21) + system.actorFor(system child "c2" child "c21") should ===(c21) // test Java API + system.actorFor(system / Seq("c2", "c21")) should ===(c21) import scala.collection.JavaConverters._ system.actorFor(system descendant Seq("c2", "c21").asJava) // test Java API @@ -71,9 +71,9 @@ class ActorLookupSpec extends AkkaSpec with DefaultTimeout { "find actors by looking up their string representation" in { // this is only true for local actor references - system.actorFor(c1.path.toString) should be(c1) - system.actorFor(c2.path.toString) should be(c2) - system.actorFor(c21.path.toString) should be(c21) + system.actorFor(c1.path.toString) should ===(c1) + system.actorFor(c2.path.toString) should ===(c2) + system.actorFor(c21.path.toString) should ===(c21) } "take actor incarnation into account when comparing actor references" in { @@ -90,8 +90,8 @@ class ActorLookupSpec extends AkkaSpec with DefaultTimeout { system.actorFor(a1.path.toString) should not be (a1) val a2 = system.actorOf(p, name) - a2.path should be(a1.path) - a2.path.toString should be(a1.path.toString) + a2.path should ===(a1.path) + a2.path.toString should ===(a1.path.toString) a2 should not be (a1) a2.toString should not be (a1.toString) @@ -101,45 +101,45 @@ class ActorLookupSpec extends AkkaSpec with DefaultTimeout { } "find actors by looking up their root-anchored relative path" in { - system.actorFor(c1.path.toStringWithoutAddress) should be(c1) - system.actorFor(c2.path.toStringWithoutAddress) should be(c2) - system.actorFor(c21.path.toStringWithoutAddress) should be(c21) + system.actorFor(c1.path.toStringWithoutAddress) should ===(c1) + system.actorFor(c2.path.toStringWithoutAddress) should ===(c2) + system.actorFor(c21.path.toStringWithoutAddress) should ===(c21) } "find actors by looking up their relative path" in { - system.actorFor(c1.path.elements.mkString("/")) should be(c1) - system.actorFor(c2.path.elements.mkString("/")) should be(c2) - system.actorFor(c21.path.elements.mkString("/")) should be(c21) + system.actorFor(c1.path.elements.mkString("/")) should ===(c1) + system.actorFor(c2.path.elements.mkString("/")) should ===(c2) + system.actorFor(c21.path.elements.mkString("/")) should ===(c21) } "find actors by looking up their path elements" in { - system.actorFor(c1.path.elements) should be(c1) - system.actorFor(c2.path.elements) should be(c2) - system.actorFor(c21.path.getElements) should be(c21) // test Java API + system.actorFor(c1.path.elements) should ===(c1) + system.actorFor(c2.path.elements) should ===(c2) + system.actorFor(c21.path.getElements) should ===(c21) // test Java API } "find system-generated actors" in { - system.actorFor("/user") should be(user) - system.actorFor("/deadLetters") should be(system.deadLetters) - system.actorFor("/system") should be(syst) - system.actorFor(syst.path) should be(syst) - system.actorFor(syst.path.toString) should be(syst) - system.actorFor("/") should be(root) - system.actorFor("..") should be(root) - system.actorFor(root.path) should be(root) - system.actorFor(root.path.toString) should be(root) - system.actorFor("user") should be(user) - system.actorFor("deadLetters") should be(system.deadLetters) - system.actorFor("system") should be(syst) - system.actorFor("user/") should be(user) - system.actorFor("deadLetters/") should be(system.deadLetters) - system.actorFor("system/") should be(syst) + system.actorFor("/user") should ===(user) + system.actorFor("/deadLetters") should ===(system.deadLetters) + system.actorFor("/system") should ===(syst) + system.actorFor(syst.path) should ===(syst) + system.actorFor(syst.path.toString) should ===(syst) + system.actorFor("/") should ===(root) + system.actorFor("..") should ===(root) + system.actorFor(root.path) should ===(root) + system.actorFor(root.path.toString) should ===(root) + system.actorFor("user") should ===(user) + system.actorFor("deadLetters") should ===(system.deadLetters) + system.actorFor("system") should ===(syst) + system.actorFor("user/") should ===(user) + system.actorFor("deadLetters/") should ===(system.deadLetters) + system.actorFor("system/") should ===(syst) } "return deadLetters or EmptyLocalActorRef, respectively, for non-existing paths" in { def check(lookup: ActorRef, result: ActorRef) = { - lookup.getClass should be(result.getClass) - lookup should be(result) + lookup.getClass should ===(result.getClass) + lookup should ===(result) } check(system.actorFor("a/b/c"), empty("a/b/c")) check(system.actorFor(""), system.deadLetters) @@ -153,17 +153,17 @@ class ActorLookupSpec extends AkkaSpec with DefaultTimeout { "find temporary actors" in { val f = c1 ? GetSender(testActor) val a = expectMsgType[ActorRef] - a.path.elements.head should be("temp") - system.actorFor(a.path) should be(a) - system.actorFor(a.path.toString) should be(a) - system.actorFor(a.path.elements) should be(a) - system.actorFor(a.path.toString + "/") should be(a) - system.actorFor(a.path.toString + "/hallo").isTerminated should be(true) - f.isCompleted should be(false) - a.isTerminated should be(false) + a.path.elements.head should ===("temp") + system.actorFor(a.path) should ===(a) + system.actorFor(a.path.toString) should ===(a) + system.actorFor(a.path.elements) should ===(a) + system.actorFor(a.path.toString + "/") should ===(a) + system.actorFor(a.path.toString + "/hallo").isTerminated should ===(true) + f.isCompleted should ===(false) + a.isTerminated should ===(false) a ! 42 - f.isCompleted should be(true) - Await.result(f, timeout.duration) should be(42) + f.isCompleted should ===(true) + Await.result(f, timeout.duration) should ===(42) // clean-up is run as onComplete callback, i.e. dispatched on another thread awaitCond(system.actorFor(a.path).isTerminated, 1 second) } @@ -176,7 +176,7 @@ class ActorLookupSpec extends AkkaSpec with DefaultTimeout { "find actors by looking up their path" in { def check(looker: ActorRef, pathOf: ActorRef, result: ActorRef) { - Await.result(looker ? LookupPath(pathOf.path), timeout.duration) should be(result) + Await.result(looker ? LookupPath(pathOf.path), timeout.duration) should ===(result) } for { looker ← all @@ -186,11 +186,11 @@ class ActorLookupSpec extends AkkaSpec with DefaultTimeout { "find actors by looking up their string representation" in { def check(looker: ActorRef, pathOf: ActorRef, result: ActorRef) { - Await.result(looker ? LookupString(pathOf.path.toString), timeout.duration) should be(result) + Await.result(looker ? LookupString(pathOf.path.toString), timeout.duration) should ===(result) // with uid - Await.result(looker ? LookupString(pathOf.path.toSerializationFormat), timeout.duration) should be(result) + Await.result(looker ? LookupString(pathOf.path.toSerializationFormat), timeout.duration) should ===(result) // with trailing / - Await.result(looker ? LookupString(pathOf.path.toString + "/"), timeout.duration) should be(result) + Await.result(looker ? LookupString(pathOf.path.toString + "/"), timeout.duration) should ===(result) } for { looker ← all @@ -200,8 +200,8 @@ class ActorLookupSpec extends AkkaSpec with DefaultTimeout { "find actors by looking up their root-anchored relative path" in { def check(looker: ActorRef, pathOf: ActorRef, result: ActorRef) { - Await.result(looker ? LookupString(pathOf.path.toStringWithoutAddress), timeout.duration) should be(result) - Await.result(looker ? LookupString(pathOf.path.elements.mkString("/", "/", "/")), timeout.duration) should be(result) + Await.result(looker ? LookupString(pathOf.path.toStringWithoutAddress), timeout.duration) should ===(result) + Await.result(looker ? LookupString(pathOf.path.elements.mkString("/", "/", "/")), timeout.duration) should ===(result) } for { looker ← all @@ -211,9 +211,9 @@ class ActorLookupSpec extends AkkaSpec with DefaultTimeout { "find actors by looking up their relative path" in { def check(looker: ActorRef, result: ActorRef, elems: String*) { - Await.result(looker ? LookupElems(elems), timeout.duration) should be(result) - Await.result(looker ? LookupString(elems mkString "/"), timeout.duration) should be(result) - Await.result(looker ? LookupString(elems mkString ("", "/", "/")), timeout.duration) should be(result) + Await.result(looker ? LookupElems(elems), timeout.duration) should ===(result) + Await.result(looker ? LookupString(elems mkString "/"), timeout.duration) should ===(result) + Await.result(looker ? LookupString(elems mkString ("", "/", "/")), timeout.duration) should ===(result) } check(c1, user, "..") for { @@ -228,11 +228,11 @@ class ActorLookupSpec extends AkkaSpec with DefaultTimeout { "find system-generated actors" in { def check(target: ActorRef) { for (looker ← all) { - Await.result(looker ? LookupPath(target.path), timeout.duration) should be(target) - Await.result(looker ? LookupString(target.path.toString), timeout.duration) should be(target) - Await.result(looker ? LookupString(target.path.toString + "/"), timeout.duration) should be(target) - Await.result(looker ? LookupString(target.path.toStringWithoutAddress), timeout.duration) should be(target) - if (target != root) Await.result(looker ? LookupString(target.path.elements.mkString("/", "/", "/")), timeout.duration) should be(target) + Await.result(looker ? LookupPath(target.path), timeout.duration) should ===(target) + Await.result(looker ? LookupString(target.path.toString), timeout.duration) should ===(target) + Await.result(looker ? LookupString(target.path.toString + "/"), timeout.duration) should ===(target) + Await.result(looker ? LookupString(target.path.toStringWithoutAddress), timeout.duration) should ===(target) + if (target != root) Await.result(looker ? LookupString(target.path.elements.mkString("/", "/", "/")), timeout.duration) should ===(target) } } for (target ← Seq(root, syst, user, system.deadLetters)) check(target) @@ -244,7 +244,7 @@ class ActorLookupSpec extends AkkaSpec with DefaultTimeout { def checkOne(looker: ActorRef, query: Query, result: ActorRef) { val lookup = Await.result(looker ? query, timeout.duration) lookup.getClass should be(result.getClass) - lookup should be(result) + lookup should ===(result) } def check(looker: ActorRef) { val lookname = looker.path.elements.mkString("", "/", "/") @@ -266,21 +266,21 @@ class ActorLookupSpec extends AkkaSpec with DefaultTimeout { "find temporary actors" in { val f = c1 ? GetSender(testActor) val a = expectMsgType[ActorRef] - a.path.elements.head should be("temp") - Await.result(c2 ? LookupPath(a.path), timeout.duration) should be(a) - Await.result(c2 ? LookupString(a.path.toString), timeout.duration) should be(a) - Await.result(c2 ? LookupString(a.path.toStringWithoutAddress), timeout.duration) should be(a) - Await.result(c2 ? LookupString("../../" + a.path.elements.mkString("/")), timeout.duration) should be(a) - Await.result(c2 ? LookupString(a.path.toString + "/"), timeout.duration) should be(a) - Await.result(c2 ? LookupString(a.path.toStringWithoutAddress + "/"), timeout.duration) should be(a) - Await.result(c2 ? LookupString("../../" + a.path.elements.mkString("/") + "/"), timeout.duration) should be(a) - Await.result(c2 ? LookupElems(Seq("..", "..") ++ a.path.elements), timeout.duration) should be(a) - Await.result(c2 ? LookupElems(Seq("..", "..") ++ a.path.elements :+ ""), timeout.duration) should be(a) - f.isCompleted should be(false) - a.isTerminated should be(false) + a.path.elements.head should ===("temp") + Await.result(c2 ? LookupPath(a.path), timeout.duration) should ===(a) + Await.result(c2 ? LookupString(a.path.toString), timeout.duration) should ===(a) + Await.result(c2 ? LookupString(a.path.toStringWithoutAddress), timeout.duration) should ===(a) + Await.result(c2 ? LookupString("../../" + a.path.elements.mkString("/")), timeout.duration) should ===(a) + Await.result(c2 ? LookupString(a.path.toString + "/"), timeout.duration) should ===(a) + Await.result(c2 ? LookupString(a.path.toStringWithoutAddress + "/"), timeout.duration) should ===(a) + Await.result(c2 ? LookupString("../../" + a.path.elements.mkString("/") + "/"), timeout.duration) should ===(a) + Await.result(c2 ? LookupElems(Seq("..", "..") ++ a.path.elements), timeout.duration) should ===(a) + Await.result(c2 ? LookupElems(Seq("..", "..") ++ a.path.elements :+ ""), timeout.duration) should ===(a) + f.isCompleted should ===(false) + a.isTerminated should ===(false) a ! 42 - f.isCompleted should be(true) - Await.result(f, timeout.duration) should be(42) + f.isCompleted should ===(true) + Await.result(f, timeout.duration) should ===(42) // clean-up is run as onComplete callback, i.e. dispatched on another thread awaitCond(Await.result(c2 ? LookupPath(a.path), timeout.duration).asInstanceOf[ActorRef].isTerminated, 1 second) } diff --git a/akka-actor-tests/src/test/scala/akka/actor/ActorMailboxSpec.scala b/akka-actor-tests/src/test/scala/akka/actor/ActorMailboxSpec.scala index 27c23dd796..c2ced1b58e 100644 --- a/akka-actor-tests/src/test/scala/akka/actor/ActorMailboxSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/actor/ActorMailboxSpec.scala @@ -255,7 +255,7 @@ class ActorMailboxSpec(conf: Config) extends AkkaSpec(conf) with DefaultTimeout "get a bounded message queue with 0 push timeout when defined in dispatcher" in { val q = checkMailboxQueue(Props[QueueReportingActor], "default-bounded-mailbox-with-zero-pushtimeout", BoundedMailboxTypes) - q.asInstanceOf[BoundedMessageQueueSemantics].pushTimeOut should be(Duration.Zero) + q.asInstanceOf[BoundedMessageQueueSemantics].pushTimeOut should ===(Duration.Zero) } "get an unbounded message queue when it's configured as mailbox overriding bounded in dispatcher" in { diff --git a/akka-actor-tests/src/test/scala/akka/actor/ActorPathSpec.scala b/akka-actor-tests/src/test/scala/akka/actor/ActorPathSpec.scala index 52caeba3af..80430e6ee0 100644 --- a/akka-actor-tests/src/test/scala/akka/actor/ActorPathSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/actor/ActorPathSpec.scala @@ -14,12 +14,12 @@ class ActorPathSpec extends WordSpec with Matchers { "support parsing its String rep" in { val path = RootActorPath(Address("akka.tcp", "mysys")) / "user" - ActorPath.fromString(path.toString) should be(path) + ActorPath.fromString(path.toString) should ===(path) } "support parsing remote paths" in { val remote = "akka://my_sys@host:1234/some/ref" - ActorPath.fromString(remote).toString should be(remote) + ActorPath.fromString(remote).toString should ===(remote) } "throw exception upon malformed paths" in { @@ -32,22 +32,22 @@ class ActorPathSpec extends WordSpec with Matchers { "create correct toString" in { val a = Address("akka.tcp", "mysys") - RootActorPath(a).toString should be("akka.tcp://mysys/") - (RootActorPath(a) / "user").toString should be("akka.tcp://mysys/user") - (RootActorPath(a) / "user" / "foo").toString should be("akka.tcp://mysys/user/foo") - (RootActorPath(a) / "user" / "foo" / "bar").toString should be("akka.tcp://mysys/user/foo/bar") + RootActorPath(a).toString should ===("akka.tcp://mysys/") + (RootActorPath(a) / "user").toString should ===("akka.tcp://mysys/user") + (RootActorPath(a) / "user" / "foo").toString should ===("akka.tcp://mysys/user/foo") + (RootActorPath(a) / "user" / "foo" / "bar").toString should ===("akka.tcp://mysys/user/foo/bar") } "have correct path elements" in { - (RootActorPath(Address("akka.tcp", "mysys")) / "user" / "foo" / "bar").elements.toSeq should be(Seq("user", "foo", "bar")) + (RootActorPath(Address("akka.tcp", "mysys")) / "user" / "foo" / "bar").elements.toSeq should ===(Seq("user", "foo", "bar")) } "create correct toStringWithoutAddress" in { val a = Address("akka.tcp", "mysys") - RootActorPath(a).toStringWithoutAddress should be("/") - (RootActorPath(a) / "user").toStringWithoutAddress should be("/user") - (RootActorPath(a) / "user" / "foo").toStringWithoutAddress should be("/user/foo") - (RootActorPath(a) / "user" / "foo" / "bar").toStringWithoutAddress should be("/user/foo/bar") + RootActorPath(a).toStringWithoutAddress should ===("/") + (RootActorPath(a) / "user").toStringWithoutAddress should ===("/user") + (RootActorPath(a) / "user" / "foo").toStringWithoutAddress should ===("/user/foo") + (RootActorPath(a) / "user" / "foo" / "bar").toStringWithoutAddress should ===("/user/foo/bar") } "create correct toStringWithAddress" in { @@ -56,22 +56,22 @@ class ActorPathSpec extends WordSpec with Matchers { val b = a.copy(host = Some("bb")) val c = a.copy(host = Some("cccc")) val root = RootActorPath(local) - root.toStringWithAddress(a) should be("akka.tcp://mysys@aaa:2552/") - (root / "user").toStringWithAddress(a) should be("akka.tcp://mysys@aaa:2552/user") - (root / "user" / "foo").toStringWithAddress(a) should be("akka.tcp://mysys@aaa:2552/user/foo") + root.toStringWithAddress(a) should ===("akka.tcp://mysys@aaa:2552/") + (root / "user").toStringWithAddress(a) should ===("akka.tcp://mysys@aaa:2552/user") + (root / "user" / "foo").toStringWithAddress(a) should ===("akka.tcp://mysys@aaa:2552/user/foo") - // root.toStringWithAddress(b) should be("akka.tcp://mysys@bb:2552/") - (root / "user").toStringWithAddress(b) should be("akka.tcp://mysys@bb:2552/user") - (root / "user" / "foo").toStringWithAddress(b) should be("akka.tcp://mysys@bb:2552/user/foo") + // root.toStringWithAddress(b) should ===("akka.tcp://mysys@bb:2552/") + (root / "user").toStringWithAddress(b) should ===("akka.tcp://mysys@bb:2552/user") + (root / "user" / "foo").toStringWithAddress(b) should ===("akka.tcp://mysys@bb:2552/user/foo") - root.toStringWithAddress(c) should be("akka.tcp://mysys@cccc:2552/") - (root / "user").toStringWithAddress(c) should be("akka.tcp://mysys@cccc:2552/user") - (root / "user" / "foo").toStringWithAddress(c) should be("akka.tcp://mysys@cccc:2552/user/foo") + root.toStringWithAddress(c) should ===("akka.tcp://mysys@cccc:2552/") + (root / "user").toStringWithAddress(c) should ===("akka.tcp://mysys@cccc:2552/user") + (root / "user" / "foo").toStringWithAddress(c) should ===("akka.tcp://mysys@cccc:2552/user/foo") val rootA = RootActorPath(a) - rootA.toStringWithAddress(b) should be("akka.tcp://mysys@aaa:2552/") - (rootA / "user").toStringWithAddress(b) should be("akka.tcp://mysys@aaa:2552/user") - (rootA / "user" / "foo").toStringWithAddress(b) should be("akka.tcp://mysys@aaa:2552/user/foo") + rootA.toStringWithAddress(b) should ===("akka.tcp://mysys@aaa:2552/") + (rootA / "user").toStringWithAddress(b) should ===("akka.tcp://mysys@aaa:2552/user") + (rootA / "user" / "foo").toStringWithAddress(b) should ===("akka.tcp://mysys@aaa:2552/user/foo") } } } diff --git a/akka-actor-tests/src/test/scala/akka/actor/ActorRefSpec.scala b/akka-actor-tests/src/test/scala/akka/actor/ActorRefSpec.scala index 73b8ac5150..ef8b265097 100644 --- a/akka-actor-tests/src/test/scala/akka/actor/ActorRefSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/actor/ActorRefSpec.scala @@ -139,7 +139,7 @@ class ActorRefSpec extends AkkaSpec with DefaultTimeout { new Actor { def receive = { case _ ⇒ } } } - def contextStackMustBeEmpty(): Unit = ActorCell.contextStack.get.headOption should be(None) + def contextStackMustBeEmpty(): Unit = ActorCell.contextStack.get.headOption should ===(None) EventFilter[ActorInitializationException](occurrences = 1) intercept { intercept[akka.actor.ActorInitializationException] { @@ -249,7 +249,7 @@ class ActorRefSpec extends AkkaSpec with DefaultTimeout { (intercept[java.lang.IllegalStateException] { wrap(result ⇒ actorOf(Props(new OuterActor(actorOf(Props(promiseIntercept({ throw new IllegalStateException("Ur state be b0rked"); new InnerActor })(result))))))) - }).getMessage should be("Ur state be b0rked") + }).getMessage should ===("Ur state be b0rked") contextStackMustBeEmpty() } @@ -275,15 +275,15 @@ class ActorRefSpec extends AkkaSpec with DefaultTimeout { val in = new ObjectInputStream(new ByteArrayInputStream(bytes)) val readA = in.readObject - a.isInstanceOf[ActorRefWithCell] should be(true) - readA.isInstanceOf[ActorRefWithCell] should be(true) - (readA eq a) should be(true) + a.isInstanceOf[ActorRefWithCell] should ===(true) + readA.isInstanceOf[ActorRefWithCell] should ===(true) + (readA eq a) should ===(true) } val ser = new JavaSerializer(esys) val readA = ser.fromBinary(bytes, None) - readA.isInstanceOf[ActorRefWithCell] should be(true) - (readA eq a) should be(true) + readA.isInstanceOf[ActorRefWithCell] should ===(true) + (readA eq a) should ===(true) } "throw an exception on deserialize if no system in scope" in { @@ -303,7 +303,7 @@ class ActorRefSpec extends AkkaSpec with DefaultTimeout { (intercept[java.lang.IllegalStateException] { in.readObject - }).getMessage should be("Trying to deserialize a serialized ActorRef without an ActorSystem in scope." + + }).getMessage should ===("Trying to deserialize a serialized ActorRef without an ActorSystem in scope." + " Use 'akka.serialization.Serialization.currentSystem.withValue(system) { ... }'") } @@ -328,7 +328,7 @@ class ActorRefSpec extends AkkaSpec with DefaultTimeout { JavaSerializer.currentSystem.withValue(sysImpl) { val in = new ObjectInputStream(new ByteArrayInputStream(baos.toByteArray)) - in.readObject should be(new EmptyLocalActorRef(sysImpl.provider, ref.path, system.eventStream)) + in.readObject should ===(new EmptyLocalActorRef(sysImpl.provider, ref.path, system.eventStream)) } } @@ -341,18 +341,18 @@ class ActorRefSpec extends AkkaSpec with DefaultTimeout { val nested = Await.result((a ? "any").mapTo[ActorRef], timeout.duration) a should not be null nested should not be null - (a ne nested) should be(true) + (a ne nested) should ===(true) } "support advanced nested actorOfs" in { val a = system.actorOf(Props(new OuterActor(system.actorOf(Props(new InnerActor))))) val inner = Await.result(a ? "innerself", timeout.duration) - Await.result(a ? a, timeout.duration) should be(a) - Await.result(a ? "self", timeout.duration) should be(a) + Await.result(a ? a, timeout.duration) should ===(a) + Await.result(a ? "self", timeout.duration) should ===(a) inner should not be a - Await.result(a ? "msg", timeout.duration) should be("msg") + Await.result(a ? "msg", timeout.duration) should ===("msg") } "support reply via sender" in { @@ -400,8 +400,8 @@ class ActorRefSpec extends AkkaSpec with DefaultTimeout { val fnull = (ref.ask(0)(timeout)).mapTo[String] ref ! PoisonPill - Await.result(ffive, timeout.duration) should be("five") - Await.result(fnull, timeout.duration) should be("null") + Await.result(ffive, timeout.duration) should ===("five") + Await.result(fnull, timeout.duration) should ===("null") verifyActorTermination(ref) } diff --git a/akka-actor-tests/src/test/scala/akka/actor/ActorSelectionSpec.scala b/akka-actor-tests/src/test/scala/akka/actor/ActorSelectionSpec.scala index e8f27fbabd..5a9708d581 100644 --- a/akka-actor-tests/src/test/scala/akka/actor/ActorSelectionSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/actor/ActorSelectionSpec.scala @@ -62,13 +62,13 @@ class ActorSelectionSpec extends AkkaSpec("akka.loglevel=DEBUG") with DefaultTim case ActorIdentity(`selection`, ref) ⇒ ref } val asked = Await.result((selection ? Identify(selection)).mapTo[ActorIdentity], timeout.duration) - asked.ref should be(result) - asked.correlationId should be(selection) + asked.ref should ===(result) + asked.correlationId should ===(selection) implicit val ec = system.dispatcher val resolved = Await.result(selection.resolveOne(timeout.duration).mapTo[ActorRef] recover { case _ ⇒ null }, timeout.duration) - Option(resolved) should be(result) + Option(resolved) should ===(result) result } @@ -86,27 +86,27 @@ class ActorSelectionSpec extends AkkaSpec("akka.loglevel=DEBUG") with DefaultTim "An ActorSystem" must { "select actors by their path" in { - identify(c1.path) should be(Some(c1)) - identify(c2.path) should be(Some(c2)) - identify(c21.path) should be(Some(c21)) - identify(system / "c1") should be(Some(c1)) - identify(system / "c2") should be(Some(c2)) - identify(system / "c2" / "c21") should be(Some(c21)) - identify(system child "c2" child "c21") should be(Some(c21)) // test Java API - identify(system / Seq("c2", "c21")) should be(Some(c21)) + identify(c1.path) should ===(Some(c1)) + identify(c2.path) should ===(Some(c2)) + identify(c21.path) should ===(Some(c21)) + identify(system / "c1") should ===(Some(c1)) + identify(system / "c2") should ===(Some(c2)) + identify(system / "c2" / "c21") should ===(Some(c21)) + identify(system child "c2" child "c21") should ===(Some(c21)) // test Java API + identify(system / Seq("c2", "c21")) should ===(Some(c21)) import scala.collection.JavaConverters._ identify(system descendant Seq("c2", "c21").asJava) // test Java API } "select actors by their string path representation" in { - identify(c1.path.toString) should be(Some(c1)) - identify(c2.path.toString) should be(Some(c2)) - identify(c21.path.toString) should be(Some(c21)) + identify(c1.path.toString) should ===(Some(c1)) + identify(c2.path.toString) should ===(Some(c2)) + identify(c21.path.toString) should ===(Some(c21)) - identify(c1.path.toStringWithoutAddress) should be(Some(c1)) - identify(c2.path.toStringWithoutAddress) should be(Some(c2)) - identify(c21.path.toStringWithoutAddress) should be(Some(c21)) + identify(c1.path.toStringWithoutAddress) should ===(Some(c1)) + identify(c2.path.toStringWithoutAddress) should ===(Some(c2)) + identify(c21.path.toStringWithoutAddress) should ===(Some(c21)) } "take actor incarnation into account when comparing actor references" in { @@ -114,61 +114,61 @@ class ActorSelectionSpec extends AkkaSpec("akka.loglevel=DEBUG") with DefaultTim val a1 = system.actorOf(p, name) watch(a1) a1 ! PoisonPill - expectMsgType[Terminated].actor should be(a1) + expectMsgType[Terminated].actor should ===(a1) // not equal because it's terminated - identify(a1.path) should be(None) + identify(a1.path) should ===(None) val a2 = system.actorOf(p, name) - a2.path should be(a1.path) - a2.path.toString should be(a1.path.toString) + a2.path should ===(a1.path) + a2.path.toString should ===(a1.path.toString) a2 should not be (a1) a2.toString should not be (a1.toString) watch(a2) a2 ! PoisonPill - expectMsgType[Terminated].actor should be(a2) + expectMsgType[Terminated].actor should ===(a2) } "select actors by their root-anchored relative path" in { - identify(c1.path.toStringWithoutAddress) should be(Some(c1)) - identify(c2.path.toStringWithoutAddress) should be(Some(c2)) - identify(c21.path.toStringWithoutAddress) should be(Some(c21)) + identify(c1.path.toStringWithoutAddress) should ===(Some(c1)) + identify(c2.path.toStringWithoutAddress) should ===(Some(c2)) + identify(c21.path.toStringWithoutAddress) should ===(Some(c21)) } "select actors by their relative path" in { - identify(c1.path.elements.mkString("/")) should be(Some(c1)) - identify(c2.path.elements.mkString("/")) should be(Some(c2)) - identify(c21.path.elements.mkString("/")) should be(Some(c21)) + identify(c1.path.elements.mkString("/")) should ===(Some(c1)) + identify(c2.path.elements.mkString("/")) should ===(Some(c2)) + identify(c21.path.elements.mkString("/")) should ===(Some(c21)) } "select system-generated actors" in { - identify("/user") should be(Some(user)) - identify("/system") should be(Some(syst)) - identify(syst.path) should be(Some(syst)) - identify(syst.path.toStringWithoutAddress) should be(Some(syst)) - identify("/") should be(Some(root)) - identify("") should be(Some(root)) - identify(RootActorPath(root.path.address)) should be(Some(root)) - identify("..") should be(Some(root)) - identify(root.path) should be(Some(root)) - identify(root.path.toStringWithoutAddress) should be(Some(root)) - identify("user") should be(Some(user)) - identify("system") should be(Some(syst)) - identify("user/") should be(Some(user)) - identify("system/") should be(Some(syst)) + identify("/user") should ===(Some(user)) + identify("/system") should ===(Some(syst)) + identify(syst.path) should ===(Some(syst)) + identify(syst.path.toStringWithoutAddress) should ===(Some(syst)) + identify("/") should ===(Some(root)) + identify("") should ===(Some(root)) + identify(RootActorPath(root.path.address)) should ===(Some(root)) + identify("..") should ===(Some(root)) + identify(root.path) should ===(Some(root)) + identify(root.path.toStringWithoutAddress) should ===(Some(root)) + identify("user") should ===(Some(user)) + identify("system") should ===(Some(syst)) + identify("user/") should ===(Some(user)) + identify("system/") should ===(Some(syst)) } "return ActorIdentity(None), respectively, for non-existing paths, and deadLetters" in { - identify("a/b/c") should be(None) - identify("a/b/c") should be(None) - identify("akka://all-systems/Nobody") should be(None) - identify("akka://all-systems/user") should be(None) - identify(system / "hallo") should be(None) - identify("foo://user") should be(None) - identify("/deadLetters") should be(None) - identify("deadLetters") should be(None) - identify("deadLetters/") should be(None) + identify("a/b/c") should ===(None) + identify("a/b/c") should ===(None) + identify("akka://all-systems/Nobody") should ===(None) + identify("akka://all-systems/user") should ===(None) + identify(system / "hallo") should ===(None) + identify("foo://user") should ===(None) + identify("/deadLetters") should ===(None) + identify("deadLetters") should ===(None) + identify("deadLetters/") should ===(None) } } @@ -179,7 +179,7 @@ class ActorSelectionSpec extends AkkaSpec("akka.loglevel=DEBUG") with DefaultTim "select actors by their path" in { def check(looker: ActorRef, pathOf: ActorRef, result: ActorRef) { - askNode(looker, SelectPath(pathOf.path)) should be(Some(result)) + askNode(looker, SelectPath(pathOf.path)) should ===(Some(result)) } for { looker ← all @@ -189,9 +189,9 @@ class ActorSelectionSpec extends AkkaSpec("akka.loglevel=DEBUG") with DefaultTim "select actors by their string path representation" in { def check(looker: ActorRef, pathOf: ActorRef, result: ActorRef) { - askNode(looker, SelectString(pathOf.path.toStringWithoutAddress)) should be(Some(result)) + askNode(looker, SelectString(pathOf.path.toStringWithoutAddress)) should ===(Some(result)) // with trailing / - askNode(looker, SelectString(pathOf.path.toStringWithoutAddress + "/")) should be(Some(result)) + askNode(looker, SelectString(pathOf.path.toStringWithoutAddress + "/")) should ===(Some(result)) } for { looker ← all @@ -201,8 +201,8 @@ class ActorSelectionSpec extends AkkaSpec("akka.loglevel=DEBUG") with DefaultTim "select actors by their root-anchored relative path" in { def check(looker: ActorRef, pathOf: ActorRef, result: ActorRef) { - askNode(looker, SelectString(pathOf.path.toStringWithoutAddress)) should be(Some(result)) - askNode(looker, SelectString(pathOf.path.elements.mkString("/", "/", "/"))) should be(Some(result)) + askNode(looker, SelectString(pathOf.path.toStringWithoutAddress)) should ===(Some(result)) + askNode(looker, SelectString(pathOf.path.elements.mkString("/", "/", "/"))) should ===(Some(result)) } for { looker ← all @@ -212,8 +212,8 @@ class ActorSelectionSpec extends AkkaSpec("akka.loglevel=DEBUG") with DefaultTim "select actors by their relative path" in { def check(looker: ActorRef, result: ActorRef, elems: String*) { - askNode(looker, SelectString(elems mkString "/")) should be(Some(result)) - askNode(looker, SelectString(elems mkString ("", "/", "/"))) should be(Some(result)) + askNode(looker, SelectString(elems mkString "/")) should ===(Some(result)) + askNode(looker, SelectString(elems mkString ("", "/", "/"))) should ===(Some(result)) } check(c1, user, "..") for { @@ -228,12 +228,12 @@ class ActorSelectionSpec extends AkkaSpec("akka.loglevel=DEBUG") with DefaultTim "find system-generated actors" in { def check(target: ActorRef) { for (looker ← all) { - askNode(looker, SelectPath(target.path)) should be(Some(target)) - askNode(looker, SelectString(target.path.toString)) should be(Some(target)) - askNode(looker, SelectString(target.path.toString + "/")) should be(Some(target)) + askNode(looker, SelectPath(target.path)) should ===(Some(target)) + askNode(looker, SelectString(target.path.toString)) should ===(Some(target)) + askNode(looker, SelectString(target.path.toString + "/")) should ===(Some(target)) } if (target != root) - askNode(c1, SelectString("../.." + target.path.elements.mkString("/", "/", "/"))) should be(Some(target)) + askNode(c1, SelectString("../.." + target.path.elements.mkString("/", "/", "/"))) should ===(Some(target)) } for (target ← Seq(root, syst, user)) check(target) } @@ -243,7 +243,7 @@ class ActorSelectionSpec extends AkkaSpec("akka.loglevel=DEBUG") with DefaultTim def checkOne(looker: ActorRef, query: Query, result: Option[ActorRef]) { val lookup = askNode(looker, query) - lookup should be(result) + lookup should ===(result) } def check(looker: ActorRef) { val lookname = looker.path.elements.mkString("", "/", "/") @@ -266,19 +266,19 @@ class ActorSelectionSpec extends AkkaSpec("akka.loglevel=DEBUG") with DefaultTim "send messages directly" in { ActorSelection(c1, "") ! GetSender(testActor) expectMsg(system.deadLetters) - lastSender should be(c1) + lastSender should ===(c1) } "send messages to string path" in { system.actorSelection("/user/c2/c21") ! GetSender(testActor) expectMsg(system.deadLetters) - lastSender should be(c21) + lastSender should ===(c21) } "send messages to actor path" in { system.actorSelection(system / "c2" / "c21") ! GetSender(testActor) expectMsg(system.deadLetters) - lastSender should be(c21) + lastSender should ===(c21) } "send messages with correct sender" in { @@ -287,7 +287,7 @@ class ActorSelectionSpec extends AkkaSpec("akka.loglevel=DEBUG") with DefaultTim val actors = Set() ++ receiveWhile(messages = 2) { case `c1` ⇒ lastSender } - actors should be(Set(c1, c2)) + actors should ===(Set(c1, c2)) expectNoMsg(1 second) } @@ -297,20 +297,20 @@ class ActorSelectionSpec extends AkkaSpec("akka.loglevel=DEBUG") with DefaultTim val actors = receiveWhile(messages = 2) { case `c2` ⇒ lastSender } - actors should be(Seq(c21)) + actors should ===(Seq(c21)) expectNoMsg(1 second) } "resolve one actor with explicit timeout" in { val s = system.actorSelection(system / "c2") // Java and Scala API - Await.result(s.resolveOne(1.second.dilated), timeout.duration) should be(c2) + Await.result(s.resolveOne(1.second.dilated), timeout.duration) should ===(c2) } "resolve one actor with implicit timeout" in { val s = system.actorSelection(system / "c2") // Scala API; implicit timeout from DefaultTimeout trait - Await.result(s.resolveOne(), timeout.duration) should be(c2) + Await.result(s.resolveOne(), timeout.duration) should ===(c2) } "resolve non-existing with Failure" in { @@ -320,8 +320,8 @@ class ActorSelectionSpec extends AkkaSpec("akka.loglevel=DEBUG") with DefaultTim } "compare equally" in { - ActorSelection(c21, "../*/hello") should be(ActorSelection(c21, "../*/hello")) - ActorSelection(c21, "../*/hello").## should be(ActorSelection(c21, "../*/hello").##) + ActorSelection(c21, "../*/hello") should ===(ActorSelection(c21, "../*/hello")) + ActorSelection(c21, "../*/hello").## should ===(ActorSelection(c21, "../*/hello").##) ActorSelection(c2, "../*/hello") should not be ActorSelection(c21, "../*/hello") ActorSelection(c2, "../*/hello").## should not be ActorSelection(c21, "../*/hello").## ActorSelection(c21, "../*/hell") should not be ActorSelection(c21, "../*/hello") @@ -329,16 +329,16 @@ class ActorSelectionSpec extends AkkaSpec("akka.loglevel=DEBUG") with DefaultTim } "print nicely" in { - ActorSelection(c21, "../*/hello").toString should be( + ActorSelection(c21, "../*/hello").toString should ===( s"ActorSelection[Anchor(akka://ActorSelectionSpec/user/c2/c21#${c21.path.uid}), Path(/../*/hello)]") } "have a stringly serializable path" in { - system.actorSelection(system / "c2").toSerializationFormat should be("akka://ActorSelectionSpec/user/c2") - system.actorSelection(system / "c2" / "c21").toSerializationFormat should be("akka://ActorSelectionSpec/user/c2/c21") - ActorSelection(c2, "/").toSerializationFormat should be("akka://ActorSelectionSpec/user/c2") - ActorSelection(c2, "../*/hello").toSerializationFormat should be("akka://ActorSelectionSpec/user/c2/../*/hello") - ActorSelection(c2, "/../*/hello").toSerializationFormat should be("akka://ActorSelectionSpec/user/c2/../*/hello") + system.actorSelection(system / "c2").toSerializationFormat should ===("akka://ActorSelectionSpec/user/c2") + system.actorSelection(system / "c2" / "c21").toSerializationFormat should ===("akka://ActorSelectionSpec/user/c2/c21") + ActorSelection(c2, "/").toSerializationFormat should ===("akka://ActorSelectionSpec/user/c2") + ActorSelection(c2, "../*/hello").toSerializationFormat should ===("akka://ActorSelectionSpec/user/c2/../*/hello") + ActorSelection(c2, "/../*/hello").toSerializationFormat should ===("akka://ActorSelectionSpec/user/c2/../*/hello") } "send ActorSelection targeted to missing actor to deadLetters" in { @@ -346,9 +346,9 @@ class ActorSelectionSpec extends AkkaSpec("akka.loglevel=DEBUG") with DefaultTim system.eventStream.subscribe(p.ref, classOf[DeadLetter]) system.actorSelection("/user/missing").tell("boom", testActor) val d = p.expectMsgType[DeadLetter] - d.message should be("boom") - d.sender should be(testActor) - d.recipient.path.toStringWithoutAddress should be("/user/missing") + d.message should ===("boom") + d.sender should ===(testActor) + d.recipient.path.toStringWithoutAddress should ===("/user/missing") } "identify actors with wildcard selection correctly" in { @@ -362,7 +362,7 @@ class ActorSelectionSpec extends AkkaSpec("akka.loglevel=DEBUG") with DefaultTim val probe = TestProbe() system.actorSelection("/user/a/*").tell(Identify(1), probe.ref) - probe.receiveN(2).map { case ActorIdentity(1, r) ⇒ r }.toSet should be(Set(Some(b1), Some(b2))) + probe.receiveN(2).map { case ActorIdentity(1, r) ⇒ r }.toSet should ===(Set[Option[ActorRef]](Some(b1), Some(b2))) probe.expectNoMsg(200.millis) system.actorSelection("/user/a/b1/*").tell(Identify(2), probe.ref) @@ -395,7 +395,7 @@ class ActorSelectionSpec extends AkkaSpec("akka.loglevel=DEBUG") with DefaultTim "forward to selection" in { c2.tell(Forward("c21", "hello"), testActor) expectMsg("hello") - lastSender should be(c21) + lastSender should ===(c21) } } diff --git a/akka-actor-tests/src/test/scala/akka/actor/ActorSystemSpec.scala b/akka-actor-tests/src/test/scala/akka/actor/ActorSystemSpec.scala index 4f78a5fe3b..1d674a89bd 100644 --- a/akka-actor-tests/src/test/scala/akka/actor/ActorSystemSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/actor/ActorSystemSpec.scala @@ -138,7 +138,7 @@ class ActorSystemSpec extends AkkaSpec(ActorSystemSpec.config) with ImplicitSend "An ActorSystem" must { "use scala.concurrent.Future's InternalCallbackEC" in { - system.asInstanceOf[ActorSystemImpl].internalCallingThreadExecutionContext.getClass.getName should be("scala.concurrent.Future$InternalCallbackExecutor$") + system.asInstanceOf[ActorSystemImpl].internalCallingThreadExecutionContext.getClass.getName should ===("scala.concurrent.Future$InternalCallbackExecutor$") } "reject invalid names" in { @@ -163,9 +163,9 @@ class ActorSystemSpec extends AkkaSpec(ActorSystemSpec.config) with ImplicitSend "support extensions" in { // TestExtension is configured and should be loaded at startup - system.hasExtension(TestExtension) should be(true) - TestExtension(system).system should be(system) - system.extension(TestExtension).system should be(system) + system.hasExtension(TestExtension) should ===(true) + TestExtension(system).system should ===(system) + system.extension(TestExtension).system should ===(system) } "log dead letters" in { @@ -200,7 +200,7 @@ class ActorSystemSpec extends AkkaSpec(ActorSystemSpec.config) with ImplicitSend val expected = (for (i ← 1 to count) yield i).reverse - immutableSeq(result) should be(expected) + immutableSeq(result) should ===(expected) } "awaitTermination after termination callbacks" in { @@ -217,22 +217,22 @@ class ActorSystemSpec extends AkkaSpec(ActorSystemSpec.config) with ImplicitSend system2.awaitTermination(5 seconds) Await.ready(system2.whenTerminated, 5 seconds) - callbackWasRun should be(true) + callbackWasRun should ===(true) } "return isTerminated status correctly" in { val system = ActorSystem().asInstanceOf[ActorSystemImpl] - system.isTerminated should be(false) + system.isTerminated should ===(false) val wt = system.whenTerminated - wt.isCompleted should be(false) + wt.isCompleted should ===(false) val f = system.terminate() val terminated = Await.result(wt, 10 seconds) - terminated.actor should be(system.provider.rootGuardian) - terminated.addressTerminated should be(true) - terminated.existenceConfirmed should be(true) + terminated.actor should ===(system.provider.rootGuardian) + terminated.addressTerminated should ===(true) + terminated.existenceConfirmed should ===(true) terminated should be theSameInstanceAs Await.result(f, 10 seconds) system.awaitTermination(10 seconds) - system.isTerminated should be(true) + system.isTerminated should ===(true) } "throw RejectedExecutionException when shutdown" in { @@ -242,19 +242,19 @@ class ActorSystemSpec extends AkkaSpec(ActorSystemSpec.config) with ImplicitSend intercept[RejectedExecutionException] { system2.registerOnTermination { println("IF YOU SEE THIS THEN THERE'S A BUG HERE") } - }.getMessage should be("ActorSystem already terminated.") + }.getMessage should ===("ActorSystem already terminated.") } "reliably create waves of actors" in { import system.dispatcher implicit val timeout = Timeout((20 seconds).dilated) val waves = for (i ← 1 to 3) yield system.actorOf(Props[ActorSystemSpec.Waves]) ? 50000 - Await.result(Future.sequence(waves), timeout.duration + 5.seconds) should be(Seq("done", "done", "done")) + Await.result(Future.sequence(waves), timeout.duration + 5.seconds) should ===(Vector("done", "done", "done")) } "find actors that just have been created" in { system.actorOf(Props(new FastActor(TestLatch(), testActor)).withDispatcher("slow")) - expectMsgType[Class[_]] should be(classOf[LocalActorRef]) + expectMsgType[Class[_]] should ===(classOf[LocalActorRef]) } "reliable deny creation of actors while shutting down" in { @@ -279,7 +279,7 @@ class ActorSystemSpec extends AkkaSpec(ActorSystemSpec.config) with ImplicitSend } } - created filter (ref ⇒ !ref.isTerminated && !ref.asInstanceOf[ActorRefWithCell].underlying.isInstanceOf[UnstartedCell]) should be(Seq()) + created filter (ref ⇒ !ref.isTerminated && !ref.asInstanceOf[ActorRefWithCell].underlying.isInstanceOf[UnstartedCell]) should ===(Seq.empty[ActorRef]) } "shut down when /user fails" in { @@ -305,8 +305,8 @@ class ActorSystemSpec extends AkkaSpec(ActorSystemSpec.config) with ImplicitSend a ! "die" } val t = probe.expectMsg(Terminated(a)(existenceConfirmed = true, addressTerminated = false)) - t.existenceConfirmed should be(true) - t.addressTerminated should be(false) + t.existenceConfirmed should ===(true) + t.addressTerminated should ===(false) shutdown(system) } diff --git a/akka-actor-tests/src/test/scala/akka/actor/ActorWithStashSpec.scala b/akka-actor-tests/src/test/scala/akka/actor/ActorWithStashSpec.scala index c2a25db5bd..793ce0a10a 100644 --- a/akka-actor-tests/src/test/scala/akka/actor/ActorWithStashSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/actor/ActorWithStashSpec.scala @@ -119,7 +119,7 @@ class ActorWithStashSpec extends AkkaSpec(ActorWithStashSpec.testConf) with Defa stasher ! "bye" stasher ! "hello" state.finished.await - state.s should be("bye") + state.s should ===("bye") } "support protocols" in { diff --git a/akka-actor-tests/src/test/scala/akka/actor/DeathWatchSpec.scala b/akka-actor-tests/src/test/scala/akka/actor/DeathWatchSpec.scala index a6a1cb75fc..ce70dab230 100644 --- a/akka-actor-tests/src/test/scala/akka/actor/DeathWatchSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/actor/DeathWatchSpec.scala @@ -120,11 +120,11 @@ trait DeathWatchSpec { this: AkkaSpec with ImplicitSender with DefaultTimeout terminal ! Kill terminal ! Kill - Await.result(terminal ? "foo", timeout.duration) should be("foo") + Await.result(terminal ? "foo", timeout.duration) should ===("foo") terminal ! Kill expectTerminationOf(terminal) - terminal.isTerminated should be(true) + terminal.isTerminated should ===(true) system.stop(supervisor) } @@ -155,7 +155,7 @@ trait DeathWatchSpec { this: AkkaSpec with ImplicitSender with DefaultTimeout case WrappedTerminated(Terminated(`brother`)) ⇒ 3 } testActor.isTerminated should not be true - result should be(Seq(1, 2, 3)) + result should ===(Seq(1, 2, 3)) } } diff --git a/akka-actor-tests/src/test/scala/akka/actor/DeployerSpec.scala b/akka-actor-tests/src/test/scala/akka/actor/DeployerSpec.scala index ca1e880f7d..bfbe2947f0 100644 --- a/akka-actor-tests/src/test/scala/akka/actor/DeployerSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/actor/DeployerSpec.scala @@ -77,7 +77,7 @@ class DeployerSpec extends AkkaSpec(DeployerSpec.deployerConf) { val service = "/service1" val deployment = system.asInstanceOf[ActorSystemImpl].provider.deployer.lookup(service.split("/").drop(1)) - deployment should be(Some( + deployment should ===(Some( Deploy( service, deployment.get.config, @@ -90,14 +90,14 @@ class DeployerSpec extends AkkaSpec(DeployerSpec.deployerConf) { "use None deployment for undefined service" in { val service = "/undefined" val deployment = system.asInstanceOf[ActorSystemImpl].provider.deployer.lookup(service.split("/").drop(1)) - deployment should be(None) + deployment should ===(None) } "be able to parse 'akka.actor.deployment._' with dispatcher config" in { val service = "/service3" val deployment = system.asInstanceOf[ActorSystemImpl].provider.deployer.lookup(service.split("/").drop(1)) - deployment should be(Some( + deployment should ===(Some( Deploy( service, deployment.get.config, @@ -111,7 +111,7 @@ class DeployerSpec extends AkkaSpec(DeployerSpec.deployerConf) { val service = "/service4" val deployment = system.asInstanceOf[ActorSystemImpl].provider.deployer.lookup(service.split("/").drop(1)) - deployment should be(Some( + deployment should ===(Some( Deploy( service, deployment.get.config, @@ -189,28 +189,28 @@ class DeployerSpec extends AkkaSpec(DeployerSpec.deployerConf) { "have correct router mappings" in { val mapping = system.asInstanceOf[ActorSystemImpl].provider.deployer.routerTypeMapping - mapping("from-code") should be(classOf[akka.routing.NoRouter].getName) - mapping("round-robin-pool") should be(classOf[akka.routing.RoundRobinPool].getName) - mapping("round-robin-group") should be(classOf[akka.routing.RoundRobinGroup].getName) - mapping("random-pool") should be(classOf[akka.routing.RandomPool].getName) - mapping("random-group") should be(classOf[akka.routing.RandomGroup].getName) - mapping("balancing-pool") should be(classOf[akka.routing.BalancingPool].getName) - mapping("smallest-mailbox-pool") should be(classOf[akka.routing.SmallestMailboxPool].getName) - mapping("broadcast-pool") should be(classOf[akka.routing.BroadcastPool].getName) - mapping("broadcast-group") should be(classOf[akka.routing.BroadcastGroup].getName) - mapping("scatter-gather-pool") should be(classOf[akka.routing.ScatterGatherFirstCompletedPool].getName) - mapping("scatter-gather-group") should be(classOf[akka.routing.ScatterGatherFirstCompletedGroup].getName) - mapping("consistent-hashing-pool") should be(classOf[akka.routing.ConsistentHashingPool].getName) - mapping("consistent-hashing-group") should be(classOf[akka.routing.ConsistentHashingGroup].getName) + mapping("from-code") should ===(classOf[akka.routing.NoRouter].getName) + mapping("round-robin-pool") should ===(classOf[akka.routing.RoundRobinPool].getName) + mapping("round-robin-group") should ===(classOf[akka.routing.RoundRobinGroup].getName) + mapping("random-pool") should ===(classOf[akka.routing.RandomPool].getName) + mapping("random-group") should ===(classOf[akka.routing.RandomGroup].getName) + mapping("balancing-pool") should ===(classOf[akka.routing.BalancingPool].getName) + mapping("smallest-mailbox-pool") should ===(classOf[akka.routing.SmallestMailboxPool].getName) + mapping("broadcast-pool") should ===(classOf[akka.routing.BroadcastPool].getName) + mapping("broadcast-group") should ===(classOf[akka.routing.BroadcastGroup].getName) + mapping("scatter-gather-pool") should ===(classOf[akka.routing.ScatterGatherFirstCompletedPool].getName) + mapping("scatter-gather-group") should ===(classOf[akka.routing.ScatterGatherFirstCompletedGroup].getName) + mapping("consistent-hashing-pool") should ===(classOf[akka.routing.ConsistentHashingPool].getName) + mapping("consistent-hashing-group") should ===(classOf[akka.routing.ConsistentHashingGroup].getName) } def assertRouting(service: String, expected: RouterConfig, expectPath: String): Unit = { val deployment = system.asInstanceOf[ActorSystemImpl].provider.deployer.lookup(service.split("/").drop(1)) - deployment.map(_.path).getOrElse("NOT FOUND") should be(expectPath) - deployment.get.routerConfig.getClass should be(expected.getClass) - deployment.get.scope should be(NoScopeGiven) + deployment.map(_.path).getOrElse("NOT FOUND") should ===(expectPath) + deployment.get.routerConfig.getClass should ===(expected.getClass) + deployment.get.scope should ===(NoScopeGiven) expected match { - case pool: Pool ⇒ deployment.get.routerConfig.asInstanceOf[Pool].resizer should be(pool.resizer) + case pool: Pool ⇒ deployment.get.routerConfig.asInstanceOf[Pool].resizer should ===(pool.resizer) case _ ⇒ } } diff --git a/akka-actor-tests/src/test/scala/akka/actor/FSMActorSpec.scala b/akka-actor-tests/src/test/scala/akka/actor/FSMActorSpec.scala index 0d130c220a..768c94e138 100644 --- a/akka-actor-tests/src/test/scala/akka/actor/FSMActorSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/actor/FSMActorSpec.scala @@ -239,8 +239,8 @@ class FSMActorSpec extends AkkaSpec(Map("akka.actor.debug.fsm" -> true)) with Im }) def checkTimersActive(active: Boolean) { - for (timer ← timerNames) fsmref.isTimerActive(timer) should be(active) - fsmref.isStateTimerActive should be(active) + for (timer ← timerNames) fsmref.isTimerActive(timer) should ===(active) + fsmref.isStateTimerActive should ===(active) } checkTimersActive(false) diff --git a/akka-actor-tests/src/test/scala/akka/actor/LocalActorRefProviderSpec.scala b/akka-actor-tests/src/test/scala/akka/actor/LocalActorRefProviderSpec.scala index 16d368d1ec..53d2339e99 100644 --- a/akka-actor-tests/src/test/scala/akka/actor/LocalActorRefProviderSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/actor/LocalActorRefProviderSpec.scala @@ -38,7 +38,7 @@ class LocalActorRefProviderSpec extends AkkaSpec(LocalActorRefProviderSpec.confi "find actor refs using actorFor" in { val a = system.actorOf(Props(new Actor { def receive = { case _ ⇒ } })) val b = system.actorFor(a.path) - a should be(b) + a should ===(b) } "find child actor with URL encoded name using actorFor" in { @@ -53,8 +53,8 @@ class LocalActorRefProviderSpec extends AkkaSpec(LocalActorRefProviderSpec.confi })) a.tell("lookup", testActor) val b = expectMsgType[ActorRef] - b.isTerminated should be(false) - b.path.name should be(childName) + b.isTerminated should ===(false) + b.path.name should ===(childName) } } @@ -109,7 +109,7 @@ class LocalActorRefProviderSpec extends AkkaSpec(LocalActorRefProviderSpec.confi a.tell(GetChild, testActor) val child = expectMsgType[ActorRef] val childProps1 = child.asInstanceOf[LocalActorRef].underlying.props - childProps1 should be(Props.empty) + childProps1 should ===(Props.empty) system stop a expectTerminated(a) // the fields are cleared after the Terminated message has been sent, @@ -128,7 +128,7 @@ class LocalActorRefProviderSpec extends AkkaSpec(LocalActorRefProviderSpec.confi val impl = system.asInstanceOf[ActorSystemImpl] val provider = impl.provider - provider.isInstanceOf[LocalActorRefProvider] should be(true) + provider.isInstanceOf[LocalActorRefProvider] should ===(true) for (i ← 0 until 100) { val address = "new-actor" + i @@ -139,7 +139,7 @@ class LocalActorRefProviderSpec extends AkkaSpec(LocalActorRefProviderSpec.confi case Some(Failure(ex: InvalidActorNameException)) ⇒ 2 case x ⇒ x }) - set should be(Set(1, 2)) + set should ===(Set[Any](1, 2)) } } @@ -156,18 +156,18 @@ class LocalActorRefProviderSpec extends AkkaSpec(LocalActorRefProviderSpec.confi } "throw suitable exceptions for malformed actor names" in { - intercept[InvalidActorNameException](system.actorOf(Props.empty, null)).getMessage.contains("null") should be(true) - intercept[InvalidActorNameException](system.actorOf(Props.empty, "")).getMessage.contains("empty") should be(true) - intercept[InvalidActorNameException](system.actorOf(Props.empty, "$hallo")).getMessage.contains("not start with `$`") should be(true) - intercept[InvalidActorNameException](system.actorOf(Props.empty, "a%")).getMessage.contains("Illegal actor name") should be(true) - intercept[InvalidActorNameException](system.actorOf(Props.empty, "%3")).getMessage.contains("Illegal actor name") should be(true) - intercept[InvalidActorNameException](system.actorOf(Props.empty, "%xx")).getMessage.contains("Illegal actor name") should be(true) - intercept[InvalidActorNameException](system.actorOf(Props.empty, "%0G")).getMessage.contains("Illegal actor name") should be(true) - intercept[InvalidActorNameException](system.actorOf(Props.empty, "%gg")).getMessage.contains("Illegal actor name") should be(true) - intercept[InvalidActorNameException](system.actorOf(Props.empty, "%")).getMessage.contains("Illegal actor name") should be(true) - intercept[InvalidActorNameException](system.actorOf(Props.empty, "%1t")).getMessage.contains("Illegal actor name") should be(true) - intercept[InvalidActorNameException](system.actorOf(Props.empty, "a?")).getMessage.contains("Illegal actor name") should be(true) - intercept[InvalidActorNameException](system.actorOf(Props.empty, "üß")).getMessage.contains("include only ASCII") should be(true) + intercept[InvalidActorNameException](system.actorOf(Props.empty, null)).getMessage.contains("null") should ===(true) + intercept[InvalidActorNameException](system.actorOf(Props.empty, "")).getMessage.contains("empty") should ===(true) + intercept[InvalidActorNameException](system.actorOf(Props.empty, "$hallo")).getMessage.contains("not start with `$`") should ===(true) + intercept[InvalidActorNameException](system.actorOf(Props.empty, "a%")).getMessage.contains("Illegal actor name") should ===(true) + intercept[InvalidActorNameException](system.actorOf(Props.empty, "%3")).getMessage.contains("Illegal actor name") should ===(true) + intercept[InvalidActorNameException](system.actorOf(Props.empty, "%xx")).getMessage.contains("Illegal actor name") should ===(true) + intercept[InvalidActorNameException](system.actorOf(Props.empty, "%0G")).getMessage.contains("Illegal actor name") should ===(true) + intercept[InvalidActorNameException](system.actorOf(Props.empty, "%gg")).getMessage.contains("Illegal actor name") should ===(true) + intercept[InvalidActorNameException](system.actorOf(Props.empty, "%")).getMessage.contains("Illegal actor name") should ===(true) + intercept[InvalidActorNameException](system.actorOf(Props.empty, "%1t")).getMessage.contains("Illegal actor name") should ===(true) + intercept[InvalidActorNameException](system.actorOf(Props.empty, "a?")).getMessage.contains("Illegal actor name") should ===(true) + intercept[InvalidActorNameException](system.actorOf(Props.empty, "üß")).getMessage.contains("include only ASCII") should ===(true) } } diff --git a/akka-actor-tests/src/test/scala/akka/actor/ReceiveTimeoutSpec.scala b/akka-actor-tests/src/test/scala/akka/actor/ReceiveTimeoutSpec.scala index 90a17da353..1b38b2ab93 100644 --- a/akka-actor-tests/src/test/scala/akka/actor/ReceiveTimeoutSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/actor/ReceiveTimeoutSpec.scala @@ -73,7 +73,7 @@ class ReceiveTimeoutSpec extends AkkaSpec { timeoutActor ! Tick Await.ready(timeoutLatch, TestLatch.DefaultTimeout) - count.get should be(1) + count.get should ===(1) system.stop(timeoutActor) } diff --git a/akka-actor-tests/src/test/scala/akka/actor/RelativeActorPathSpec.scala b/akka-actor-tests/src/test/scala/akka/actor/RelativeActorPathSpec.scala index 2f8b6cac79..15b2fa1af4 100644 --- a/akka-actor-tests/src/test/scala/akka/actor/RelativeActorPathSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/actor/RelativeActorPathSpec.scala @@ -14,17 +14,17 @@ class RelativeActorPathSpec extends WordSpec with Matchers { "RelativeActorPath" must { "match single name" in { - elements("foo") should be(List("foo")) + elements("foo") should ===(List("foo")) } "match path separated names" in { - elements("foo/bar/baz") should be(List("foo", "bar", "baz")) + elements("foo/bar/baz") should ===(List("foo", "bar", "baz")) } "match url encoded name" in { val name = URLEncoder.encode("akka://ClusterSystem@127.0.0.1:2552", "UTF-8") - elements(name) should be(List(name)) + elements(name) should ===(List(name)) } "match path with uid fragment" in { - elements("foo/bar/baz#1234") should be(List("foo", "bar", "baz#1234")) + elements("foo/bar/baz#1234") should ===(List("foo", "bar", "baz#1234")) } } } diff --git a/akka-actor-tests/src/test/scala/akka/actor/SchedulerSpec.scala b/akka-actor-tests/src/test/scala/akka/actor/SchedulerSpec.scala index b82380f1c8..badd62af2c 100644 --- a/akka-actor-tests/src/test/scala/akka/actor/SchedulerSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/actor/SchedulerSpec.scala @@ -91,12 +91,12 @@ trait SchedulerSpec extends BeforeAndAfterEach with DefaultTimeout with Implicit // should not be run immediately assert(countDownLatch.await(100, TimeUnit.MILLISECONDS) == false) - countDownLatch.getCount should be(3) + countDownLatch.getCount should ===(3) // after 1 second the wait should fail assert(countDownLatch.await(2, TimeUnit.SECONDS) == false) // should still be 1 left - countDownLatch.getCount should be(1) + countDownLatch.getCount should ===(1) } /** @@ -120,7 +120,7 @@ trait SchedulerSpec extends BeforeAndAfterEach with DefaultTimeout with Implicit timeout.cancel() Thread.sleep((initialDelay + 100.milliseconds.dilated).toMillis) - ticks.get should be(0) + ticks.get should ===(0) } "be cancellable after initial delay" taggedAs TimingTest in { @@ -135,25 +135,25 @@ trait SchedulerSpec extends BeforeAndAfterEach with DefaultTimeout with Implicit timeout.cancel() Thread.sleep((delay + 100.milliseconds.dilated).toMillis) - ticks.get should be(1) + ticks.get should ===(1) } "be canceled if cancel is performed before execution" in { val task = collectCancellable(system.scheduler.scheduleOnce(10 seconds)(())) - task.cancel() should be(true) - task.isCancelled should be(true) - task.cancel() should be(false) - task.isCancelled should be(true) + task.cancel() should ===(true) + task.isCancelled should ===(true) + task.cancel() should ===(false) + task.isCancelled should ===(true) } "not be canceled if cancel is performed after execution" in { val latch = TestLatch(1) val task = collectCancellable(system.scheduler.scheduleOnce(10 millis)(latch.countDown())) Await.ready(latch, remainingOrDefault) - task.cancel() should be(false) - task.isCancelled should be(false) - task.cancel() should be(false) - task.isCancelled should be(false) + task.cancel() should ===(false) + task.isCancelled should ===(false) + task.cancel() should ===(false) + task.isCancelled should ===(false) } /** @@ -228,7 +228,7 @@ trait SchedulerSpec extends BeforeAndAfterEach with DefaultTimeout with Implicit // LARS is a bit more aggressive in scheduling recurring tasks at the right // frequency and may execute them a little earlier; the actual expected timing // is 1599ms on a fast machine or 1699ms on a loaded one (plus some room for jenkins) - (System.nanoTime() - startTime).nanos.toMillis should be(1750L +- 250) + (System.nanoTime() - startTime).nanos.toMillis should ===(1750L +- 250) } "adjust for scheduler inaccuracy" taggedAs TimingTest in { @@ -238,7 +238,7 @@ trait SchedulerSpec extends BeforeAndAfterEach with DefaultTimeout with Implicit system.scheduler.schedule(25.millis, 25.millis) { latch.countDown() } Await.ready(latch, 6.seconds) // Rate - n * 1000.0 / (System.nanoTime - startTime).nanos.toMillis should be(40.0 +- 4) + n * 1000.0 / (System.nanoTime - startTime).nanos.toMillis should ===(40.0 +- 4) } "not be affected by long running task" taggedAs TimingTest in { @@ -251,7 +251,7 @@ trait SchedulerSpec extends BeforeAndAfterEach with DefaultTimeout with Implicit } Await.ready(latch, 6.seconds) // Rate - n * 1000.0 / (System.nanoTime - startTime).nanos.toMillis should be(4.4 +- 0.3) + n * 1000.0 / (System.nanoTime - startTime).nanos.toMillis should ===(4.4 +- 0.3) } "handle timeouts equal to multiple of wheel period" taggedAs TimingTest in { @@ -482,7 +482,7 @@ class LightArrayRevolverSchedulerSpec extends AkkaSpec(SchedulerSpec.testConfRev val s = success.size s should be < cap awaitCond(s == counter.get, message = s"$s was not ${counter.get}") - failure.size should be(headroom) + failure.size should ===(headroom) } } } @@ -490,7 +490,7 @@ class LightArrayRevolverSchedulerSpec extends AkkaSpec(SchedulerSpec.testConfRev trait Driver { def wakeUp(d: FiniteDuration): Unit def expectWait(): FiniteDuration - def expectWait(d: FiniteDuration) { expectWait() should be(d) } + def expectWait(d: FiniteDuration) { expectWait() should ===(d) } def probe: TestProbe def step: FiniteDuration def close(): Unit diff --git a/akka-actor-tests/src/test/scala/akka/actor/SupervisorHierarchySpec.scala b/akka-actor-tests/src/test/scala/akka/actor/SupervisorHierarchySpec.scala index a2ca564e8f..068b4142f9 100644 --- a/akka-actor-tests/src/test/scala/akka/actor/SupervisorHierarchySpec.scala +++ b/akka-actor-tests/src/test/scala/akka/actor/SupervisorHierarchySpec.scala @@ -859,9 +859,9 @@ class SupervisorHierarchySpec extends AkkaSpec(SupervisorHierarchySpec.config) w failResumer ! "blahonga" expectMsg("blahonga") } - createAttempt.get should be(6) - preStartCalled.get should be(1) - postRestartCalled.get should be(0) + createAttempt.get should ===(6) + preStartCalled.get should ===(1) + postRestartCalled.get should ===(0) } "survive being stressed" in { diff --git a/akka-actor-tests/src/test/scala/akka/actor/SupervisorMiscSpec.scala b/akka-actor-tests/src/test/scala/akka/actor/SupervisorMiscSpec.scala index 661abf978b..4e78d5aa74 100644 --- a/akka-actor-tests/src/test/scala/akka/actor/SupervisorMiscSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/actor/SupervisorMiscSpec.scala @@ -63,7 +63,7 @@ class SupervisorMiscSpec extends AkkaSpec(SupervisorMiscSpec.config) with Defaul Seq("actor1" -> actor1, "actor2" -> actor2, "actor3" -> actor3, "actor4" -> actor4) map { case (id, ref) ⇒ (id, ref ? "status") } foreach { - case (id, f) ⇒ (id, Await.result(f, timeout.duration)) should be((id, "OK")) + case (id, f) ⇒ (id, Await.result(f, timeout.duration)) should ===((id, "OK")) } } } @@ -80,7 +80,7 @@ class SupervisorMiscSpec extends AkkaSpec(SupervisorMiscSpec.config) with Defaul } expectMsg("preStart") expectMsg("preStart") - a.isTerminated should be(false) + a.isTerminated should ===(false) } "be able to recreate child when old child is Terminated" in { @@ -156,8 +156,8 @@ class SupervisorMiscSpec extends AkkaSpec(SupervisorMiscSpec.config) with Defaul parent ! "doit" } val p = expectMsgType[ActorRef].path - p.parent should be(parent.path) - p.name should be("child") + p.parent should ===(parent.path) + p.name should ===("child") } } } diff --git a/akka-actor-tests/src/test/scala/akka/actor/SupervisorSpec.scala b/akka-actor-tests/src/test/scala/akka/actor/SupervisorSpec.scala index 90fec3532d..cd80087bdf 100644 --- a/akka-actor-tests/src/test/scala/akka/actor/SupervisorSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/actor/SupervisorSpec.scala @@ -139,7 +139,7 @@ class SupervisorSpec extends AkkaSpec("akka.actor.serialize-messages = off") wit } def ping(pingPongActor: ActorRef) = { - Await.result(pingPongActor.?(Ping)(DilatedTimeout), DilatedTimeout) should be(PongMessage) + Await.result(pingPongActor.?(Ping)(DilatedTimeout), DilatedTimeout) should ===(PongMessage) expectMsg(Timeout, PingMessage) } @@ -371,7 +371,7 @@ class SupervisorSpec extends AkkaSpec("akka.actor.serialize-messages = off") wit dyingActor ! Ping expectMsg(PongMessage) - inits.get should be(3) + inits.get should ===(3) system.stop(supervisor) } diff --git a/akka-actor-tests/src/test/scala/akka/actor/TypedActorSpec.scala b/akka-actor-tests/src/test/scala/akka/actor/TypedActorSpec.scala index 9710052295..c901eb40ec 100644 --- a/akka-actor-tests/src/test/scala/akka/actor/TypedActorSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/actor/TypedActorSpec.scala @@ -224,13 +224,13 @@ class TypedActorSpec extends AkkaSpec(TypedActorSpec.config) TypedActor(system).typedActorOf( TypedProps[StackedImpl](classOf[Stacked], classOf[StackedImpl]).withTimeout(timeout)) - def mustStop(typedActor: AnyRef) = TypedActor(system).stop(typedActor) should be(true) + def mustStop(typedActor: AnyRef) = TypedActor(system).stop(typedActor) should ===(true) "TypedActors" must { "be able to instantiate" in { val t = newFooBar - TypedActor(system).isTypedActor(t) should be(true) + TypedActor(system).isTypedActor(t) should ===(true) mustStop(t) } @@ -240,62 +240,62 @@ class TypedActorSpec extends AkkaSpec(TypedActorSpec.config) } "not stop non-started ones" in { - TypedActor(system).stop(null) should be(false) + TypedActor(system).stop(null) should ===(false) } "throw an IllegalStateExcpetion when TypedActor.self is called in the wrong scope" in { filterEvents(EventFilter[IllegalStateException]("Calling")) { (intercept[IllegalStateException] { TypedActor.self[Foo] - }).getMessage should be("Calling TypedActor.self outside of a TypedActor implementation method!") + }).getMessage should ===("Calling TypedActor.self outside of a TypedActor implementation method!") } } "have access to itself when executing a method call" in { val t = newFooBar - t.self should be(t) + t.self should ===(t) mustStop(t) } "be able to call toString" in { val t = newFooBar - t.toString should be(TypedActor(system).getActorRefFor(t).toString) + t.toString should ===(TypedActor(system).getActorRefFor(t).toString) mustStop(t) } "be able to call equals" in { val t = newFooBar - t should be(t) + t should ===(t) t should not equal (null) mustStop(t) } "be able to call hashCode" in { val t = newFooBar - t.hashCode should be(TypedActor(system).getActorRefFor(t).hashCode) + t.hashCode should ===(TypedActor(system).getActorRefFor(t).hashCode) mustStop(t) } "be able to call user-defined void-methods" in { val t = newFooBar t.incr() - t.read() should be(1) + t.read() should ===(1) t.incr() - t.read() should be(2) - t.read() should be(2) + t.read() should ===(2) + t.read() should ===(2) mustStop(t) } "be able to call normally returning methods" in { val t = newFooBar - t.pigdog() should be("Pigdog") + t.pigdog() should ===("Pigdog") mustStop(t) } "be able to call null returning methods" in { val t = newFooBar t.nullJOption() should be(JOption.none) - t.nullOption() should be(None) + t.nullOption() should ===(None) t.nullReturn() should ===(null) Await.result(t.nullFuture(), timeout.duration) should ===(null) } @@ -303,8 +303,8 @@ class TypedActorSpec extends AkkaSpec(TypedActorSpec.config) "be able to call Future-returning methods non-blockingly" in { val t = newFooBar val f = t.futurePigdog(200 millis) - f.isCompleted should be(false) - Await.result(f, timeout.duration) should be("Pigdog") + f.isCompleted should ===(false) + Await.result(f, timeout.duration) should ===("Pigdog") mustStop(t) } @@ -312,36 +312,36 @@ class TypedActorSpec extends AkkaSpec(TypedActorSpec.config) val t = newFooBar val futures = for (i ← 1 to 20) yield (i, t.futurePigdog(20 millis, i)) for ((i, f) ← futures) { - Await.result(f, remaining) should be("Pigdog" + i) + Await.result(f, remaining) should ===("Pigdog" + i) } mustStop(t) } "be able to call methods returning Java Options" taggedAs TimingTest in { val t = newFooBar(1 second) - t.joptionPigdog(100 millis).get should be("Pigdog") - t.joptionPigdog(2 seconds) should be(JOption.none[String]) + t.joptionPigdog(100 millis).get should ===("Pigdog") + t.joptionPigdog(2 seconds) should ===(JOption.none[String]) mustStop(t) } "be able to handle AskTimeoutException as None" taggedAs TimingTest in { val t = newFooBar(200 millis) - t.joptionPigdog(600 millis) should be(JOption.none[String]) + t.joptionPigdog(600 millis) should ===(JOption.none[String]) mustStop(t) } "be able to call methods returning Scala Options" taggedAs TimingTest in { val t = newFooBar(1 second) - t.optionPigdog(100 millis).get should be("Pigdog") - t.optionPigdog(2 seconds) should be(None) + t.optionPigdog(100 millis).get should ===("Pigdog") + t.optionPigdog(2 seconds) should ===(None) mustStop(t) } "be able to compose futures without blocking" in within(timeout.duration) { val t, t2 = newFooBar(remaining) val f = t.futureComposePigdogFrom(t2) - f.isCompleted should be(false) - Await.result(f, remaining) should be("PIGDOG") + f.isCompleted should ===(false) + Await.result(f, remaining) should ===("PIGDOG") mustStop(t) mustStop(t2) } @@ -360,17 +360,17 @@ class TypedActorSpec extends AkkaSpec(TypedActorSpec.config) t.incr() t.failingPigdog() - t.read() should be(1) //Make sure state is not reset after failure + t.read() should ===(1) //Make sure state is not reset after failure - intercept[IllegalStateException] { Await.result(t.failingFuturePigdog, 2 seconds) }.getMessage should be("expected") - t.read() should be(1) //Make sure state is not reset after failure + intercept[IllegalStateException] { Await.result(t.failingFuturePigdog, 2 seconds) }.getMessage should ===("expected") + t.read() should ===(1) //Make sure state is not reset after failure - (intercept[IllegalStateException] { t.failingJOptionPigdog }).getMessage should be("expected") - t.read() should be(1) //Make sure state is not reset after failure + (intercept[IllegalStateException] { t.failingJOptionPigdog }).getMessage should ===("expected") + t.read() should ===(1) //Make sure state is not reset after failure - (intercept[IllegalStateException] { t.failingOptionPigdog }).getMessage should be("expected") + (intercept[IllegalStateException] { t.failingOptionPigdog }).getMessage should ===("expected") - t.read() should be(1) //Make sure state is not reset after failure + t.read() should ===(1) //Make sure state is not reset after failure mustStop(t) } @@ -379,13 +379,13 @@ class TypedActorSpec extends AkkaSpec(TypedActorSpec.config) "be restarted on failure" in { filterEvents(EventFilter[IllegalStateException]("expected")) { val t = newFooBar(Duration(2, "s")) - intercept[IllegalStateException] { t.failingOptionPigdog() }.getMessage should be("expected") - t.optionPigdog() should be(Some("Pigdog")) + intercept[IllegalStateException] { t.failingOptionPigdog() }.getMessage should ===("expected") + t.optionPigdog() should ===(Some("Pigdog")) mustStop(t) val ta: F = TypedActor(system).typedActorOf(TypedProps[FI]()) - intercept[IllegalStateException] { ta.f(true) }.getMessage should be("expected") - ta.f(false) should be(1) + intercept[IllegalStateException] { ta.f(true) }.getMessage should ===("expected") + ta.f(false) should ===(1) mustStop(ta) } @@ -393,8 +393,8 @@ class TypedActorSpec extends AkkaSpec(TypedActorSpec.config) "be able to support stacked traits for the interface part" in { val t = newStacked() - t.notOverriddenStacked should be("foobar") - t.stacked should be("FOOBAR") + t.notOverriddenStacked should ===("foobar") + t.stacked should ===("FOOBAR") mustStop(t) } @@ -402,16 +402,16 @@ class TypedActorSpec extends AkkaSpec(TypedActorSpec.config) val t: Foo = TypedActor(system).typedActorOf(TypedProps[Bar]()) val f = t.futurePigdog(200 millis) val f2 = t.futurePigdog(Duration.Zero) - f2.isCompleted should be(false) - f.isCompleted should be(false) - Await.result(f, remaining) should be(Await.result(f2, remaining)) + f2.isCompleted should ===(false) + f.isCompleted should ===(false) + Await.result(f, remaining) should ===(Await.result(f2, remaining)) mustStop(t) } "be able to support implementation only typed actors with complex interfaces" in { val t: Stackable1 with Stackable2 = TypedActor(system).typedActorOf(TypedProps[StackedImpl]()) - t.stackable1 should be("foo") - t.stackable2 should be("bar") + t.stackable1 should ===("foo") + t.stackable2 should ===("bar") mustStop(t) } @@ -421,7 +421,7 @@ class TypedActorSpec extends AkkaSpec(TypedActorSpec.config) val results = for (i ← 1 to 120) yield (i, iterator.next.futurePigdog(200 millis, i)) - for ((i, r) ← results) Await.result(r, remaining) should be("Pigdog" + i) + for ((i, r) ← results) Await.result(r, remaining) should ===("Pigdog" + i) for (t ← thais) mustStop(t) } @@ -440,7 +440,7 @@ class TypedActorSpec extends AkkaSpec(TypedActorSpec.config) val mNew = in.readObject().asInstanceOf[TypedActor.MethodCall] - mNew.method should be(m.method) + mNew.method should ===(m.method) } } @@ -459,13 +459,13 @@ class TypedActorSpec extends AkkaSpec(TypedActorSpec.config) val mNew = in.readObject().asInstanceOf[TypedActor.MethodCall] - mNew.method should be(m.method) + mNew.method should ===(m.method) mNew.parameters should have size 3 mNew.parameters(0) should not be null - mNew.parameters(0).getClass should be(classOf[Bar]) - mNew.parameters(1) should be(null) + mNew.parameters(0).getClass should ===(classOf[Bar]) + mNew.parameters(1) should ===(null) mNew.parameters(2) should not be null - mNew.parameters(2).asInstanceOf[Int] should be(1) + mNew.parameters(2).asInstanceOf[Int] should ===(1) } } @@ -474,7 +474,7 @@ class TypedActorSpec extends AkkaSpec(TypedActorSpec.config) JavaSerializer.currentSystem.withValue(system.asInstanceOf[ExtendedActorSystem]) { val t = newFooBar(Duration(2, "s")) - t.optionPigdog() should be(Some("Pigdog")) + t.optionPigdog() should ===(Some("Pigdog")) val baos = new ByteArrayOutputStream(8192 * 4) val out = new ObjectOutputStream(baos) @@ -486,9 +486,9 @@ class TypedActorSpec extends AkkaSpec(TypedActorSpec.config) val tNew = in.readObject().asInstanceOf[Foo] - tNew should be(t) + tNew should ===(t) - tNew.optionPigdog() should be(Some("Pigdog")) + tNew.optionPigdog() should ===(Some("Pigdog")) mustStop(t) } @@ -512,7 +512,7 @@ class TypedActorSpec extends AkkaSpec(TypedActorSpec.config) //Done with that now ta.poisonPill(t) - latch.await(10, TimeUnit.SECONDS) should be(true) + latch.await(10, TimeUnit.SECONDS) should ===(true) } } } @@ -528,7 +528,7 @@ class TypedActorRouterSpec extends AkkaSpec(TypedActorSpec.config) def newFooBar(d: FiniteDuration): Foo = TypedActor(system).typedActorOf(TypedProps[Bar](classOf[Foo], classOf[Bar]).withTimeout(Timeout(d))) - def mustStop(typedActor: AnyRef) = TypedActor(system).stop(typedActor) should be(true) + def mustStop(typedActor: AnyRef) = TypedActor(system).stop(typedActor) should ===(true) "TypedActor Router" must { @@ -539,8 +539,8 @@ class TypedActorRouterSpec extends AkkaSpec(TypedActorSpec.config) val t4 = newFooBar val routees = List(t1, t2, t3, t4) map { t ⇒ TypedActor(system).getActorRefFor(t).path.toStringWithoutAddress } - TypedActor(system).isTypedActor(t1) should be(true) - TypedActor(system).isTypedActor(t2) should be(true) + TypedActor(system).isTypedActor(t1) should ===(true) + TypedActor(system).isTypedActor(t2) should ===(true) val router = system.actorOf(RoundRobinGroup(routees).props(), "router") diff --git a/akka-actor-tests/src/test/scala/akka/actor/dispatch/BalancingDispatcherSpec.scala b/akka-actor-tests/src/test/scala/akka/actor/dispatch/BalancingDispatcherSpec.scala index 5629cbb80a..78ba40643e 100644 --- a/akka-actor-tests/src/test/scala/akka/actor/dispatch/BalancingDispatcherSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/actor/dispatch/BalancingDispatcherSpec.scala @@ -80,8 +80,8 @@ class BalancingDispatcherSpec extends AkkaSpec(BalancingDispatcherSpec.config) { } finishedCounter.await(5, TimeUnit.SECONDS) - fast.underlying.asInstanceOf[ActorCell].mailbox.asInstanceOf[Mailbox].hasMessages should be(false) - slow.underlying.asInstanceOf[ActorCell].mailbox.asInstanceOf[Mailbox].hasMessages should be(false) + fast.underlying.asInstanceOf[ActorCell].mailbox.asInstanceOf[Mailbox].hasMessages should ===(false) + slow.underlying.asInstanceOf[ActorCell].mailbox.asInstanceOf[Mailbox].hasMessages should ===(false) fast.underlying.asInstanceOf[ActorCell].actor.asInstanceOf[DelayableActor].invocationCount should be > sentToFast fast.underlying.asInstanceOf[ActorCell].actor.asInstanceOf[DelayableActor].invocationCount should be > (slow.underlying.asInstanceOf[ActorCell].actor.asInstanceOf[DelayableActor].invocationCount) diff --git a/akka-actor-tests/src/test/scala/akka/actor/dispatch/DispatchersSpec.scala b/akka-actor-tests/src/test/scala/akka/actor/dispatch/DispatchersSpec.scala index cbf00f7883..9d1ab4c0c2 100644 --- a/akka-actor-tests/src/test/scala/akka/actor/dispatch/DispatchersSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/actor/dispatch/DispatchersSpec.scala @@ -129,12 +129,12 @@ class DispatchersSpec extends AkkaSpec(DispatchersSpec.config) with ImplicitSend "use defined properties" in { val dispatcher = lookup("myapp.mydispatcher") - dispatcher.throughput should be(17) + dispatcher.throughput should ===(17) } "use specific id" in { val dispatcher = lookup("myapp.mydispatcher") - dispatcher.id should be("myapp.mydispatcher") + dispatcher.id should ===("myapp.mydispatcher") } "complain about missing config" in { @@ -145,8 +145,8 @@ class DispatchersSpec extends AkkaSpec(DispatchersSpec.config) with ImplicitSend "have only one default dispatcher" in { val dispatcher = lookup(Dispatchers.DefaultDispatcherId) - dispatcher should be(defaultGlobalDispatcher) - dispatcher should be(system.dispatcher) + dispatcher should ===(defaultGlobalDispatcher) + dispatcher should ===(system.dispatcher) } "throw ConfigurationException if type does not exist" in { @@ -164,7 +164,7 @@ class DispatchersSpec extends AkkaSpec(DispatchersSpec.config) with ImplicitSend "provide lookup of dispatchers by id" in { val d1 = lookup("myapp.mydispatcher") val d2 = lookup("myapp.mydispatcher") - d1 should be(d2) + d1 should ===(d2) } "include system name and dispatcher id in thread names for fork-join-executor" in { diff --git a/akka-actor-tests/src/test/scala/akka/actor/routing/ListenerSpec.scala b/akka-actor-tests/src/test/scala/akka/actor/routing/ListenerSpec.scala index 3edc7b3447..e84f527376 100644 --- a/akka-actor-tests/src/test/scala/akka/actor/routing/ListenerSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/actor/routing/ListenerSpec.scala @@ -47,7 +47,7 @@ class ListenerSpec extends AkkaSpec { broadcast ! "foo" Await.ready(barLatch, TestLatch.DefaultTimeout) - barCount.get should be(2) + barCount.get should ===(2) Await.ready(fooLatch, TestLatch.DefaultTimeout) diff --git a/akka-actor-tests/src/test/scala/akka/config/ConfigSpec.scala b/akka-actor-tests/src/test/scala/akka/config/ConfigSpec.scala index c61b418698..f9b4beb7a4 100644 --- a/akka-actor-tests/src/test/scala/akka/config/ConfigSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/config/ConfigSpec.scala @@ -26,46 +26,46 @@ class ConfigSpec extends AkkaSpec(ConfigFactory.defaultReference(ActorSystem.fin { import config._ - getString("akka.version") should be("2.4-SNAPSHOT") - settings.ConfigVersion should be("2.4-SNAPSHOT") + getString("akka.version") should ===("2.4-SNAPSHOT") + settings.ConfigVersion should ===("2.4-SNAPSHOT") - getBoolean("akka.daemonic") should be(false) + getBoolean("akka.daemonic") should ===(false) // WARNING: This setting should be off in the default reference.conf, but should be on when running // the test suite. - getBoolean("akka.actor.serialize-messages") should be(true) - settings.SerializeAllMessages should be(true) + getBoolean("akka.actor.serialize-messages") should ===(true) + settings.SerializeAllMessages should ===(true) - getInt("akka.scheduler.ticks-per-wheel") should be(512) - getDuration("akka.scheduler.tick-duration", TimeUnit.MILLISECONDS) should be(10) - getString("akka.scheduler.implementation") should be("akka.actor.LightArrayRevolverScheduler") + getInt("akka.scheduler.ticks-per-wheel") should ===(512) + getDuration("akka.scheduler.tick-duration", TimeUnit.MILLISECONDS) should ===(10) + getString("akka.scheduler.implementation") should ===("akka.actor.LightArrayRevolverScheduler") - getBoolean("akka.daemonic") should be(false) - settings.Daemonicity should be(false) + getBoolean("akka.daemonic") should ===(false) + settings.Daemonicity should ===(false) - getBoolean("akka.jvm-exit-on-fatal-error") should be(true) - settings.JvmExitOnFatalError should be(true) + getBoolean("akka.jvm-exit-on-fatal-error") should ===(true) + settings.JvmExitOnFatalError should ===(true) - getInt("akka.actor.deployment.default.virtual-nodes-factor") should be(10) - settings.DefaultVirtualNodesFactor should be(10) + getInt("akka.actor.deployment.default.virtual-nodes-factor") should ===(10) + settings.DefaultVirtualNodesFactor should ===(10) - getDuration("akka.actor.unstarted-push-timeout", TimeUnit.MILLISECONDS) should be(10.seconds.toMillis) - settings.UnstartedPushTimeout.duration should be(10.seconds) + getDuration("akka.actor.unstarted-push-timeout", TimeUnit.MILLISECONDS) should ===(10.seconds.toMillis) + settings.UnstartedPushTimeout.duration should ===(10.seconds) - settings.Loggers.size should be(1) - settings.Loggers.head should be(classOf[DefaultLogger].getName) - getStringList("akka.loggers").get(0) should be(classOf[DefaultLogger].getName) + settings.Loggers.size should ===(1) + settings.Loggers.head should ===(classOf[DefaultLogger].getName) + getStringList("akka.loggers").get(0) should ===(classOf[DefaultLogger].getName) - getDuration("akka.logger-startup-timeout", TimeUnit.MILLISECONDS) should be(5.seconds.toMillis) - settings.LoggerStartTimeout.duration should be(5.seconds) + getDuration("akka.logger-startup-timeout", TimeUnit.MILLISECONDS) should ===(5.seconds.toMillis) + settings.LoggerStartTimeout.duration should ===(5.seconds) - getString("akka.logging-filter") should be(classOf[DefaultLoggingFilter].getName) + getString("akka.logging-filter") should ===(classOf[DefaultLoggingFilter].getName) - getInt("akka.log-dead-letters") should be(10) - settings.LogDeadLetters should be(10) + getInt("akka.log-dead-letters") should ===(10) + settings.LogDeadLetters should ===(10) - getBoolean("akka.log-dead-letters-during-shutdown") should be(true) - settings.LogDeadLettersDuringShutdown should be(true) + getBoolean("akka.log-dead-letters-during-shutdown") should ===(true) + settings.LogDeadLettersDuringShutdown should ===(true) } { @@ -74,27 +74,27 @@ class ConfigSpec extends AkkaSpec(ConfigFactory.defaultReference(ActorSystem.fin //General dispatcher config { - c.getString("type") should be("Dispatcher") - c.getString("executor") should be("default-executor") - c.getDuration("shutdown-timeout", TimeUnit.MILLISECONDS) should be(1 * 1000) - c.getInt("throughput") should be(5) - c.getDuration("throughput-deadline-time", TimeUnit.MILLISECONDS) should be(0) - c.getBoolean("attempt-teamwork") should be(true) + c.getString("type") should ===("Dispatcher") + c.getString("executor") should ===("default-executor") + c.getDuration("shutdown-timeout", TimeUnit.MILLISECONDS) should ===(1 * 1000) + c.getInt("throughput") should ===(5) + c.getDuration("throughput-deadline-time", TimeUnit.MILLISECONDS) should ===(0) + c.getBoolean("attempt-teamwork") should ===(true) } //Default executor config { val pool = c.getConfig("default-executor") - pool.getString("fallback") should be("fork-join-executor") + pool.getString("fallback") should ===("fork-join-executor") } //Fork join executor config { val pool = c.getConfig("fork-join-executor") - pool.getInt("parallelism-min") should be(8) - pool.getDouble("parallelism-factor") should be(3.0) - pool.getInt("parallelism-max") should be(64) + pool.getInt("parallelism-min") should ===(8) + pool.getDouble("parallelism-factor") should ===(3.0) + pool.getInt("parallelism-max") should ===(64) } //Thread pool executor config @@ -102,38 +102,38 @@ class ConfigSpec extends AkkaSpec(ConfigFactory.defaultReference(ActorSystem.fin { val pool = c.getConfig("thread-pool-executor") import pool._ - getDuration("keep-alive-time", TimeUnit.MILLISECONDS) should be(60 * 1000) - getDouble("core-pool-size-factor") should be(3.0) - getDouble("max-pool-size-factor") should be(3.0) - getInt("task-queue-size") should be(-1) - getString("task-queue-type") should be("linked") - getBoolean("allow-core-timeout") should be(true) + getDuration("keep-alive-time", TimeUnit.MILLISECONDS) should ===(60 * 1000) + getDouble("core-pool-size-factor") should ===(3.0) + getDouble("max-pool-size-factor") should ===(3.0) + getInt("task-queue-size") should ===(-1) + getString("task-queue-type") should ===("linked") + getBoolean("allow-core-timeout") should ===(true) } // Debug config { val debug = config.getConfig("akka.actor.debug") import debug._ - getBoolean("receive") should be(false) - settings.AddLoggingReceive should be(false) + getBoolean("receive") should ===(false) + settings.AddLoggingReceive should ===(false) - getBoolean("autoreceive") should be(false) - settings.DebugAutoReceive should be(false) + getBoolean("autoreceive") should ===(false) + settings.DebugAutoReceive should ===(false) - getBoolean("lifecycle") should be(false) - settings.DebugLifecycle should be(false) + getBoolean("lifecycle") should ===(false) + settings.DebugLifecycle should ===(false) - getBoolean("fsm") should be(false) - settings.FsmDebugEvent should be(false) + getBoolean("fsm") should ===(false) + settings.FsmDebugEvent should ===(false) - getBoolean("event-stream") should be(false) - settings.DebugEventStream should be(false) + getBoolean("event-stream") should ===(false) + settings.DebugEventStream should ===(false) - getBoolean("unhandled") should be(false) - settings.DebugUnhandledMessage should be(false) + getBoolean("unhandled") should ===(false) + settings.DebugUnhandledMessage should ===(false) - getBoolean("router-misconfiguration") should be(false) - settings.DebugRouterMisconfiguration should be(false) + getBoolean("router-misconfiguration") should ===(false) + settings.DebugRouterMisconfiguration should ===(false) } } @@ -144,9 +144,9 @@ class ConfigSpec extends AkkaSpec(ConfigFactory.defaultReference(ActorSystem.fin // general mailbox config { - c.getInt("mailbox-capacity") should be(1000) - c.getDuration("mailbox-push-timeout-time", TimeUnit.MILLISECONDS) should be(10 * 1000) - c.getString("mailbox-type") should be("akka.dispatch.UnboundedMailbox") + c.getInt("mailbox-capacity") should ===(1000) + c.getDuration("mailbox-push-timeout-time", TimeUnit.MILLISECONDS) should ===(10 * 1000) + c.getString("mailbox-type") should ===("akka.dispatch.UnboundedMailbox") } } } diff --git a/akka-actor-tests/src/test/scala/akka/dataflow/Future2Actor.scala b/akka-actor-tests/src/test/scala/akka/dataflow/Future2Actor.scala index 8b5f0c88b6..141ff565eb 100644 --- a/akka-actor-tests/src/test/scala/akka/dataflow/Future2Actor.scala +++ b/akka-actor-tests/src/test/scala/akka/dataflow/Future2Actor.scala @@ -26,14 +26,14 @@ class Future2ActorSpec extends AkkaSpec with DefaultTimeout { implicit val someActor = system.actorOf(Props(new Actor { def receive = Actor.emptyBehavior })) Future(42) pipeTo testActor pipeTo testActor expectMsgAllOf(1 second, 42, 42) - lastSender should be(someActor) + lastSender should ===(someActor) } "support convenient sending with explicit sender" in { val someActor = system.actorOf(Props(new Actor { def receive = Actor.emptyBehavior })) Future(42).to(testActor, someActor) expectMsgAllOf(1 second, 42) - lastSender should be(someActor) + lastSender should ===(someActor) } "support reply via sender" in { @@ -43,10 +43,10 @@ class Future2ActorSpec extends AkkaSpec with DefaultTimeout { case "ex" ⇒ Future(throw new AssertionError) pipeTo context.sender() } })) - Await.result(actor ? "do", timeout.duration) should be(31) + Await.result(actor ? "do", timeout.duration) should ===(31) intercept[ExecutionException] { Await.result(actor ? "ex", timeout.duration) - }.getCause.isInstanceOf[AssertionError] should be(true) + }.getCause.isInstanceOf[AssertionError] should ===(true) } } } diff --git a/akka-actor-tests/src/test/scala/akka/dispatch/ExecutionContextSpec.scala b/akka-actor-tests/src/test/scala/akka/dispatch/ExecutionContextSpec.scala index 76efcdb476..f62e6de0ad 100644 --- a/akka-actor-tests/src/test/scala/akka/dispatch/ExecutionContextSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/dispatch/ExecutionContextSpec.scala @@ -31,7 +31,7 @@ class ExecutionContextSpec extends AkkaSpec with DefaultTimeout { } "be able to use Batching" in { - system.dispatcher.isInstanceOf[BatchingExecutor] should be(true) + system.dispatcher.isInstanceOf[BatchingExecutor] should ===(true) import system.dispatcher @@ -55,11 +55,11 @@ class ExecutionContextSpec extends AkkaSpec with DefaultTimeout { } callingThreadLock.compareAndSet(1, 0) // Disable the lock } - Await.result(p.future, timeout.duration) should be(()) + Await.result(p.future, timeout.duration) should ===(()) } "be able to avoid starvation when Batching is used and Await/blocking is called" in { - system.dispatcher.isInstanceOf[BatchingExecutor] should be(true) + system.dispatcher.isInstanceOf[BatchingExecutor] should ===(true) import system.dispatcher def batchable[T](f: ⇒ T)(implicit ec: ExecutionContext): Unit = ec.execute(new Batchable { @@ -93,15 +93,15 @@ class ExecutionContextSpec extends AkkaSpec with DefaultTimeout { awaitCond(counter.get == 2) perform(_ + 4) perform(_ * 2) - sec.size should be(2) + sec.size should ===(2) Thread.sleep(500) - sec.size should be(2) - counter.get should be(2) + sec.size should ===(2) + counter.get should ===(2) sec.resume() awaitCond(counter.get == 12) perform(_ * 2) awaitCond(counter.get == 24) - sec.isEmpty should be(true) + sec.isEmpty should ===(true) } "execute 'throughput' number of tasks per sweep" in { @@ -118,11 +118,11 @@ class ExecutionContextSpec extends AkkaSpec with DefaultTimeout { val total = 1000 1 to total foreach { _ ⇒ perform(_ + 1) } - sec.size() should be(total) + sec.size() should ===(total) sec.resume() awaitCond(counter.get == total) - submissions.get should be(total / throughput) - sec.isEmpty should be(true) + submissions.get should ===(total / throughput) + sec.isEmpty should ===(true) } "execute tasks in serial" in { @@ -133,7 +133,7 @@ class ExecutionContextSpec extends AkkaSpec with DefaultTimeout { 1 to total foreach { i ⇒ perform(c ⇒ if (c == (i - 1)) c + 1 else c) } awaitCond(counter.get == total) - sec.isEmpty should be(true) + sec.isEmpty should ===(true) } "relinquish thread when suspended" in { @@ -151,13 +151,13 @@ class ExecutionContextSpec extends AkkaSpec with DefaultTimeout { 1 to 10 foreach { _ ⇒ perform(identity) } perform(x ⇒ { sec.suspend(); x * 2 }) perform(_ + 8) - sec.size should be(13) + sec.size should ===(13) sec.resume() awaitCond(counter.get == 2) sec.resume() awaitCond(counter.get == 10) - sec.isEmpty should be(true) - submissions.get should be(2) + sec.isEmpty should ===(true) + submissions.get should ===(2) } } } diff --git a/akka-actor-tests/src/test/scala/akka/dispatch/FutureSpec.scala b/akka-actor-tests/src/test/scala/akka/dispatch/FutureSpec.scala index 104b1425a1..70e900abbb 100644 --- a/akka-actor-tests/src/test/scala/akka/dispatch/FutureSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/dispatch/FutureSpec.scala @@ -89,12 +89,12 @@ class FutureSpec extends AkkaSpec with Checkers with BeforeAndAfterAll with Defa val empty = Promise[String]().future val timedOut = Promise.successful[String]("Timedout").future - Await.result(failure fallbackTo timedOut, timeout.duration) should be("Timedout") - Await.result(timedOut fallbackTo empty, timeout.duration) should be("Timedout") - Await.result(failure fallbackTo failure fallbackTo timedOut, timeout.duration) should be("Timedout") + Await.result(failure fallbackTo timedOut, timeout.duration) should ===("Timedout") + Await.result(timedOut fallbackTo empty, timeout.duration) should ===("Timedout") + Await.result(failure fallbackTo failure fallbackTo timedOut, timeout.duration) should ===("Timedout") intercept[RuntimeException] { Await.result(failure fallbackTo otherFailure, timeout.duration) - }.getMessage should be("br0ken") + }.getMessage should ===("br0ken") } } "completed with a result" must { @@ -138,7 +138,7 @@ class FutureSpec extends AkkaSpec with Checkers with BeforeAndAfterAll with Defa p.completeWith(Future { "Hi " }(B)) try { - Await.result(result, timeout.duration) should be("Hi A") + Await.result(result, timeout.duration) should ===("Hi A") } finally { A.shutdown() B.shutdown() @@ -282,7 +282,7 @@ class FutureSpec extends AkkaSpec with Checkers with BeforeAndAfterAll with Defa c ← (actor ? 7).mapTo[String] } yield b + "-" + c - Await.result(future1, timeout.duration) should be("10-14") + Await.result(future1, timeout.duration) should ===("10-14") assert(checkType(future1, classTag[String])) intercept[ClassCastException] { Await.result(future2, timeout.duration) } system.stop(actor) @@ -310,7 +310,7 @@ class FutureSpec extends AkkaSpec with Checkers with BeforeAndAfterAll with Defa Res(c: Int) ← actor ? Req(7) } yield b + "-" + c - Await.result(future1, timeout.duration) should be("10-14") + Await.result(future1, timeout.duration) should ===("10-14") intercept[NoSuchElementException] { Await.result(future2, timeout.duration) } system.stop(actor) } @@ -347,17 +347,17 @@ class FutureSpec extends AkkaSpec with Checkers with BeforeAndAfterAll with Defa } val future11 = actor ? "Failure" recover { case _ ⇒ "Oops!" } - Await.result(future1, timeout.duration) should be(5) + Await.result(future1, timeout.duration) should ===(5) intercept[ArithmeticException] { Await.result(future2, timeout.duration) } intercept[ArithmeticException] { Await.result(future3, timeout.duration) } - Await.result(future4, timeout.duration) should be("5") - Await.result(future5, timeout.duration) should be("0") + Await.result(future4, timeout.duration) should ===("5") + Await.result(future5, timeout.duration) should ===("0") intercept[ArithmeticException] { Await.result(future6, timeout.duration) } - Await.result(future7, timeout.duration) should be("You got ERROR") + Await.result(future7, timeout.duration) should ===("You got ERROR") intercept[RuntimeException] { Await.result(future8, timeout.duration) } - Await.result(future9, timeout.duration) should be("FAIL!") - Await.result(future10, timeout.duration) should be("World") - Await.result(future11, timeout.duration) should be("Oops!") + Await.result(future9, timeout.duration) should ===("FAIL!") + Await.result(future10, timeout.duration) should ===("World") + Await.result(future11, timeout.duration) should ===("Oops!") system.stop(actor) } @@ -370,42 +370,42 @@ class FutureSpec extends AkkaSpec with Checkers with BeforeAndAfterAll with Defa intercept[IllegalStateException] { Await.result(Promise.failed[String](o).future recoverWith { case _ if false == true ⇒ yay }, timeout.duration) - } should be(o) + } should ===(o) - Await.result(Promise.failed[String](o).future recoverWith { case _ ⇒ yay }, timeout.duration) should be("yay!") + Await.result(Promise.failed[String](o).future recoverWith { case _ ⇒ yay }, timeout.duration) should ===("yay!") intercept[IllegalStateException] { Await.result(Promise.failed[String](o).future recoverWith { case _ ⇒ Promise.failed[String](r).future }, timeout.duration) - } should be(r) + } should ===(r) } "andThen like a boss" in { val q = new LinkedBlockingQueue[Int] for (i ← 1 to 1000) { - Await.result(Future { q.add(1); 3 } andThen { case _ ⇒ q.add(2) } andThen { case Success(0) ⇒ q.add(Int.MaxValue) } andThen { case _ ⇒ q.add(3); }, timeout.duration) should be(3) - q.poll() should be(1) - q.poll() should be(2) - q.poll() should be(3) + Await.result(Future { q.add(1); 3 } andThen { case _ ⇒ q.add(2) } andThen { case Success(0) ⇒ q.add(Int.MaxValue) } andThen { case _ ⇒ q.add(3); }, timeout.duration) should ===(3) + q.poll() should ===(1) + q.poll() should ===(2) + q.poll() should ===(3) q.clear() } } "firstCompletedOf" in { val futures = Vector.fill[Future[Int]](10)(Promise[Int]().future) :+ Promise.successful[Int](5).future - Await.result(Future.firstCompletedOf(futures), timeout.duration) should be(5) + Await.result(Future.firstCompletedOf(futures), timeout.duration) should ===(5) } "find" in { val futures = for (i ← 1 to 10) yield Future { i } val result = Future.find[Int](futures)(_ == 3) - Await.result(result, timeout.duration) should be(Some(3)) + Await.result(result, timeout.duration) should ===(Some(3)) val notFound = Future.find[Int](futures)(_ == 11) - Await.result(notFound, timeout.duration) should be(None) + Await.result(notFound, timeout.duration) should ===(None) } "fold" in { - Await.result(Future.fold((1 to 10).toList map { i ⇒ Future(i) })(0)(_ + _), remainingOrDefault) should be(55) + Await.result(Future.fold((1 to 10).toList map { i ⇒ Future(i) })(0)(_ + _), remainingOrDefault) should ===(55) } "zip" in { @@ -413,22 +413,22 @@ class FutureSpec extends AkkaSpec with Checkers with BeforeAndAfterAll with Defa val f = new IllegalStateException("test") intercept[IllegalStateException] { Await.result(Promise.failed[String](f).future zip Promise.successful("foo").future, timeout) - } should be(f) + } should ===(f) intercept[IllegalStateException] { Await.result(Promise.successful("foo").future zip Promise.failed[String](f).future, timeout) - } should be(f) + } should ===(f) intercept[IllegalStateException] { Await.result(Promise.failed[String](f).future zip Promise.failed[String](f).future, timeout) - } should be(f) + } should ===(f) - Await.result(Promise.successful("foo").future zip Promise.successful("foo").future, timeout) should be(("foo", "foo")) + Await.result(Promise.successful("foo").future zip Promise.successful("foo").future, timeout) should ===(("foo", "foo")) } "fold by composing" in { val futures = (1 to 10).toList map { i ⇒ Future(i) } - Await.result(futures.foldLeft(Future(0))((fr, fa) ⇒ for (r ← fr; a ← fa) yield (r + a)), timeout.duration) should be(55) + Await.result(futures.foldLeft(Future(0))((fr, fa) ⇒ for (r ← fr; a ← fa) yield (r + a)), timeout.duration) should ===(55) } "fold with an exception" in { @@ -437,7 +437,7 @@ class FutureSpec extends AkkaSpec with Checkers with BeforeAndAfterAll with Defa case 6 ⇒ Future(throw new IllegalArgumentException("shouldFoldResultsWithException: expected")) case i ⇒ Future(i) } - intercept[Throwable] { Await.result(Future.fold(futures)(0)(_ + _), remainingOrDefault) }.getMessage should be("shouldFoldResultsWithException: expected") + intercept[Throwable] { Await.result(Future.fold(futures)(0)(_ + _), remainingOrDefault) }.getMessage should ===("shouldFoldResultsWithException: expected") } } @@ -458,7 +458,7 @@ class FutureSpec extends AkkaSpec with Checkers with BeforeAndAfterAll with Defa } "return zero value if folding empty list" in { - Await.result(Future.fold(List[Future[Int]]())(0)(_ + _), timeout.duration) should be(0) + Await.result(Future.fold(List[Future[Int]]())(0)(_ + _), timeout.duration) should ===(0) } "reduce results" in { @@ -472,7 +472,7 @@ class FutureSpec extends AkkaSpec with Checkers with BeforeAndAfterAll with Defa case 6 ⇒ Future(throw new IllegalArgumentException("shouldReduceResultsWithException: expected")) case i ⇒ Future(i) } - intercept[Throwable] { Await.result(Future.reduce(futures)(_ + _), remainingOrDefault) }.getMessage should be("shouldReduceResultsWithException: expected") + intercept[Throwable] { Await.result(Future.reduce(futures)(_ + _), remainingOrDefault) }.getMessage should ===("shouldReduceResultsWithException: expected") } } @@ -629,7 +629,7 @@ class FutureSpec extends AkkaSpec with Checkers with BeforeAndAfterAll with Defa } Await.ready(f, timeout.duration) // TODO re-enable once we're using the batching dispatcher - // failCount.get should be(0) + // failCount.get should ===(0) } } @@ -637,52 +637,52 @@ class FutureSpec extends AkkaSpec with Checkers with BeforeAndAfterAll with Defa def emptyFuture(f: (Future[Any] ⇒ Unit) ⇒ Unit) { "not be completed" in { f(_ should not be ('completed)) } - "not contain a value" in { f(_.value should be(None)) } + "not contain a value" in { f(_.value should ===(None)) } } def futureWithResult(f: ((Future[Any], Any) ⇒ Unit) ⇒ Unit) { "be completed" in { f((future, _) ⇒ future should be('completed)) } - "contain a value" in { f((future, result) ⇒ future.value should be(Some(Success(result)))) } - "return result with 'get'" in { f((future, result) ⇒ Await.result(future, timeout.duration) should be(result)) } - "return result with 'Await.result'" in { f((future, result) ⇒ Await.result(future, timeout.duration) should be(result)) } + "contain a value" in { f((future, result) ⇒ future.value should ===(Some(Success(result)))) } + "return result with 'get'" in { f((future, result) ⇒ Await.result(future, timeout.duration) should ===(result)) } + "return result with 'Await.result'" in { f((future, result) ⇒ Await.result(future, timeout.duration) should ===(result)) } "not timeout" in { f((future, _) ⇒ FutureSpec.ready(future, 0 millis)) } "filter result" in { f { (future, result) ⇒ - Await.result((future filter (_ ⇒ true)), timeout.duration) should be(result) + Await.result((future filter (_ ⇒ true)), timeout.duration) should ===(result) intercept[java.util.NoSuchElementException] { Await.result((future filter (_ ⇒ false)), timeout.duration) } } } - "transform result with map" in { f((future, result) ⇒ Await.result((future map (_.toString.length)), timeout.duration) should be(result.toString.length)) } + "transform result with map" in { f((future, result) ⇒ Await.result((future map (_.toString.length)), timeout.duration) should ===(result.toString.length)) } "compose result with flatMap" in { f { (future, result) ⇒ val r = for (r ← future; p ← Promise.successful("foo").future) yield r.toString + p - Await.result(r, timeout.duration) should be(result.toString + "foo") + Await.result(r, timeout.duration) should ===(result.toString + "foo") } } "perform action with foreach" in { f { (future, result) ⇒ val p = Promise[Any]() future foreach p.success - Await.result(p.future, timeout.duration) should be(result) + Await.result(p.future, timeout.duration) should ===(result) } } "zip properly" in { f { (future, result) ⇒ - Await.result(future zip Promise.successful("foo").future, timeout.duration) should be((result, "foo")) - (intercept[RuntimeException] { Await.result(future zip Promise.failed(new RuntimeException("ohnoes")).future, timeout.duration) }).getMessage should be("ohnoes") + Await.result(future zip Promise.successful("foo").future, timeout.duration) should ===((result, "foo")) + (intercept[RuntimeException] { Await.result(future zip Promise.failed(new RuntimeException("ohnoes")).future, timeout.duration) }).getMessage should ===("ohnoes") } } - "not recover from exception" in { f((future, result) ⇒ Await.result(future.recover({ case _ ⇒ "pigdog" }), timeout.duration) should be(result)) } + "not recover from exception" in { f((future, result) ⇒ Await.result(future.recover({ case _ ⇒ "pigdog" }), timeout.duration) should ===(result)) } "perform action on result" in { f { (future, result) ⇒ val p = Promise[Any]() future.onSuccess { case x ⇒ p.success(x) } - Await.result(p.future, timeout.duration) should be(result) + Await.result(p.future, timeout.duration) should ===(result) } } - "not project a failure" in { f((future, result) ⇒ (intercept[NoSuchElementException] { Await.result(future.failed, timeout.duration) }).getMessage should be("Future.failed not completed with a throwable.")) } + "not project a failure" in { f((future, result) ⇒ (intercept[NoSuchElementException] { Await.result(future.failed, timeout.duration) }).getMessage should ===("Future.failed not completed with a throwable.")) } "not perform action on exception" is pending - "cast using mapTo" in { f((future, result) ⇒ Await.result(future.mapTo[Boolean].recover({ case _: ClassCastException ⇒ false }), timeout.duration) should be(false)) } + "cast using mapTo" in { f((future, result) ⇒ Await.result(future.mapTo[Boolean].recover({ case _: ClassCastException ⇒ false }), timeout.duration) should ===(false)) } } def futureWithException[E <: Throwable: ClassTag](f: ((Future[Any], String) ⇒ Unit) ⇒ Unit) { @@ -692,35 +692,35 @@ class FutureSpec extends AkkaSpec with Checkers with BeforeAndAfterAll with Defa future.value should be('defined) future.value.get should be('failure) val Failure(f) = future.value.get - f.getMessage should be(message) + f.getMessage should ===(message) }) } - "throw exception with 'get'" in { f((future, message) ⇒ (intercept[java.lang.Exception] { Await.result(future, timeout.duration) }).getMessage should be(message)) } - "throw exception with 'Await.result'" in { f((future, message) ⇒ (intercept[java.lang.Exception] { Await.result(future, timeout.duration) }).getMessage should be(message)) } + "throw exception with 'get'" in { f((future, message) ⇒ (intercept[java.lang.Exception] { Await.result(future, timeout.duration) }).getMessage should ===(message)) } + "throw exception with 'Await.result'" in { f((future, message) ⇒ (intercept[java.lang.Exception] { Await.result(future, timeout.duration) }).getMessage should ===(message)) } "retain exception with filter" in { f { (future, message) ⇒ - (intercept[java.lang.Exception] { Await.result(future filter (_ ⇒ true), timeout.duration) }).getMessage should be(message) - (intercept[java.lang.Exception] { Await.result(future filter (_ ⇒ false), timeout.duration) }).getMessage should be(message) + (intercept[java.lang.Exception] { Await.result(future filter (_ ⇒ true), timeout.duration) }).getMessage should ===(message) + (intercept[java.lang.Exception] { Await.result(future filter (_ ⇒ false), timeout.duration) }).getMessage should ===(message) } } - "retain exception with map" in { f((future, message) ⇒ (intercept[java.lang.Exception] { Await.result(future map (_.toString.length), timeout.duration) }).getMessage should be(message)) } - "retain exception with flatMap" in { f((future, message) ⇒ (intercept[java.lang.Exception] { Await.result(future flatMap (_ ⇒ Promise.successful[Any]("foo").future), timeout.duration) }).getMessage should be(message)) } + "retain exception with map" in { f((future, message) ⇒ (intercept[java.lang.Exception] { Await.result(future map (_.toString.length), timeout.duration) }).getMessage should ===(message)) } + "retain exception with flatMap" in { f((future, message) ⇒ (intercept[java.lang.Exception] { Await.result(future flatMap (_ ⇒ Promise.successful[Any]("foo").future), timeout.duration) }).getMessage should ===(message)) } "not perform action with foreach" is pending "zip properly" in { - f { (future, message) ⇒ (intercept[java.lang.Exception] { Await.result(future zip Promise.successful("foo").future, timeout.duration) }).getMessage should be(message) } + f { (future, message) ⇒ (intercept[java.lang.Exception] { Await.result(future zip Promise.successful("foo").future, timeout.duration) }).getMessage should ===(message) } } - "recover from exception" in { f((future, message) ⇒ Await.result(future.recover({ case e if e.getMessage == message ⇒ "pigdog" }), timeout.duration) should be("pigdog")) } + "recover from exception" in { f((future, message) ⇒ Await.result(future.recover({ case e if e.getMessage == message ⇒ "pigdog" }), timeout.duration) should ===("pigdog")) } "not perform action on result" is pending - "project a failure" in { f((future, message) ⇒ Await.result(future.failed, timeout.duration).getMessage should be(message)) } + "project a failure" in { f((future, message) ⇒ Await.result(future.failed, timeout.duration).getMessage should ===(message)) } "perform action on exception" in { f { (future, message) ⇒ val p = Promise[Any]() future.onFailure { case _ ⇒ p.success(message) } - Await.result(p.future, timeout.duration) should be(message) + Await.result(p.future, timeout.duration) should ===(message) } } - "always cast successfully using mapTo" in { f((future, message) ⇒ (evaluating { Await.result(future.mapTo[java.lang.Thread], timeout.duration) } should produce[java.lang.Exception]).getMessage should be(message)) } + "always cast successfully using mapTo" in { f((future, message) ⇒ (evaluating { Await.result(future.mapTo[java.lang.Thread], timeout.duration) } should produce[java.lang.Exception]).getMessage should ===(message)) } } implicit def arbFuture: Arbitrary[Future[Int]] = Arbitrary(for (n ← arbitrary[Int]) yield Future(n)) diff --git a/akka-actor-tests/src/test/scala/akka/dispatch/MailboxConfigSpec.scala b/akka-actor-tests/src/test/scala/akka/dispatch/MailboxConfigSpec.scala index 20b6027f15..48429ecff3 100644 --- a/akka-actor-tests/src/test/scala/akka/dispatch/MailboxConfigSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/dispatch/MailboxConfigSpec.scala @@ -43,23 +43,23 @@ abstract class MailboxSpec extends AkkaSpec with BeforeAndAfterAll with BeforeAn "create a bounded mailbox with 10 capacity and with push timeout" in { val config = BoundedMailbox(10, 10 milliseconds) - config.capacity should be(10) + config.capacity should ===(10) val q = factory(config) ensureInitialMailboxState(config, q) for (i ← 1 to config.capacity) q.enqueue(testActor, exampleMessage) - q.numberOfMessages should be(config.capacity) - q.hasMessages should be(true) + q.numberOfMessages should ===(config.capacity) + q.hasMessages should ===(true) system.eventStream.subscribe(testActor, classOf[DeadLetter]) q.enqueue(testActor, exampleMessage) expectMsg(DeadLetter(exampleMessage.message, system.deadLetters, testActor)) system.eventStream.unsubscribe(testActor, classOf[DeadLetter]) - q.dequeue should be(exampleMessage) - q.numberOfMessages should be(config.capacity - 1) - q.hasMessages should be(true) + q.dequeue should ===(exampleMessage) + q.numberOfMessages should ===(config.capacity - 1) + q.hasMessages should ===(true) } "dequeue what was enqueued properly for unbounded mailboxes" in { @@ -86,16 +86,16 @@ abstract class MailboxSpec extends AkkaSpec with BeforeAndAfterAll with BeforeAn def ensureMailboxSize(q: MessageQueue, expected: Int): Unit = q.numberOfMessages match { case -1 | `expected` ⇒ - q.hasMessages should be(expected != 0) + q.hasMessages should ===(expected != 0) case other ⇒ - other should be(expected) - q.hasMessages should be(expected != 0) + other should ===(expected) + q.hasMessages should ===(expected != 0) } def ensureSingleConsumerEnqueueDequeue(config: MailboxType) { val q = factory(config) ensureMailboxSize(q, 0) - q.dequeue should be(null) + q.dequeue should ===(null) for (i ← 1 to 100) { q.enqueue(testActor, exampleMessage) ensureMailboxSize(q, i) @@ -104,11 +104,11 @@ abstract class MailboxSpec extends AkkaSpec with BeforeAndAfterAll with BeforeAn ensureMailboxSize(q, 100) for (i ← 99 to 0 by -1) { - q.dequeue() should be(exampleMessage) + q.dequeue() should ===(exampleMessage) ensureMailboxSize(q, i) } - q.dequeue should be(null) + q.dequeue should ===(null) ensureMailboxSize(q, 0) } @@ -117,13 +117,13 @@ abstract class MailboxSpec extends AkkaSpec with BeforeAndAfterAll with BeforeAn q match { case aQueue: BlockingQueue[_] ⇒ config match { - case BoundedMailbox(capacity, _) ⇒ aQueue.remainingCapacity should be(capacity) - case UnboundedMailbox() ⇒ aQueue.remainingCapacity should be(Int.MaxValue) + case BoundedMailbox(capacity, _) ⇒ aQueue.remainingCapacity should ===(capacity) + case UnboundedMailbox() ⇒ aQueue.remainingCapacity should ===(Int.MaxValue) } case _ ⇒ } - q.numberOfMessages should be(0) - q.hasMessages should be(false) + q.numberOfMessages should ===(0) + q.hasMessages should ===(false) } def testEnqueueDequeue(config: MailboxType, @@ -166,14 +166,14 @@ abstract class MailboxSpec extends AkkaSpec with BeforeAndAfterAll with BeforeAn val ps = producers.map(Await.result(_, remainingOrDefault)) val cs = consumers.map(Await.result(_, remainingOrDefault)) - ps.map(_.size).sum should be(enqueueN) //Must have produced 1000 messages - cs.map(_.size).sum should be(dequeueN) //Must have consumed all produced messages + ps.map(_.size).sum should ===(enqueueN) //Must have produced 1000 messages + cs.map(_.size).sum should ===(dequeueN) //Must have consumed all produced messages //No message is allowed to be consumed by more than one consumer - cs.flatten.distinct.size should be(dequeueN) + cs.flatten.distinct.size should ===(dequeueN) //All consumed messages should have been produced - (cs.flatten diff ps.flatten).size should be(0) + (cs.flatten diff ps.flatten).size should ===(0) //The ones that were produced and not consumed - (ps.flatten diff cs.flatten).size should be(enqueueN - dequeueN) + (ps.flatten diff cs.flatten).size should ===(enqueueN - dequeueN) } } } @@ -241,7 +241,7 @@ class CustomMailboxSpec extends AkkaSpec(CustomMailboxSpec.config) { case _ ⇒ true }, 1 second, 10 millis) val queue = actor.asInstanceOf[ActorRefWithCell].underlying.asInstanceOf[ActorCell].mailbox.messageQueue - queue.getClass should be(classOf[CustomMailboxSpec.MyMailbox]) + queue.getClass should ===(classOf[CustomMailboxSpec.MyMailbox]) } } } diff --git a/akka-actor-tests/src/test/scala/akka/dispatch/PriorityDispatcherSpec.scala b/akka-actor-tests/src/test/scala/akka/dispatch/PriorityDispatcherSpec.scala index 545371d3d5..915f8ea208 100644 --- a/akka-actor-tests/src/test/scala/akka/dispatch/PriorityDispatcherSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/dispatch/PriorityDispatcherSpec.scala @@ -74,7 +74,7 @@ class PriorityDispatcherSpec extends AkkaSpec(PriorityDispatcherSpec.config) wit })) - expectMsgType[List[_]] should be(msgs) + expectMsgType[List[Int]] should ===(msgs) } } diff --git a/akka-actor-tests/src/test/scala/akka/dispatch/StablePriorityDispatcherSpec.scala b/akka-actor-tests/src/test/scala/akka/dispatch/StablePriorityDispatcherSpec.scala index df0e9a4bfc..309b136ae9 100644 --- a/akka-actor-tests/src/test/scala/akka/dispatch/StablePriorityDispatcherSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/dispatch/StablePriorityDispatcherSpec.scala @@ -82,7 +82,7 @@ class StablePriorityDispatcherSpec extends AkkaSpec(StablePriorityDispatcherSpec // should come out in the same order in which they were sent. val lo = (1 to 100) toList val hi = shuffled filter { _ > 100 } - expectMsgType[List[_]] should be(lo ++ hi) + expectMsgType[List[Int]] should ===(lo ++ hi) } } -} \ No newline at end of file +} diff --git a/akka-actor-tests/src/test/scala/akka/dispatch/sysmsg/SystemMessageListSpec.scala b/akka-actor-tests/src/test/scala/akka/dispatch/sysmsg/SystemMessageListSpec.scala index cd623b4a02..a481676d41 100644 --- a/akka-actor-tests/src/test/scala/akka/dispatch/sysmsg/SystemMessageListSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/dispatch/sysmsg/SystemMessageListSpec.scala @@ -12,22 +12,22 @@ class SystemMessageListSpec extends AkkaSpec { "The SystemMessageList value class" must { "handle empty lists correctly" in { - LNil.head should be(null) - LNil.isEmpty should be(true) - (LNil.reverse == ENil) should be(true) + LNil.head should ===(null) + LNil.isEmpty should ===(true) + (LNil.reverse == ENil) should ===(true) } "able to append messages" in { val create0 = Failed(null, null, 0) val create1 = Failed(null, null, 1) val create2 = Failed(null, null, 2) - ((create0 :: LNil).head eq create0) should be(true) - ((create1 :: create0 :: LNil).head eq create1) should be(true) - ((create2 :: create1 :: create0 :: LNil).head eq create2) should be(true) + ((create0 :: LNil).head eq create0) should ===(true) + ((create1 :: create0 :: LNil).head eq create1) should ===(true) + ((create2 :: create1 :: create0 :: LNil).head eq create2) should ===(true) - (create2.next eq create1) should be(true) - (create1.next eq create0) should be(true) - (create0.next eq null) should be(true) + (create2.next eq create1) should ===(true) + (create1.next eq create0) should ===(true) + (create0.next eq null) should ===(true) } "able to deconstruct head and tail" in { @@ -36,10 +36,10 @@ class SystemMessageListSpec extends AkkaSpec { val create2 = Failed(null, null, 2) val list = create2 :: create1 :: create0 :: LNil - (list.head eq create2) should be(true) - (list.tail.head eq create1) should be(true) - (list.tail.tail.head eq create0) should be(true) - (list.tail.tail.tail.head eq null) should be(true) + (list.head eq create2) should ===(true) + (list.tail.head eq create1) should ===(true) + (list.tail.tail.head eq create0) should ===(true) + (list.tail.tail.tail.head eq null) should ===(true) } "properly report size and emptyness" in { @@ -48,17 +48,17 @@ class SystemMessageListSpec extends AkkaSpec { val create2 = Failed(null, null, 2) val list = create2 :: create1 :: create0 :: LNil - list.size should be(3) - list.isEmpty should be(false) + list.size should ===(3) + list.isEmpty should ===(false) - list.tail.size should be(2) - list.tail.isEmpty should be(false) + list.tail.size should ===(2) + list.tail.isEmpty should ===(false) - list.tail.tail.size should be(1) - list.tail.tail.isEmpty should be(false) + list.tail.tail.size should ===(1) + list.tail.tail.isEmpty should ===(false) - list.tail.tail.tail.size should be(0) - list.tail.tail.tail.isEmpty should be(true) + list.tail.tail.tail.size should ===(0) + list.tail.tail.tail.isEmpty should ===(true) } @@ -69,17 +69,17 @@ class SystemMessageListSpec extends AkkaSpec { val list = create2 :: create1 :: create0 :: LNil val listRev: EarliestFirstSystemMessageList = list.reverse - listRev.isEmpty should be(false) - listRev.size should be(3) + listRev.isEmpty should ===(false) + listRev.size should ===(3) - (listRev.head eq create0) should be(true) - (listRev.tail.head eq create1) should be(true) - (listRev.tail.tail.head eq create2) should be(true) - (listRev.tail.tail.tail.head eq null) should be(true) + (listRev.head eq create0) should ===(true) + (listRev.tail.head eq create1) should ===(true) + (listRev.tail.tail.head eq create2) should ===(true) + (listRev.tail.tail.tail.head eq null) should ===(true) - (create0.next eq create1) should be(true) - (create1.next eq create2) should be(true) - (create2.next eq null) should be(true) + (create0.next eq create1) should ===(true) + (create1.next eq create2) should ===(true) + (create2.next eq null) should ===(true) } } @@ -99,17 +99,17 @@ class SystemMessageListSpec extends AkkaSpec { val list = revList reverse_::: fwdList - (list.head eq create0) should be(true) - (list.tail.head eq create1) should be(true) - (list.tail.tail.head eq create2) should be(true) - (list.tail.tail.tail.head eq create3) should be(true) - (list.tail.tail.tail.tail.head eq create4) should be(true) - (list.tail.tail.tail.tail.tail.head eq create5) should be(true) - (list.tail.tail.tail.tail.tail.tail.head eq null) should be(true) + (list.head eq create0) should ===(true) + (list.tail.head eq create1) should ===(true) + (list.tail.tail.head eq create2) should ===(true) + (list.tail.tail.tail.head eq create3) should ===(true) + (list.tail.tail.tail.tail.head eq create4) should ===(true) + (list.tail.tail.tail.tail.tail.head eq create5) should ===(true) + (list.tail.tail.tail.tail.tail.tail.head eq null) should ===(true) - (LNil reverse_::: ENil) == ENil should be(true) - ((create0 :: LNil reverse_::: ENil).head eq create0) should be(true) - ((LNil reverse_::: create0 :: ENil).head eq create0) should be(true) + (LNil reverse_::: ENil) == ENil should ===(true) + ((create0 :: LNil reverse_::: ENil).head eq create0) should ===(true) + ((LNil reverse_::: create0 :: ENil).head eq create0) should ===(true) } } diff --git a/akka-actor-tests/src/test/scala/akka/event/EventBusSpec.scala b/akka-actor-tests/src/test/scala/akka/event/EventBusSpec.scala index 94d18f59e0..94929b9ad2 100644 --- a/akka-actor-tests/src/test/scala/akka/event/EventBusSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/event/EventBusSpec.scala @@ -52,37 +52,37 @@ abstract class EventBusSpec(busName: String, conf: Config = ConfigFactory.empty( val subscriber = createNewSubscriber() "allow subscribers" in { - bus.subscribe(subscriber, classifier) should be(true) + bus.subscribe(subscriber, classifier) should ===(true) } "allow to unsubscribe already existing subscriber" in { - bus.unsubscribe(subscriber, classifier) should be(true) + bus.unsubscribe(subscriber, classifier) should ===(true) } "not allow to unsubscribe non-existing subscriber" in { val sub = createNewSubscriber() - bus.unsubscribe(sub, classifier) should be(false) + bus.unsubscribe(sub, classifier) should ===(false) disposeSubscriber(system, sub) } "not allow for the same subscriber to subscribe to the same channel twice" in { - bus.subscribe(subscriber, classifier) should be(true) - bus.subscribe(subscriber, classifier) should be(false) - bus.unsubscribe(subscriber, classifier) should be(true) + bus.subscribe(subscriber, classifier) should ===(true) + bus.subscribe(subscriber, classifier) should ===(false) + bus.unsubscribe(subscriber, classifier) should ===(true) } "not allow for the same subscriber to unsubscribe to the same channel twice" in { - bus.subscribe(subscriber, classifier) should be(true) - bus.unsubscribe(subscriber, classifier) should be(true) - bus.unsubscribe(subscriber, classifier) should be(false) + bus.subscribe(subscriber, classifier) should ===(true) + bus.unsubscribe(subscriber, classifier) should ===(true) + bus.unsubscribe(subscriber, classifier) should ===(false) } "allow to add multiple subscribers" in { val subscribers = (1 to 10) map { _ ⇒ createNewSubscriber() } val events = createEvents(10) val classifiers = events map getClassifierFor - subscribers.zip(classifiers) forall { case (s, c) ⇒ bus.subscribe(s, c) } should be(true) - subscribers.zip(classifiers) forall { case (s, c) ⇒ bus.unsubscribe(s, c) } should be(true) + subscribers.zip(classifiers) forall { case (s, c) ⇒ bus.subscribe(s, c) } should ===(true) + subscribers.zip(classifiers) forall { case (s, c) ⇒ bus.unsubscribe(s, c) } should ===(true) subscribers foreach (disposeSubscriber(system, _)) } @@ -114,10 +114,10 @@ abstract class EventBusSpec(busName: String, conf: Config = ConfigFactory.empty( "publish the given event to all intended subscribers" in { val range = 0 until 10 val subscribers = range map (_ ⇒ createNewSubscriber()) - subscribers foreach { s ⇒ bus.subscribe(s, classifier) should be(true) } + subscribers foreach { s ⇒ bus.subscribe(s, classifier) should ===(true) } bus.publish(event) range foreach { _ ⇒ expectMsg(event) } - subscribers foreach { s ⇒ bus.unsubscribe(s, classifier) should be(true); disposeSubscriber(system, s) } + subscribers foreach { s ⇒ bus.unsubscribe(s, classifier) should ===(true); disposeSubscriber(system, s) } } "not publish the given event to any other subscribers than the intended ones" in { diff --git a/akka-actor-tests/src/test/scala/akka/event/EventStreamSpec.scala b/akka-actor-tests/src/test/scala/akka/event/EventStreamSpec.scala index a3ae2bc68d..0db5bcd756 100644 --- a/akka-actor-tests/src/test/scala/akka/event/EventStreamSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/event/EventStreamSpec.scala @@ -96,13 +96,13 @@ class EventStreamSpec extends AkkaSpec(EventStreamSpec.config) { "not allow null as subscriber" in { val bus = new EventStream(system, true) - intercept[IllegalArgumentException] { bus.subscribe(null, classOf[M]) }.getMessage should be("subscriber is null") + intercept[IllegalArgumentException] { bus.subscribe(null, classOf[M]) }.getMessage should ===("subscriber is null") } "not allow null as unsubscriber" in { val bus = new EventStream(system, true) - intercept[IllegalArgumentException] { bus.unsubscribe(null, classOf[M]) }.getMessage should be("subscriber is null") - intercept[IllegalArgumentException] { bus.unsubscribe(null) }.getMessage should be("subscriber is null") + intercept[IllegalArgumentException] { bus.unsubscribe(null, classOf[M]) }.getMessage should ===("subscriber is null") + intercept[IllegalArgumentException] { bus.unsubscribe(null) }.getMessage should ===("subscriber is null") } "be able to log unhandled messages" in { @@ -142,16 +142,16 @@ class EventStreamSpec extends AkkaSpec(EventStreamSpec.config) { val c = new C val bus = new EventStream(system, false) within(2 seconds) { - bus.subscribe(testActor, classOf[B3]) should be(true) + bus.subscribe(testActor, classOf[B3]) should ===(true) bus.publish(c) bus.publish(b2) expectMsg(b2) - bus.subscribe(testActor, classOf[A]) should be(true) + bus.subscribe(testActor, classOf[A]) should ===(true) bus.publish(c) expectMsg(c) bus.publish(b1) expectMsg(b1) - bus.unsubscribe(testActor, classOf[B2]) should be(true) + bus.unsubscribe(testActor, classOf[B2]) should ===(true) bus.publish(c) bus.publish(b2) bus.publish(a) @@ -167,21 +167,21 @@ class EventStreamSpec extends AkkaSpec(EventStreamSpec.config) { val tm2 = new CCATBT val a1, a2, a3, a4 = TestProbe() - es.subscribe(a1.ref, classOf[AT]) should be(true) - es.subscribe(a2.ref, classOf[BT]) should be(true) - es.subscribe(a3.ref, classOf[CC]) should be(true) - es.subscribe(a4.ref, classOf[CCATBT]) should be(true) + es.subscribe(a1.ref, classOf[AT]) should ===(true) + es.subscribe(a2.ref, classOf[BT]) should ===(true) + es.subscribe(a3.ref, classOf[CC]) should ===(true) + es.subscribe(a4.ref, classOf[CCATBT]) should ===(true) es.publish(tm1) es.publish(tm2) - a1.expectMsgType[AT] should be(tm2) - a2.expectMsgType[BT] should be(tm2) - a3.expectMsgType[CC] should be(tm1) - a3.expectMsgType[CC] should be(tm2) - a4.expectMsgType[CCATBT] should be(tm2) - es.unsubscribe(a1.ref, classOf[AT]) should be(true) - es.unsubscribe(a2.ref, classOf[BT]) should be(true) - es.unsubscribe(a3.ref, classOf[CC]) should be(true) - es.unsubscribe(a4.ref, classOf[CCATBT]) should be(true) + a1.expectMsgType[AT] should ===(tm2) + a2.expectMsgType[BT] should ===(tm2) + a3.expectMsgType[CC] should ===(tm1) + a3.expectMsgType[CC] should ===(tm2) + a4.expectMsgType[CCATBT] should ===(tm2) + es.unsubscribe(a1.ref, classOf[AT]) should ===(true) + es.unsubscribe(a2.ref, classOf[BT]) should ===(true) + es.unsubscribe(a3.ref, classOf[CC]) should ===(true) + es.unsubscribe(a4.ref, classOf[CCATBT]) should ===(true) } "manage sub-channels using classes and traits (update on unsubscribe)" in { @@ -190,20 +190,20 @@ class EventStreamSpec extends AkkaSpec(EventStreamSpec.config) { val tm2 = new CCATBT val a1, a2, a3, a4 = TestProbe() - es.subscribe(a1.ref, classOf[AT]) should be(true) - es.subscribe(a2.ref, classOf[BT]) should be(true) - es.subscribe(a3.ref, classOf[CC]) should be(true) - es.subscribe(a4.ref, classOf[CCATBT]) should be(true) - es.unsubscribe(a3.ref, classOf[CC]) should be(true) + es.subscribe(a1.ref, classOf[AT]) should ===(true) + es.subscribe(a2.ref, classOf[BT]) should ===(true) + es.subscribe(a3.ref, classOf[CC]) should ===(true) + es.subscribe(a4.ref, classOf[CCATBT]) should ===(true) + es.unsubscribe(a3.ref, classOf[CC]) should ===(true) es.publish(tm1) es.publish(tm2) - a1.expectMsgType[AT] should be(tm2) - a2.expectMsgType[BT] should be(tm2) + a1.expectMsgType[AT] should ===(tm2) + a2.expectMsgType[BT] should ===(tm2) a3.expectNoMsg(1 second) - a4.expectMsgType[CCATBT] should be(tm2) - es.unsubscribe(a1.ref, classOf[AT]) should be(true) - es.unsubscribe(a2.ref, classOf[BT]) should be(true) - es.unsubscribe(a4.ref, classOf[CCATBT]) should be(true) + a4.expectMsgType[CCATBT] should ===(tm2) + es.unsubscribe(a1.ref, classOf[AT]) should ===(true) + es.unsubscribe(a2.ref, classOf[BT]) should ===(true) + es.unsubscribe(a4.ref, classOf[CCATBT]) should ===(true) } "manage sub-channels using classes and traits (update on unsubscribe all)" in { @@ -212,20 +212,20 @@ class EventStreamSpec extends AkkaSpec(EventStreamSpec.config) { val tm2 = new CCATBT val a1, a2, a3, a4 = TestProbe() - es.subscribe(a1.ref, classOf[AT]) should be(true) - es.subscribe(a2.ref, classOf[BT]) should be(true) - es.subscribe(a3.ref, classOf[CC]) should be(true) - es.subscribe(a4.ref, classOf[CCATBT]) should be(true) + es.subscribe(a1.ref, classOf[AT]) should ===(true) + es.subscribe(a2.ref, classOf[BT]) should ===(true) + es.subscribe(a3.ref, classOf[CC]) should ===(true) + es.subscribe(a4.ref, classOf[CCATBT]) should ===(true) es.unsubscribe(a3.ref) es.publish(tm1) es.publish(tm2) - a1.expectMsgType[AT] should be(tm2) - a2.expectMsgType[BT] should be(tm2) + a1.expectMsgType[AT] should ===(tm2) + a2.expectMsgType[BT] should ===(tm2) a3.expectNoMsg(1 second) - a4.expectMsgType[CCATBT] should be(tm2) - es.unsubscribe(a1.ref, classOf[AT]) should be(true) - es.unsubscribe(a2.ref, classOf[BT]) should be(true) - es.unsubscribe(a4.ref, classOf[CCATBT]) should be(true) + a4.expectMsgType[CCATBT] should ===(tm2) + es.unsubscribe(a1.ref, classOf[AT]) should ===(true) + es.unsubscribe(a2.ref, classOf[BT]) should ===(true) + es.unsubscribe(a4.ref, classOf[CCATBT]) should ===(true) } "manage sub-channels using classes and traits (update on publish)" in { @@ -234,14 +234,14 @@ class EventStreamSpec extends AkkaSpec(EventStreamSpec.config) { val tm2 = new CCATBT val a1, a2 = TestProbe() - es.subscribe(a1.ref, classOf[AT]) should be(true) - es.subscribe(a2.ref, classOf[BT]) should be(true) + es.subscribe(a1.ref, classOf[AT]) should ===(true) + es.subscribe(a2.ref, classOf[BT]) should ===(true) es.publish(tm1) es.publish(tm2) - a1.expectMsgType[AT] should be(tm2) - a2.expectMsgType[BT] should be(tm2) - es.unsubscribe(a1.ref, classOf[AT]) should be(true) - es.unsubscribe(a2.ref, classOf[BT]) should be(true) + a1.expectMsgType[AT] should ===(tm2) + a2.expectMsgType[BT] should ===(tm2) + es.unsubscribe(a1.ref, classOf[AT]) should ===(true) + es.unsubscribe(a2.ref, classOf[BT]) should ===(true) } "manage sub-channels using classes and traits (unsubscribe classes used with trait)" in { @@ -250,20 +250,20 @@ class EventStreamSpec extends AkkaSpec(EventStreamSpec.config) { val tm2 = new CCATBT val a1, a2, a3 = TestProbe() - es.subscribe(a1.ref, classOf[AT]) should be(true) - es.subscribe(a2.ref, classOf[BT]) should be(true) - es.subscribe(a2.ref, classOf[CC]) should be(true) - es.subscribe(a3.ref, classOf[CC]) should be(true) - es.unsubscribe(a2.ref, classOf[CC]) should be(true) - es.unsubscribe(a3.ref, classOf[CCATBT]) should be(true) + es.subscribe(a1.ref, classOf[AT]) should ===(true) + es.subscribe(a2.ref, classOf[BT]) should ===(true) + es.subscribe(a2.ref, classOf[CC]) should ===(true) + es.subscribe(a3.ref, classOf[CC]) should ===(true) + es.unsubscribe(a2.ref, classOf[CC]) should ===(true) + es.unsubscribe(a3.ref, classOf[CCATBT]) should ===(true) es.publish(tm1) es.publish(tm2) - a1.expectMsgType[AT] should be(tm2) - a2.expectMsgType[BT] should be(tm2) - a3.expectMsgType[CC] should be(tm1) - es.unsubscribe(a1.ref, classOf[AT]) should be(true) - es.unsubscribe(a2.ref, classOf[BT]) should be(true) - es.unsubscribe(a3.ref, classOf[CC]) should be(true) + a1.expectMsgType[AT] should ===(tm2) + a2.expectMsgType[BT] should ===(tm2) + a3.expectMsgType[CC] should ===(tm1) + es.unsubscribe(a1.ref, classOf[AT]) should ===(true) + es.unsubscribe(a2.ref, classOf[BT]) should ===(true) + es.unsubscribe(a3.ref, classOf[CC]) should ===(true) } "manage sub-channels using classes and traits (subscribe after publish)" in { @@ -271,16 +271,16 @@ class EventStreamSpec extends AkkaSpec(EventStreamSpec.config) { val tm1 = new CCATBT val a1, a2 = TestProbe() - es.subscribe(a1.ref, classOf[AT]) should be(true) + es.subscribe(a1.ref, classOf[AT]) should ===(true) es.publish(tm1) - a1.expectMsgType[AT] should be(tm1) + a1.expectMsgType[AT] should ===(tm1) a2.expectNoMsg(1 second) - es.subscribe(a2.ref, classOf[BTT]) should be(true) + es.subscribe(a2.ref, classOf[BTT]) should ===(true) es.publish(tm1) - a1.expectMsgType[AT] should be(tm1) - a2.expectMsgType[BTT] should be(tm1) - es.unsubscribe(a1.ref, classOf[AT]) should be(true) - es.unsubscribe(a2.ref, classOf[BTT]) should be(true) + a1.expectMsgType[AT] should ===(tm1) + a2.expectMsgType[BTT] should ===(tm1) + es.unsubscribe(a1.ref, classOf[AT]) should ===(true) + es.unsubscribe(a2.ref, classOf[BTT]) should ===(true) } "unsubscribe an actor on its termination" in { @@ -296,8 +296,8 @@ class EventStreamSpec extends AkkaSpec(EventStreamSpec.config) { }), "to-be-killed") es.subscribe(a2.ref, classOf[Any]) - es.subscribe(target, classOf[A]) should be(true) - es.subscribe(target, classOf[A]) should be(false) + es.subscribe(target, classOf[A]) should ===(true) + es.subscribe(target, classOf[A]) should ===(false) target ! PoisonPill fishForDebugMessage(a2, s"unsubscribing $target from all channels") @@ -330,10 +330,10 @@ class EventStreamSpec extends AkkaSpec(EventStreamSpec.config) { es.subscribe(a2.ref, classOf[Any]) // target1 is Terminated; When subscribing, it will be unsubscribed by the Unsubscriber right away - es.subscribe(target, classOf[A]) should be(true) + es.subscribe(target, classOf[A]) should ===(true) fishForDebugMessage(a2, s"unsubscribing $target from all channels") - es.subscribe(target, classOf[A]) should be(true) + es.subscribe(target, classOf[A]) should ===(true) fishForDebugMessage(a2, s"unsubscribing $target from all channels") } finally { shutdown(sys) diff --git a/akka-actor-tests/src/test/scala/akka/event/LoggerSpec.scala b/akka-actor-tests/src/test/scala/akka/event/LoggerSpec.scala index 229c3da911..367fc429b1 100644 --- a/akka-actor-tests/src/test/scala/akka/event/LoggerSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/event/LoggerSpec.scala @@ -154,7 +154,7 @@ class LoggerSpec extends WordSpec with Matchers { "not log messages to standard output" in { val out = createSystemAndLogToBuffer("noLogging", noLoggingConfig, false) - out.size should be(0) + out.size should ===(0) } } @@ -231,7 +231,7 @@ class LoggerSpec extends WordSpec with Matchers { val minutes = c.get(Calendar.MINUTE) val seconds = c.get(Calendar.SECOND) val ms = c.get(Calendar.MILLISECOND) - Helpers.currentTimeMillisToUTCString(timestamp) should be(f"$hours%02d:$minutes%02d:$seconds%02d.$ms%03dUTC") + Helpers.currentTimeMillisToUTCString(timestamp) should ===(f"$hours%02d:$minutes%02d:$seconds%02d.$ms%03dUTC") } } diff --git a/akka-actor-tests/src/test/scala/akka/io/TcpConnectionSpec.scala b/akka-actor-tests/src/test/scala/akka/io/TcpConnectionSpec.scala index c56ea9f829..c6e8f6a58a 100644 --- a/akka-actor-tests/src/test/scala/akka/io/TcpConnectionSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/io/TcpConnectionSpec.scala @@ -83,7 +83,7 @@ class TcpConnectionSpec extends AkkaSpec(""" run { val connectionActor = createConnectionActor(options = Vector(Inet.SO.ReuseAddress(true))) val clientChannel = connectionActor.underlyingActor.channel - clientChannel.socket.getReuseAddress should be(true) + clientChannel.socket.getReuseAddress should ===(true) } } @@ -92,10 +92,10 @@ class TcpConnectionSpec extends AkkaSpec(""" // Workaround for systems where SO_KEEPALIVE is true by default val connectionActor = createConnectionActor(options = Vector(SO.KeepAlive(false))) val clientChannel = connectionActor.underlyingActor.channel - clientChannel.socket.getKeepAlive should be(true) // only set after connection is established + clientChannel.socket.getKeepAlive should ===(true) // only set after connection is established EventFilter.warning(pattern = "registration timeout", occurrences = 1) intercept { selector.send(connectionActor, ChannelConnectable) - clientChannel.socket.getKeepAlive should be(false) + clientChannel.socket.getKeepAlive should ===(false) } } } @@ -125,14 +125,14 @@ class TcpConnectionSpec extends AkkaSpec(""" serverSideChannel.socket.setSendBufferSize(150000) val wrote = serverSideChannel.write(buffer) - wrote should be(DataSize) + wrote should ===(DataSize) expectNoMsg(1000.millis) // data should have been transferred fully by now selector.send(connectionActor, ChannelReadable) - connectionHandler.expectMsgType[Received].data.length should be(bufferSize) - connectionHandler.expectMsgType[Received].data.length should be(1500) + connectionHandler.expectMsgType[Received].data.length should ===(bufferSize) + connectionHandler.expectMsgType[Received].data.length should ===(1500) } } @@ -148,7 +148,7 @@ class TcpConnectionSpec extends AkkaSpec(""" userHandler.expectMsg(Connected(serverAddress, clientSideChannel.socket.getLocalSocketAddress.asInstanceOf[InetSocketAddress])) userHandler.send(connectionActor, Register(userHandler.ref)) - userHandler.expectMsgType[Received].data.decodeString("ASCII") should be("immediatedata") + userHandler.expectMsgType[Received].data.decodeString("ASCII") should ===("immediatedata") ignoreWindowsWorkaroundForTicket15766() interestCallReceiver.expectMsg(OP_READ) } @@ -161,22 +161,22 @@ class TcpConnectionSpec extends AkkaSpec(""" // reply to write commander with Ack val ackedWrite = Write(ByteString("testdata"), Ack) val buffer = ByteBuffer.allocate(100) - serverSideChannel.read(buffer) should be(0) + serverSideChannel.read(buffer) should ===(0) writer.send(connectionActor, ackedWrite) writer.expectMsg(Ack) pullFromServerSide(remaining = 8, into = buffer) buffer.flip() - buffer.limit should be(8) + buffer.limit should ===(8) // not reply to write commander for writes without Ack val unackedWrite = Write(ByteString("morestuff!")) buffer.clear() - serverSideChannel.read(buffer) should be(0) + serverSideChannel.read(buffer) should ===(0) writer.send(connectionActor, unackedWrite) writer.expectNoMsg(500.millis) pullFromServerSide(remaining = 10, into = buffer) buffer.flip() - ByteString(buffer).utf8String should be("morestuff!") + ByteString(buffer).utf8String should ===("morestuff!") } } @@ -192,13 +192,13 @@ class TcpConnectionSpec extends AkkaSpec(""" val write = Write(testData, Ack) val buffer = ByteBuffer.allocate(bufferSize) - serverSideChannel.read(buffer) should be(0) + serverSideChannel.read(buffer) should ===(0) writer.send(connectionActor, write) pullFromServerSide(remaining = bufferSize, into = buffer) buffer.flip() - buffer.limit should be(bufferSize) + buffer.limit should ===(bufferSize) - ByteString(buffer) should be(testData) + ByteString(buffer) should ===(testData) } } @@ -261,12 +261,12 @@ class TcpConnectionSpec extends AkkaSpec(""" // reply to write commander with Ack val buffer = ByteBuffer.allocate(100) - serverSideChannel.read(buffer) should be(0) + serverSideChannel.read(buffer) should ===(0) writer.send(connectionActor, compoundWrite) pullFromServerSide(remaining = 15, into = buffer) buffer.flip() - ByteString(buffer).utf8String should be("test1test2test4") + ByteString(buffer).utf8String should ===("test1test2test4") writer.expectMsg(Ack(1)) writer.expectMsg(Ack(3)) writer.expectMsg(Ack(4)) @@ -379,7 +379,7 @@ class TcpConnectionSpec extends AkkaSpec(""" connectionActor ! ResumeReading interestCallReceiver.expectMsg(OP_READ) selector.send(connectionActor, ChannelReadable) - connectionHandler.expectMsgType[Received].data.decodeString("ASCII") should be(ts) + connectionHandler.expectMsgType[Received].data.decodeString("ASCII") should ===(ts) interestCallReceiver.expectNoMsg(100.millis) connectionHandler.expectNoMsg(100.millis) @@ -387,7 +387,7 @@ class TcpConnectionSpec extends AkkaSpec(""" connectionActor ! ResumeReading interestCallReceiver.expectMsg(OP_READ) selector.send(connectionActor, ChannelReadable) - connectionHandler.expectMsgType[Received].data.decodeString("ASCII") should be(us) + connectionHandler.expectMsgType[Received].data.decodeString("ASCII") should ===(us) // make sure that after reading all pending data we don't yet register for reading more data interestCallReceiver.expectNoMsg(100.millis) @@ -400,7 +400,7 @@ class TcpConnectionSpec extends AkkaSpec(""" interestCallReceiver.expectMsg(OP_READ) selector.send(connectionActor, ChannelReadable) - connectionHandler.expectMsgType[Received].data.decodeString("ASCII") should be(vs) + connectionHandler.expectMsgType[Received].data.decodeString("ASCII") should ===(vs) } finally system.shutdown() } @@ -428,7 +428,7 @@ class TcpConnectionSpec extends AkkaSpec(""" serverSelectionKey should be(selectedAs(OP_READ, 2.seconds)) val buffer = ByteBuffer.allocate(1) - serverSideChannel.read(buffer) should be(-1) + serverSideChannel.read(buffer) should ===(-1) } } @@ -454,7 +454,7 @@ class TcpConnectionSpec extends AkkaSpec(""" windowsWorkaroundToDetectAbort() serverSideChannel.read(buffer) } should produce[IOException] - thrown.getMessage should be(ConnectionResetByPeerMessage) + thrown.getMessage should ===(ConnectionResetByPeerMessage) } } @@ -490,7 +490,7 @@ class TcpConnectionSpec extends AkkaSpec(""" val buffer = ByteBuffer.allocate(1) serverSelectionKey should be(selectedAs(OP_READ, 2.seconds)) - serverSideChannel.read(buffer) should be(-1) + serverSideChannel.read(buffer) should ===(-1) closeServerSideAndWaitForClientReadable() @@ -525,7 +525,7 @@ class TcpConnectionSpec extends AkkaSpec(""" val buffer = ByteBuffer.allocate(1) serverSelectionKey should be(selectedAs(SelectionKey.OP_READ, 2.seconds)) - serverSideChannel.read(buffer) should be(-1) + serverSideChannel.read(buffer) should ===(-1) closeServerSideAndWaitForClientReadable() @@ -588,7 +588,7 @@ class TcpConnectionSpec extends AkkaSpec(""" abortClose(serverSideChannel) selector.send(connectionActor, ChannelReadable) val err = connectionHandler.expectMsgType[ErrorClosed] - err.cause should be(ConnectionResetByPeerMessage) + err.cause should ===(ConnectionResetByPeerMessage) // wait a while connectionHandler.expectNoMsg(200.millis) @@ -623,7 +623,7 @@ class TcpConnectionSpec extends AkkaSpec(""" // This timeout should be large enough to work on Windows sel.select(3000) - key.isConnectable should be(true) + key.isConnectable should ===(true) val forceThisLazyVal = connectionActor.toString Thread.sleep(300) selector.send(connectionActor, ChannelConnectable) @@ -682,7 +682,7 @@ class TcpConnectionSpec extends AkkaSpec(""" EventFilter[DeathPactException](occurrences = 1) intercept { system.stop(connectionHandler.ref) val deaths = Set(expectMsgType[Terminated].actor, expectMsgType[Terminated].actor) - deaths should be(Set(connectionHandler.ref, connectionActor)) + deaths should ===(Set(connectionHandler.ref, connectionActor)) } } } @@ -702,7 +702,7 @@ class TcpConnectionSpec extends AkkaSpec(""" writer.receiveWhile(1.second) { case CommandFailed(write) ⇒ written -= 1 } - writer.msgAvailable should be(false) + writer.msgAvailable should ===(false) // writes must fail now writer.send(connectionActor, write) @@ -776,7 +776,7 @@ class TcpConnectionSpec extends AkkaSpec(""" writer.receiveWhile(1.second) { case CommandFailed(write) ⇒ written -= 1 } - writer.msgAvailable should be(false) + writer.msgAvailable should ===(false) // writes must fail now writer.send(connectionActor, write) @@ -920,7 +920,7 @@ class TcpConnectionSpec extends AkkaSpec(""" override def run(body: ⇒ Unit): Unit = super.run { registerCallReceiver.expectMsg(Registration(clientSideChannel, 0)) - registerCallReceiver.sender should be(connectionActor) + registerCallReceiver.sender should ===(connectionActor) body } } @@ -981,7 +981,7 @@ class TcpConnectionSpec extends AkkaSpec(""" def closeServerSideAndWaitForClientReadable(fullClose: Boolean = true): Unit = { if (fullClose) serverSideChannel.close() else serverSideChannel.socket.shutdownOutput() - checkFor(clientSelectionKey, OP_READ, 3.seconds.toMillis.toInt) should be(true) + checkFor(clientSelectionKey, OP_READ, 3.seconds.toMillis.toInt) should ===(true) } def registerChannel(channel: SocketChannel, name: String): SelectionKey = { @@ -1049,7 +1049,7 @@ class TcpConnectionSpec extends AkkaSpec(""" val gotReceived = connectionHandler.expectMsgType[Received] val receivedString = gotReceived.data.decodeString("ASCII") - data.startsWith(receivedString) should be(true) + data.startsWith(receivedString) should ===(true) if (receivedString.length < data.length) expectReceivedString(data.drop(receivedString.length)) } diff --git a/akka-actor-tests/src/test/scala/akka/io/TcpIntegrationSpec.scala b/akka-actor-tests/src/test/scala/akka/io/TcpIntegrationSpec.scala index 6ebb0af7be..2829605b6e 100644 --- a/akka-actor-tests/src/test/scala/akka/io/TcpIntegrationSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/io/TcpIntegrationSpec.scala @@ -122,11 +122,11 @@ class TcpIntegrationSpec extends AkkaSpec(""" clientHandler.send(clientConnection, Write(ByteString("Captain on the bridge!"), Aye)) clientHandler.expectMsg(Aye) - serverHandler.expectMsgType[Received].data.decodeString("ASCII") should be("Captain on the bridge!") + serverHandler.expectMsgType[Received].data.decodeString("ASCII") should ===("Captain on the bridge!") serverHandler.send(serverConnection, Write(ByteString("For the king!"), Yes)) serverHandler.expectMsg(Yes) - clientHandler.expectMsgType[Received].data.decodeString("ASCII") should be("For the king!") + clientHandler.expectMsgType[Received].data.decodeString("ASCII") should ===("For the king!") serverHandler.send(serverConnection, Close) serverHandler.expectMsg(Closed) @@ -157,7 +157,7 @@ class TcpIntegrationSpec extends AkkaSpec(""" connectCommander.send(IO(Tcp), Connect(endpoint)) // expecting CommandFailed or no reply (within timeout) val replies = connectCommander.receiveWhile(1.second) { case m: Connected ⇒ m } - replies should be(Nil) + replies should ===(Nil) } "handle tcp connection actor death properly" in new TestSetup(shouldBindServer = false) { @@ -166,12 +166,12 @@ class TcpIntegrationSpec extends AkkaSpec(""" connectCommander.send(IO(Tcp), Connect(endpoint)) val accept = serverSocket.accept() - connectCommander.expectMsgType[Connected].remoteAddress should be(endpoint) + connectCommander.expectMsgType[Connected].remoteAddress should ===(endpoint) val connectionActor = connectCommander.lastSender connectCommander.send(connectionActor, PoisonPill) failAfter(3 seconds) { try { - accept.getInputStream.read() should be(-1) + accept.getInputStream.read() should ===(-1) } catch { case e: IOException ⇒ // this is also fine } diff --git a/akka-actor-tests/src/test/scala/akka/io/TcpListenerSpec.scala b/akka-actor-tests/src/test/scala/akka/io/TcpListenerSpec.scala index e4ae151fed..bf3876eee4 100644 --- a/akka-actor-tests/src/test/scala/akka/io/TcpListenerSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/io/TcpListenerSpec.scala @@ -159,8 +159,8 @@ class TcpListenerSpec extends AkkaSpec(""" def expectWorkerForCommand: SocketChannel = selectorRouter.expectMsgPF() { case WorkerForCommand(RegisterIncoming(chan), commander, _) ⇒ - chan.isOpen should be(true) - commander should be(listener) + chan.isOpen should ===(true) + commander should ===(listener) chan } diff --git a/akka-actor-tests/src/test/scala/akka/io/UdpConnectedIntegrationSpec.scala b/akka-actor-tests/src/test/scala/akka/io/UdpConnectedIntegrationSpec.scala index ba98919c6d..0e856739e2 100644 --- a/akka-actor-tests/src/test/scala/akka/io/UdpConnectedIntegrationSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/io/UdpConnectedIntegrationSpec.scala @@ -41,13 +41,13 @@ class UdpConnectedIntegrationSpec extends AkkaSpec(""" val clientAddress = expectMsgPF() { case Udp.Received(d, a) ⇒ - d should be(data1) + d should ===(data1) a } server ! Udp.Send(data2, clientAddress) - expectMsgType[UdpConnected.Received].data should be(data2) + expectMsgType[UdpConnected.Received].data should ===(data2) } "be able to send and receive with binding" in { @@ -60,13 +60,13 @@ class UdpConnectedIntegrationSpec extends AkkaSpec(""" expectMsgPF() { case Udp.Received(d, a) ⇒ - d should be(data1) - a should be(clientAddress) + d should ===(data1) + a should ===(clientAddress) } server ! Udp.Send(data2, clientAddress) - expectMsgType[UdpConnected.Received].data should be(data2) + expectMsgType[UdpConnected.Received].data should ===(data2) } } diff --git a/akka-actor-tests/src/test/scala/akka/io/UdpIntegrationSpec.scala b/akka-actor-tests/src/test/scala/akka/io/UdpIntegrationSpec.scala index 2c9c0b5194..d696a45460 100644 --- a/akka-actor-tests/src/test/scala/akka/io/UdpIntegrationSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/io/UdpIntegrationSpec.scala @@ -40,7 +40,7 @@ class UdpIntegrationSpec extends AkkaSpec(""" val data = ByteString("To infinity and beyond!") simpleSender ! Send(data, serverAddress) - expectMsgType[Received].data should be(data) + expectMsgType[Received].data should ===(data) } @@ -55,16 +55,16 @@ class UdpIntegrationSpec extends AkkaSpec(""" server ! Send(data, clientAddress) expectMsgPF() { case Received(d, a) ⇒ - d should be(data) - a should be(serverAddress) + d should ===(data) + a should ===(serverAddress) } } def checkSendingToServer(): Unit = { client ! Send(data, serverAddress) expectMsgPF() { case Received(d, a) ⇒ - d should be(data) - a should be(clientAddress) + d should ===(data) + a should ===(clientAddress) } } diff --git a/akka-actor-tests/src/test/scala/akka/pattern/AskSpec.scala b/akka-actor-tests/src/test/scala/akka/pattern/AskSpec.scala index 2055e3c62f..717158c16d 100644 --- a/akka-actor-tests/src/test/scala/akka/pattern/AskSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/pattern/AskSpec.scala @@ -20,7 +20,7 @@ class AskSpec extends AkkaSpec { implicit val timeout = Timeout(5 seconds) val dead = system.actorFor("/system/deadLetters") val f = dead.ask(42)(1 second) - f.isCompleted should be(true) + f.isCompleted should ===(true) f.value.get match { case Failure(_: AskTimeoutException) ⇒ case v ⇒ fail(v + " was not Left(AskTimeoutException)") @@ -31,7 +31,7 @@ class AskSpec extends AkkaSpec { implicit val timeout = Timeout(5 seconds) val empty = system.actorFor("unknown") val f = empty ? 3.14 - f.isCompleted should be(true) + f.isCompleted should ===(true) f.value.get match { case Failure(_: AskTimeoutException) ⇒ case v ⇒ fail(v + " was not Left(AskTimeoutException)") @@ -41,10 +41,10 @@ class AskSpec extends AkkaSpec { "return broken promises on unsupported ActorRefs" in { implicit val timeout = Timeout(5 seconds) val f = ask(null: ActorRef, 3.14) - f.isCompleted should be(true) + f.isCompleted should ===(true) intercept[IllegalArgumentException] { Await.result(f, timeout.duration) - }.getMessage should be("Unsupported recipient ActorRef type, question not sent to [null]. Sender[null] sent the message of type \"java.lang.Double\".") + }.getMessage should ===("Unsupported recipient ActorRef type, question not sent to [null]. Sender[null] sent the message of type \"java.lang.Double\".") } "return broken promises on 0 timeout" in { @@ -54,7 +54,7 @@ class AskSpec extends AkkaSpec { val expectedMsg = "Timeout length must not be negative, question not sent to [%s]. Sender[null] sent the message of type \"java.lang.String\"." format echo intercept[IllegalArgumentException] { Await.result(f, timeout.duration) - }.getMessage should be(expectedMsg) + }.getMessage should ===(expectedMsg) } "return broken promises on < 0 timeout" in { @@ -64,7 +64,7 @@ class AskSpec extends AkkaSpec { val expectedMsg = "Timeout length must not be negative, question not sent to [%s]. Sender[null] sent the message of type \"java.lang.String\"." format echo intercept[IllegalArgumentException] { Await.result(f, timeout.duration) - }.getMessage should be(expectedMsg) + }.getMessage should ===(expectedMsg) } "include target information in AskTimeout" in { @@ -73,7 +73,7 @@ class AskSpec extends AkkaSpec { val f = silentOne ? "noreply" intercept[AskTimeoutException] { Await.result(f, 1 second) - }.getMessage.contains("/user/silent") should be(true) + }.getMessage.contains("/user/silent") should ===(true) } "include timeout information in AskTimeout" in { @@ -90,7 +90,7 @@ class AskSpec extends AkkaSpec { val f = system.actorOf(Props.empty) ? "noreply" intercept[AskTimeoutException] { Await.result(f, 1 second) - }.getMessage.contains(sender.toString) should be(true) + }.getMessage.contains(sender.toString) should ===(true) } "include message class information in AskTimeout" in { @@ -98,7 +98,7 @@ class AskSpec extends AkkaSpec { val f = system.actorOf(Props.empty) ? "noreply" intercept[AskTimeoutException] { Await.result(f, 1 second) - }.getMessage.contains("\"java.lang.String\"") should be(true) + }.getMessage.contains("\"java.lang.String\"") should ===(true) } "work for ActorSelection" in { @@ -108,7 +108,7 @@ class AskSpec extends AkkaSpec { val identityFuture = (system.actorSelection("/user/select-echo") ? Identify(None)) .mapTo[ActorIdentity].map(_.ref.get) - Await.result(identityFuture, 5 seconds) should be(echo) + Await.result(identityFuture, 5 seconds) should ===(echo) } "work when reply uses actor selection" in { @@ -119,7 +119,7 @@ class AskSpec extends AkkaSpec { val echo = system.actorOf(Props(new Actor { def receive = { case x ⇒ context.actorSelection(sender().path) ! x } }), "select-echo2") val f = echo ? "hi" - Await.result(f, 1 seconds) should be("hi") + Await.result(f, 1 seconds) should ===("hi") deadListener.expectNoMsg(200 milliseconds) } @@ -153,7 +153,7 @@ class AskSpec extends AkkaSpec { }), "select-echo4") val f = echo ? "hi" intercept[AskTimeoutException] { - Await.result(f, 1 seconds) should be("hi") + Await.result(f, 1 seconds) should ===("hi") } deadListener.expectMsgClass(200 milliseconds, classOf[DeadLetter]) @@ -174,7 +174,7 @@ class AskSpec extends AkkaSpec { }), "select-echo5") val f = echo ? "hi" intercept[AskTimeoutException] { - Await.result(f, 1 seconds) should be("hi") + Await.result(f, 1 seconds) should ===("hi") } deadListener.expectMsgClass(200 milliseconds, classOf[DeadLetter]) } @@ -194,7 +194,7 @@ class AskSpec extends AkkaSpec { }), "select-echo6") val f = echo ? "hi" intercept[AskTimeoutException] { - Await.result(f, 1 seconds) should be(ActorSelectionMessage("hi", Vector(SelectChildName("missing")), false)) + Await.result(f, 1 seconds) should ===(ActorSelectionMessage("hi", Vector(SelectChildName("missing")), false)) } deadListener.expectMsgClass(200 milliseconds, classOf[DeadLetter]) } diff --git a/akka-actor-tests/src/test/scala/akka/pattern/CircuitBreakerMTSpec.scala b/akka-actor-tests/src/test/scala/akka/pattern/CircuitBreakerMTSpec.scala index 941a8897d5..12876d3078 100644 --- a/akka-actor-tests/src/test/scala/akka/pattern/CircuitBreakerMTSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/pattern/CircuitBreakerMTSpec.scala @@ -48,16 +48,16 @@ class CircuitBreakerMTSpec extends AkkaSpec { "allow many calls while in closed state with no errors" in { val futures = testCallsWithBreaker() val result = Await.result(Future.sequence(futures), 5.second.dilated) - result.size should be(numberOfTestCalls) - result.toSet should be(Set("succeed")) + result.size should ===(numberOfTestCalls) + result.toSet should ===(Set("succeed")) } "transition to open state upon reaching failure limit and fail-fast" in { openBreaker() val futures = testCallsWithBreaker() val result = Await.result(Future.sequence(futures), 5.second.dilated) - result.size should be(numberOfTestCalls) - result.toSet should be(Set("CBO")) + result.size should ===(numberOfTestCalls) + result.toSet should ===(Set("CBO")) } "allow a single call through in half-open state" in { @@ -71,8 +71,8 @@ class CircuitBreakerMTSpec extends AkkaSpec { val futures = testCallsWithBreaker() val result = Await.result(Future.sequence(futures), 5.second.dilated) - result.size should be(numberOfTestCalls) - result.toSet should be(Set("succeed", "CBO")) + result.size should ===(numberOfTestCalls) + result.toSet should ===(Set("succeed", "CBO")) } "recover and reset the breaker after the reset timeout" in { @@ -91,8 +91,8 @@ class CircuitBreakerMTSpec extends AkkaSpec { val futures = testCallsWithBreaker() val result = Await.result(Future.sequence(futures), 5.second.dilated) - result.size should be(numberOfTestCalls) - result.toSet should be(Set("succeed")) + result.size should ===(numberOfTestCalls) + result.toSet should ===(Set("succeed")) } } } diff --git a/akka-actor-tests/src/test/scala/akka/pattern/CircuitBreakerSpec.scala b/akka-actor-tests/src/test/scala/akka/pattern/CircuitBreakerSpec.scala index 9c22391392..aecf9f7a68 100644 --- a/akka-actor-tests/src/test/scala/akka/pattern/CircuitBreakerSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/pattern/CircuitBreakerSpec.scala @@ -65,8 +65,8 @@ class CircuitBreakerSpec extends AkkaSpec with BeforeAndAfter { checkLatch(breaker.openLatch) val e = intercept[CircuitBreakerOpenException] { breaker().withSyncCircuitBreaker(sayHi) } - (e.remainingDuration > Duration.Zero) should be(true) - (e.remainingDuration <= CircuitBreakerSpec.longResetTimeout) should be(true) + (e.remainingDuration > Duration.Zero) should ===(true) + (e.remainingDuration <= CircuitBreakerSpec.longResetTimeout) should ===(true) } "transition to half-open on reset timeout" in { @@ -97,27 +97,27 @@ class CircuitBreakerSpec extends AkkaSpec with BeforeAndAfter { "A synchronous circuit breaker that is closed" must { "allow calls through" in { val breaker = CircuitBreakerSpec.longCallTimeoutCb() - breaker().withSyncCircuitBreaker(sayHi) should be("hi") + breaker().withSyncCircuitBreaker(sayHi) should ===("hi") } "increment failure count on failure" in { val breaker = CircuitBreakerSpec.longCallTimeoutCb() - breaker().currentFailureCount should be(0) + breaker().currentFailureCount should ===(0) intercept[TestException] { breaker().withSyncCircuitBreaker(throwException) } checkLatch(breaker.openLatch) - breaker().currentFailureCount should be(1) + breaker().currentFailureCount should ===(1) } "reset failure count after success" in { val breaker = CircuitBreakerSpec.multiFailureCb() - breaker().currentFailureCount should be(0) + breaker().currentFailureCount should ===(0) intercept[TestException] { val ct = Thread.currentThread() // Ensure that the thunk is executed in the tests thread breaker().withSyncCircuitBreaker({ if (Thread.currentThread() eq ct) throwException else "fail" }) } - breaker().currentFailureCount should be(1) + breaker().currentFailureCount should ===(1) breaker().withSyncCircuitBreaker(sayHi) - breaker().currentFailureCount should be(0) + breaker().currentFailureCount should ===(0) } "throw TimeoutException on callTimeout" in { @@ -127,7 +127,7 @@ class CircuitBreakerSpec extends AkkaSpec with BeforeAndAfter { Thread.sleep(200.millis.dilated.toMillis) } } - breaker().currentFailureCount should be(1) + breaker().currentFailureCount should ===(1) } "increment failure count on callTimeout before call finishes" in { @@ -165,7 +165,7 @@ class CircuitBreakerSpec extends AkkaSpec with BeforeAndAfter { val breaker = CircuitBreakerSpec.shortResetTimeoutCb() breaker().withCircuitBreaker(Future(throwException)) checkLatch(breaker.halfOpenLatch) - Await.result(breaker().withCircuitBreaker(Future(sayHi)), awaitTimeout) should be("hi") + Await.result(breaker().withCircuitBreaker(Future(sayHi)), awaitTimeout) should ===("hi") checkLatch(breaker.closedLatch) } @@ -190,21 +190,21 @@ class CircuitBreakerSpec extends AkkaSpec with BeforeAndAfter { "An asynchronous circuit breaker that is closed" must { "allow calls through" in { val breaker = CircuitBreakerSpec.longCallTimeoutCb() - Await.result(breaker().withCircuitBreaker(Future(sayHi)), awaitTimeout) should be("hi") + Await.result(breaker().withCircuitBreaker(Future(sayHi)), awaitTimeout) should ===("hi") } "increment failure count on exception" in { val breaker = CircuitBreakerSpec.longCallTimeoutCb() intercept[TestException] { Await.result(breaker().withCircuitBreaker(Future(throwException)), awaitTimeout) } checkLatch(breaker.openLatch) - breaker().currentFailureCount should be(1) + breaker().currentFailureCount should ===(1) } "increment failure count on async failure" in { val breaker = CircuitBreakerSpec.longCallTimeoutCb() breaker().withCircuitBreaker(Future(throwException)) checkLatch(breaker.openLatch) - breaker().currentFailureCount should be(1) + breaker().currentFailureCount should ===(1) } "reset failure count after success" in { @@ -224,7 +224,7 @@ class CircuitBreakerSpec extends AkkaSpec with BeforeAndAfter { throwException }) checkLatch(breaker.openLatch) - breaker().currentFailureCount should be(1) + breaker().currentFailureCount should ===(1) // Since the timeout should have happend before the inner code finishes // we expect a timeout, not TestException intercept[TimeoutException] { diff --git a/akka-actor-tests/src/test/scala/akka/pattern/PatternSpec.scala b/akka-actor-tests/src/test/scala/akka/pattern/PatternSpec.scala index 300f9f212d..f03685bfa2 100644 --- a/akka-actor-tests/src/test/scala/akka/pattern/PatternSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/pattern/PatternSpec.scala @@ -32,7 +32,7 @@ class PatternSpec extends AkkaSpec("akka.actor.serialize-messages = off") { "provide Future for stopping an actor" in { val target = system.actorOf(Props[TargetActor]) val result = gracefulStop(target, 5 seconds) - Await.result(result, 6 seconds) should be(true) + Await.result(result, 6 seconds) should ===(true) } "complete Future when actor already terminated" in { @@ -56,7 +56,7 @@ class PatternSpec extends AkkaSpec("akka.actor.serialize-messages = off") { val f = akka.pattern.after(1 second, using = system.scheduler)(Promise.successful(5).future) val r = Future.firstCompletedOf(Seq(Promise[Int]().future, f)) - Await.result(r, remainingOrDefault) should be(5) + Await.result(r, remainingOrDefault) should ===(5) } "be completed abnormally eventually" in { @@ -64,7 +64,7 @@ class PatternSpec extends AkkaSpec("akka.actor.serialize-messages = off") { val f = akka.pattern.after(1 second, using = system.scheduler)(Promise.failed(new IllegalStateException("Mexico")).future) val r = Future.firstCompletedOf(Seq(Promise[Int]().future, f)) - intercept[IllegalStateException] { Await.result(r, remainingOrDefault) }.getMessage should be("Mexico") + intercept[IllegalStateException] { Await.result(r, remainingOrDefault) }.getMessage should ===("Mexico") } } } diff --git a/akka-actor-tests/src/test/scala/akka/pattern/PipeToSpec.scala b/akka-actor-tests/src/test/scala/akka/pattern/PipeToSpec.scala index e8b31a831d..e440f99c7f 100644 --- a/akka-actor-tests/src/test/scala/akka/pattern/PipeToSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/pattern/PipeToSpec.scala @@ -24,7 +24,7 @@ class PipeToSpec extends AkkaSpec { "signal failure" in { val p = TestProbe() Future.failed(new Exception("failed")) pipeTo p.ref - p.expectMsgType[Status.Failure].cause.getMessage should be("failed") + p.expectMsgType[Status.Failure].cause.getMessage should ===("failed") } "pick up an implicit sender()" in { @@ -32,7 +32,7 @@ class PipeToSpec extends AkkaSpec { implicit val s = testActor Future(42) pipeTo p.ref p.expectMsg(42) - p.lastSender should be(s) + p.lastSender should ===(s) } "work in Java form" in { @@ -45,7 +45,7 @@ class PipeToSpec extends AkkaSpec { val p = TestProbe() pipe(Future(42)) to (p.ref, testActor) p.expectMsg(42) - p.lastSender should be(testActor) + p.lastSender should ===(testActor) } } @@ -63,7 +63,7 @@ class PipeToSpec extends AkkaSpec { val p = TestProbe() val sel = system.actorSelection(p.ref.path) Future.failed(new Exception("failed")) pipeToSelection sel - p.expectMsgType[Status.Failure].cause.getMessage should be("failed") + p.expectMsgType[Status.Failure].cause.getMessage should ===("failed") } "pick up an implicit sender()" in { @@ -72,7 +72,7 @@ class PipeToSpec extends AkkaSpec { implicit val s = testActor Future(42) pipeToSelection sel p.expectMsg(42) - p.lastSender should be(s) + p.lastSender should ===(s) } "work in Java form" in { @@ -87,7 +87,7 @@ class PipeToSpec extends AkkaSpec { val sel = system.actorSelection(p.ref.path) pipe(Future(42)) to (sel, testActor) p.expectMsg(42) - p.lastSender should be(testActor) + p.lastSender should ===(testActor) } } diff --git a/akka-actor-tests/src/test/scala/akka/routing/BalancingSpec.scala b/akka-actor-tests/src/test/scala/akka/routing/BalancingSpec.scala index d5ee52b5a1..b317ebb813 100644 --- a/akka-actor-tests/src/test/scala/akka/routing/BalancingSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/routing/BalancingSpec.scala @@ -79,7 +79,7 @@ class BalancingSpec extends AkkaSpec( latch.countDown() val replies2 = receiveN(poolSize - 1) - // the remaining replies come from the blocked + // the remaining replies come from the blocked replies2.toSet should be((2 to poolSize).toSet) expectNoMsg(500.millis) @@ -109,14 +109,14 @@ class BalancingSpec extends AkkaSpec( } "work with anonymous actor names" in { - // the dispatcher-id must not contain invalid config key characters (e.g. $a) + // the dispatcher-id must not contain invalid config key characters (e.g. $a) system.actorOf(Props[Parent]) ! "hello" expectMsgType[Int] } "work with encoded actor names" in { val encName = URLEncoder.encode("abcå6#$€xyz", "utf-8") - // % is a valid config key character (e.g. %C3%A5) + // % is a valid config key character (e.g. %C3%A5) system.actorOf(Props[Parent], encName) ! "hello" expectMsgType[Int] } diff --git a/akka-actor-tests/src/test/scala/akka/routing/BroadcastSpec.scala b/akka-actor-tests/src/test/scala/akka/routing/BroadcastSpec.scala index f349fa4421..94fe49afdb 100644 --- a/akka-actor-tests/src/test/scala/akka/routing/BroadcastSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/routing/BroadcastSpec.scala @@ -48,8 +48,8 @@ class BroadcastSpec extends AkkaSpec with DefaultTimeout with ImplicitSender { Await.ready(doneLatch, remainingOrDefault) - counter1.get should be(1) - counter2.get should be(1) + counter1.get should ===(1) + counter2.get should ===(1) } "broadcast message using ?" in { @@ -80,8 +80,8 @@ class BroadcastSpec extends AkkaSpec with DefaultTimeout with ImplicitSender { Await.ready(doneLatch, remainingOrDefault) - counter1.get should be(1) - counter2.get should be(1) + counter1.get should ===(1) + counter2.get should ===(1) } } diff --git a/akka-actor-tests/src/test/scala/akka/routing/ConfiguredLocalRoutingSpec.scala b/akka-actor-tests/src/test/scala/akka/routing/ConfiguredLocalRoutingSpec.scala index bccc4b350b..3d8318d862 100644 --- a/akka-actor-tests/src/test/scala/akka/routing/ConfiguredLocalRoutingSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/routing/ConfiguredLocalRoutingSpec.scala @@ -99,33 +99,33 @@ class ConfiguredLocalRoutingSpec extends AkkaSpec(ConfiguredLocalRoutingSpec.con "be picked up from Props" in { val actor = system.actorOf(RoundRobinPool(12).props(routeeProps = Props[EchoProps]), "someOther") - routerConfig(actor) should be(RoundRobinPool(12)) + routerConfig(actor) should ===(RoundRobinPool(12)) Await.result(gracefulStop(actor, 3 seconds), 3 seconds) } "be overridable in config" in { val actor = system.actorOf(RoundRobinPool(12).props(routeeProps = Props[EchoProps]), "config") - routerConfig(actor) should be(RandomPool(nrOfInstances = 4, usePoolDispatcher = true)) + routerConfig(actor) should ===(RandomPool(nrOfInstances = 4, usePoolDispatcher = true)) Await.result(gracefulStop(actor, 3 seconds), 3 seconds) } "use routees.paths from config" in { val actor = system.actorOf(RandomPool(12).props(routeeProps = Props[EchoProps]), "paths") - routerConfig(actor) should be(RandomGroup(List("/user/service1", "/user/service2"))) + routerConfig(actor) should ===(RandomGroup(List("/user/service1", "/user/service2"))) Await.result(gracefulStop(actor, 3 seconds), 3 seconds) } "be overridable in explicit deployment" in { val actor = system.actorOf(FromConfig.props(routeeProps = Props[EchoProps]). withDeploy(Deploy(routerConfig = RoundRobinPool(12))), "someOther") - routerConfig(actor) should be(RoundRobinPool(12)) + routerConfig(actor) should ===(RoundRobinPool(12)) Await.result(gracefulStop(actor, 3 seconds), 3 seconds) } "be overridable in config even with explicit deployment" in { val actor = system.actorOf(FromConfig.props(routeeProps = Props[EchoProps]). withDeploy(Deploy(routerConfig = RoundRobinPool(12))), "config") - routerConfig(actor) should be(RandomPool(nrOfInstances = 4, usePoolDispatcher = true)) + routerConfig(actor) should ===(RandomPool(nrOfInstances = 4, usePoolDispatcher = true)) Await.result(gracefulStop(actor, 3 seconds), 3 seconds) } @@ -139,7 +139,7 @@ class ConfiguredLocalRoutingSpec extends AkkaSpec(ConfiguredLocalRoutingSpec.con val router = system.actorOf(FromConfig.props(routeeProps = Props(classOf[SendRefAtStartup], testActor)), "weird") val recv = Set() ++ (for (_ ← 1 to 3) yield expectMsgType[ActorRef]) val expc = Set('a', 'b', 'c') map (i ⇒ system.actorFor("/user/weird/$" + i)) - recv should be(expc) + recv should ===(expc) expectNoMsg(1 second) } diff --git a/akka-actor-tests/src/test/scala/akka/routing/ConsistentHashingRouterSpec.scala b/akka-actor-tests/src/test/scala/akka/routing/ConsistentHashingRouterSpec.scala index 77c0b4658d..1c76a08302 100644 --- a/akka-actor-tests/src/test/scala/akka/routing/ConsistentHashingRouterSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/routing/ConsistentHashingRouterSpec.scala @@ -56,7 +56,7 @@ class ConsistentHashingRouterSpec extends AkkaSpec(ConsistentHashingRouterSpec.c "consistent hashing router" must { "create routees from configuration" in { val currentRoutees = Await.result(router1 ? GetRoutees, timeout.duration).asInstanceOf[Routees] - currentRoutees.routees.size should be(3) + currentRoutees.routees.size should ===(3) } "select destination based on consistentHashKey of the message" in { diff --git a/akka-actor-tests/src/test/scala/akka/routing/RandomSpec.scala b/akka-actor-tests/src/test/scala/akka/routing/RandomSpec.scala index a8d07d5347..b6950fdb91 100644 --- a/akka-actor-tests/src/test/scala/akka/routing/RandomSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/routing/RandomSpec.scala @@ -70,13 +70,13 @@ class RandomSpec extends AkkaSpec with DefaultTimeout with ImplicitSender { } } - counter.get should be(connectionCount) + counter.get should ===(connectionCount) actor ! akka.routing.Broadcast("end") Await.ready(doneLatch, 5 seconds) replies.values foreach { _ should be > (0) } - replies.values.sum should be(iterationCount * connectionCount) + replies.values.sum should ===(iterationCount * connectionCount) } "deliver a broadcast message using the !" in { diff --git a/akka-actor-tests/src/test/scala/akka/routing/ResizerSpec.scala b/akka-actor-tests/src/test/scala/akka/routing/ResizerSpec.scala index 3cb9357e1b..96476f4073 100644 --- a/akka-actor-tests/src/test/scala/akka/routing/ResizerSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/routing/ResizerSpec.scala @@ -58,13 +58,13 @@ class ResizerSpec extends AkkaSpec(ResizerSpec.config) with DefaultTimeout with upperBound = 3) val c1 = resizer.capacity(Vector.empty[Routee]) - c1 should be(2) + c1 should ===(2) val current = Vector( ActorRefRoutee(system.actorOf(Props[TestActor])), ActorRefRoutee(system.actorOf(Props[TestActor]))) val c2 = resizer.capacity(current) - c2 should be(0) + c2 should ===(0) } "use settings to evaluate rampUp" in { @@ -73,9 +73,9 @@ class ResizerSpec extends AkkaSpec(ResizerSpec.config) with DefaultTimeout with upperBound = 10, rampupRate = 0.2) - resizer.rampup(pressure = 9, capacity = 10) should be(0) - resizer.rampup(pressure = 5, capacity = 5) should be(1) - resizer.rampup(pressure = 6, capacity = 6) should be(2) + resizer.rampup(pressure = 9, capacity = 10) should ===(0) + resizer.rampup(pressure = 5, capacity = 5) should ===(1) + resizer.rampup(pressure = 6, capacity = 6) should ===(2) } "use settings to evaluate backoff" in { @@ -85,13 +85,13 @@ class ResizerSpec extends AkkaSpec(ResizerSpec.config) with DefaultTimeout with backoffThreshold = 0.3, backoffRate = 0.1) - resizer.backoff(pressure = 10, capacity = 10) should be(0) - resizer.backoff(pressure = 4, capacity = 10) should be(0) - resizer.backoff(pressure = 3, capacity = 10) should be(0) - resizer.backoff(pressure = 2, capacity = 10) should be(-1) - resizer.backoff(pressure = 0, capacity = 10) should be(-1) - resizer.backoff(pressure = 1, capacity = 9) should be(-1) - resizer.backoff(pressure = 0, capacity = 9) should be(-1) + resizer.backoff(pressure = 10, capacity = 10) should ===(0) + resizer.backoff(pressure = 4, capacity = 10) should ===(0) + resizer.backoff(pressure = 3, capacity = 10) should ===(0) + resizer.backoff(pressure = 2, capacity = 10) should ===(-1) + resizer.backoff(pressure = 0, capacity = 10) should ===(-1) + resizer.backoff(pressure = 1, capacity = 9) should ===(-1) + resizer.backoff(pressure = 0, capacity = 9) should ===(-1) } "be possible to define programmatically" in { @@ -110,7 +110,7 @@ class ResizerSpec extends AkkaSpec(ResizerSpec.config) with DefaultTimeout with Await.ready(latch, remainingOrDefault) // messagesPerResize is 10 so there is no risk of additional resize - routeeSize(router) should be(2) + routeeSize(router) should ===(2) } "be possible to define in configuration" in { @@ -124,7 +124,7 @@ class ResizerSpec extends AkkaSpec(ResizerSpec.config) with DefaultTimeout with Await.ready(latch, remainingOrDefault) - routeeSize(router) should be(2) + routeeSize(router) should ===(2) } "grow as needed under pressure" in { @@ -153,7 +153,7 @@ class ResizerSpec extends AkkaSpec(ResizerSpec.config) with DefaultTimeout with router ! "echo" expectMsg("reply") - routeeSize(router) should be(resizer.lowerBound) + routeeSize(router) should ===(resizer.lowerBound) def loop(loops: Int, d: FiniteDuration) = { for (m ← 0 until loops) { @@ -168,11 +168,11 @@ class ResizerSpec extends AkkaSpec(ResizerSpec.config) with DefaultTimeout with // 2 more should go thru without triggering more loop(2, 200 millis) - routeeSize(router) should be(resizer.lowerBound) + routeeSize(router) should ===(resizer.lowerBound) // a whole bunch should max it out loop(20, 500 millis) - routeeSize(router) should be(resizer.upperBound) + routeeSize(router) should ===(resizer.upperBound) } "backoff" in within(10 seconds) { diff --git a/akka-actor-tests/src/test/scala/akka/routing/RoundRobinSpec.scala b/akka-actor-tests/src/test/scala/akka/routing/RoundRobinSpec.scala index d3cb684603..61dee81f5b 100644 --- a/akka-actor-tests/src/test/scala/akka/routing/RoundRobinSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/routing/RoundRobinSpec.scala @@ -68,12 +68,12 @@ class RoundRobinSpec extends AkkaSpec with DefaultTimeout with ImplicitSender { replies = replies + (id -> (replies(id) + 1)) } - counter.get should be(connectionCount) + counter.get should ===(connectionCount) actor ! akka.routing.Broadcast("end") Await.ready(doneLatch, 5 seconds) - replies.values foreach { _ should be(iterationCount) } + replies.values foreach { _ should ===(iterationCount) } } "deliver a broadcast message using the !" in { @@ -102,17 +102,17 @@ class RoundRobinSpec extends AkkaSpec with DefaultTimeout with ImplicitSender { def receive = Actor.emptyBehavior })), "round-robin-managed") - routeeSize(actor) should be(3) + routeeSize(actor) should ===(3) actor ! AdjustPoolSize(+4) - routeeSize(actor) should be(7) + routeeSize(actor) should ===(7) actor ! AdjustPoolSize(-2) - routeeSize(actor) should be(5) + routeeSize(actor) should ===(5) val other = ActorSelectionRoutee(system.actorSelection("/user/other")) actor ! AddRoutee(other) - routeeSize(actor) should be(6) + routeeSize(actor) should ===(6) actor ! RemoveRoutee(other) - routeeSize(actor) should be(5) + routeeSize(actor) should ===(5) } } @@ -145,7 +145,7 @@ class RoundRobinSpec extends AkkaSpec with DefaultTimeout with ImplicitSender { actor ! akka.routing.Broadcast("end") Await.ready(doneLatch, 5 seconds) - replies.values foreach { _ should be(iterationCount) } + replies.values foreach { _ should ===(iterationCount) } } } @@ -192,7 +192,7 @@ class RoundRobinSpec extends AkkaSpec with DefaultTimeout with ImplicitSender { actor ! akka.routing.Broadcast("end") expectTerminated(actor) - replies.values foreach { _ should be(iterationCount) } + replies.values foreach { _ should ===(iterationCount) } } } diff --git a/akka-actor-tests/src/test/scala/akka/routing/RoutingSpec.scala b/akka-actor-tests/src/test/scala/akka/routing/RoutingSpec.scala index da9d5ab84a..bf44897882 100644 --- a/akka-actor-tests/src/test/scala/akka/routing/RoutingSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/routing/RoutingSpec.scala @@ -70,7 +70,7 @@ class RoutingSpec extends AkkaSpec(RoutingSpec.config) with DefaultTimeout with watch(router) watch(c2) system.stop(c2) - expectTerminated(c2).existenceConfirmed should be(true) + expectTerminated(c2).existenceConfirmed should ===(true) // it might take a while until the Router has actually processed the Terminated message awaitCond { router ! "" @@ -81,7 +81,7 @@ class RoutingSpec extends AkkaSpec(RoutingSpec.config) with DefaultTimeout with res == Seq(c1, c1) } system.stop(c1) - expectTerminated(router).existenceConfirmed should be(true) + expectTerminated(router).existenceConfirmed should ===(true) } "not terminate when resizer is used" in { @@ -99,7 +99,7 @@ class RoutingSpec extends AkkaSpec(RoutingSpec.config) with DefaultTimeout with Await.ready(latch, remainingOrDefault) router ! GetRoutees val routees = expectMsgType[Routees].routees - routees.size should be(2) + routees.size should ===(2) routees foreach { _.send(PoisonPill, testActor) } // expect no Terminated expectNoMsg(2.seconds) @@ -108,7 +108,7 @@ class RoutingSpec extends AkkaSpec(RoutingSpec.config) with DefaultTimeout with "use configured nr-of-instances when FromConfig" in { val router = system.actorOf(FromConfig.props(routeeProps = Props[TestActor]), "router1") router ! GetRoutees - expectMsgType[Routees].routees.size should be(3) + expectMsgType[Routees].routees.size should ===(3) watch(router) system.stop(router) expectTerminated(router) @@ -117,7 +117,7 @@ class RoutingSpec extends AkkaSpec(RoutingSpec.config) with DefaultTimeout with "use configured nr-of-instances when router is specified" in { val router = system.actorOf(RoundRobinPool(nrOfInstances = 2).props(routeeProps = Props[TestActor]), "router2") router ! GetRoutees - expectMsgType[Routees].routees.size should be(3) + expectMsgType[Routees].routees.size should ===(3) system.stop(router) } @@ -134,7 +134,7 @@ class RoutingSpec extends AkkaSpec(RoutingSpec.config) with DefaultTimeout with routeeProps = Props[TestActor]), "router3") Await.ready(latch, remainingOrDefault) router ! GetRoutees - expectMsgType[Routees].routees.size should be(3) + expectMsgType[Routees].routees.size should ===(3) system.stop(router) } @@ -191,7 +191,7 @@ class RoutingSpec extends AkkaSpec(RoutingSpec.config) with DefaultTimeout with EventFilter[Exception]("die", occurrences = 1) intercept { router ! "die" } - expectMsgType[Exception].getMessage should be("die") + expectMsgType[Exception].getMessage should ===("die") expectMsg("restarted") expectMsg("restarted") expectMsg("restarted") diff --git a/akka-actor-tests/src/test/scala/akka/routing/ScatterGatherFirstCompletedSpec.scala b/akka-actor-tests/src/test/scala/akka/routing/ScatterGatherFirstCompletedSpec.scala index a59645a497..861fcdabdd 100644 --- a/akka-actor-tests/src/test/scala/akka/routing/ScatterGatherFirstCompletedSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/routing/ScatterGatherFirstCompletedSpec.scala @@ -68,8 +68,8 @@ class ScatterGatherFirstCompletedSpec extends AkkaSpec with DefaultTimeout with Await.ready(doneLatch, TestLatch.DefaultTimeout) - counter1.get should be(1) - counter2.get should be(1) + counter1.get should ===(1) + counter2.get should ===(1) } "return response, even if one of the actors has stopped" in { @@ -81,7 +81,7 @@ class ScatterGatherFirstCompletedSpec extends AkkaSpec with DefaultTimeout with routedActor ! Broadcast(Stop(Some(1))) Await.ready(shutdownLatch, TestLatch.DefaultTimeout) - Await.result(routedActor ? Broadcast(0), timeout.duration) should be(14) + Await.result(routedActor ? Broadcast(0), timeout.duration) should ===(14) } } diff --git a/akka-actor-tests/src/test/scala/akka/routing/TailChoppingSpec.scala b/akka-actor-tests/src/test/scala/akka/routing/TailChoppingSpec.scala index 69e8fa24e0..b5c0752a10 100644 --- a/akka-actor-tests/src/test/scala/akka/routing/TailChoppingSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/routing/TailChoppingSpec.scala @@ -70,8 +70,8 @@ class TailChoppingSpec extends AkkaSpec with DefaultTimeout with ImplicitSender Await.ready(doneLatch, TestLatch.DefaultTimeout) - counter1.get should be(1) - counter2.get should be(1) + counter1.get should ===(1) + counter2.get should ===(1) } "return response from second actor after inactivity from first one" in { diff --git a/akka-actor-tests/src/test/scala/akka/serialization/SerializeSpec.scala b/akka-actor-tests/src/test/scala/akka/serialization/SerializeSpec.scala index d14fdf9c4a..1962932628 100644 --- a/akka-actor-tests/src/test/scala/akka/serialization/SerializeSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/serialization/SerializeSpec.scala @@ -141,8 +141,8 @@ class SerializeSpec extends AkkaSpec(SerializationTests.serializeConf) { "Serialization" must { "have correct bindings" in { - ser.bindings.collectFirst { case (c, s) if c == addr.getClass ⇒ s.getClass } should be(Some(classOf[JavaSerializer])) - ser.bindings.collectFirst { case (c, s) if c == classOf[PlainMessage] ⇒ s.getClass } should be(Some(classOf[TestSerializer])) + ser.bindings.collectFirst { case (c, s) if c == addr.getClass ⇒ s.getClass } should ===(Some(classOf[JavaSerializer])) + ser.bindings.collectFirst { case (c, s) if c == classOf[PlainMessage] ⇒ s.getClass } should ===(Some(classOf[TestSerializer])) } "serialize Address" in { @@ -182,7 +182,7 @@ class SerializeSpec extends AkkaSpec(SerializationTests.serializeConf) { val in = new ObjectInputStream(new ByteArrayInputStream(outbuf.toByteArray)) JavaSerializer.currentSystem.withValue(a.asInstanceOf[ActorSystemImpl]) { val deadLetters = in.readObject().asInstanceOf[DeadLetterActorRef] - (deadLetters eq a.deadLetters) should be(true) + (deadLetters eq a.deadLetters) should ===(true) } } finally { shutdown(a) @@ -190,27 +190,27 @@ class SerializeSpec extends AkkaSpec(SerializationTests.serializeConf) { } "resolve serializer by direct interface" in { - ser.serializerFor(classOf[SimpleMessage]).getClass should be(classOf[TestSerializer]) + ser.serializerFor(classOf[SimpleMessage]).getClass should ===(classOf[TestSerializer]) } "resolve serializer by interface implemented by super class" in { - ser.serializerFor(classOf[ExtendedSimpleMessage]).getClass should be(classOf[TestSerializer]) + ser.serializerFor(classOf[ExtendedSimpleMessage]).getClass should ===(classOf[TestSerializer]) } "resolve serializer by indirect interface" in { - ser.serializerFor(classOf[AnotherMessage]).getClass should be(classOf[TestSerializer]) + ser.serializerFor(classOf[AnotherMessage]).getClass should ===(classOf[TestSerializer]) } "resolve serializer by indirect interface implemented by super class" in { - ser.serializerFor(classOf[ExtendedAnotherMessage]).getClass should be(classOf[TestSerializer]) + ser.serializerFor(classOf[ExtendedAnotherMessage]).getClass should ===(classOf[TestSerializer]) } "resolve serializer for message with binding" in { - ser.serializerFor(classOf[PlainMessage]).getClass should be(classOf[TestSerializer]) + ser.serializerFor(classOf[PlainMessage]).getClass should ===(classOf[TestSerializer]) } "resolve serializer for message extending class with with binding" in { - ser.serializerFor(classOf[ExtendedPlainMessage]).getClass should be(classOf[TestSerializer]) + ser.serializerFor(classOf[ExtendedPlainMessage]).getClass should ===(classOf[TestSerializer]) } "give warning for message with several bindings" in { @@ -220,17 +220,17 @@ class SerializeSpec extends AkkaSpec(SerializationTests.serializeConf) { } "resolve serializer in the order of the bindings" in { - ser.serializerFor(classOf[A]).getClass should be(classOf[JavaSerializer]) - ser.serializerFor(classOf[B]).getClass should be(classOf[TestSerializer]) + ser.serializerFor(classOf[A]).getClass should ===(classOf[JavaSerializer]) + ser.serializerFor(classOf[B]).getClass should ===(classOf[TestSerializer]) EventFilter.warning(start = "Multiple serializers found", occurrences = 1) intercept { ser.serializerFor(classOf[C]).getClass should (be(classOf[TestSerializer]) or be(classOf[JavaSerializer])) } } "resolve serializer in the order of most specific binding first" in { - ser.serializerFor(classOf[A]).getClass should be(classOf[JavaSerializer]) - ser.serializerFor(classOf[D]).getClass should be(classOf[TestSerializer]) - ser.serializerFor(classOf[E]).getClass should be(classOf[TestSerializer]) + ser.serializerFor(classOf[A]).getClass should ===(classOf[JavaSerializer]) + ser.serializerFor(classOf[D]).getClass should ===(classOf[TestSerializer]) + ser.serializerFor(classOf[E]).getClass should ===(classOf[TestSerializer]) } "throw java.io.NotSerializableException when no binding" in { @@ -248,7 +248,7 @@ class SerializeSpec extends AkkaSpec(SerializationTests.serializeConf) { intercept[IllegalArgumentException] { byteSerializer.toBinary("pigdog") - }.getMessage should be("ByteArraySerializer only serializes byte arrays, not [pigdog]") + }.getMessage should ===("ByteArraySerializer only serializes byte arrays, not [pigdog]") } } } @@ -259,8 +259,8 @@ class VerifySerializabilitySpec extends AkkaSpec(SerializationTests.verifySerial implicit val timeout = Timeout(5 seconds) "verify config" in { - system.settings.SerializeAllCreators should be(true) - system.settings.SerializeAllMessages should be(true) + system.settings.SerializeAllCreators should ===(true) + system.settings.SerializeAllMessages should ===(true) } "verify creators" in { @@ -278,7 +278,7 @@ class VerifySerializabilitySpec extends AkkaSpec(SerializationTests.verifySerial "verify messages" in { val a = system.actorOf(Props[FooActor]) - Await.result(a ? "pigdog", timeout.duration) should be("pigdog") + Await.result(a ? "pigdog", timeout.duration) should ===("pigdog") EventFilter[NotSerializableException](occurrences = 1) intercept { a ! (new AnyRef) @@ -293,7 +293,7 @@ class ReferenceSerializationSpec extends AkkaSpec(SerializationTests.mostlyRefer val ser = SerializationExtension(system) def serializerMustBe(toSerialize: Class[_], expectedSerializer: Class[_]) = - ser.serializerFor(toSerialize).getClass should be(expectedSerializer) + ser.serializerFor(toSerialize).getClass should ===(expectedSerializer) "Serialization settings from reference.conf" must { @@ -324,7 +324,7 @@ class SerializationCompatibilitySpec extends AkkaSpec(SerializationTests.mostlyR "Cross-version serialization compatibility" must { def verify(obj: SystemMessage, asExpected: String): Unit = - String.valueOf(ser.serialize(obj).map(encodeHex).get) should be(asExpected) + String.valueOf(ser.serialize(obj).map(encodeHex).get) should ===(asExpected) "be preserved for the Create SystemMessage" in { // Using null as the cause to avoid a large serialized message and JDK differences @@ -408,7 +408,7 @@ class OverriddenSystemMessageSerializationSpec extends AkkaSpec(SerializationTes "resolve to a single serializer" in { EventFilter.warning(start = "Multiple serializers found", occurrences = 0) intercept { for (smc ← systemMessageClasses) { - ser.serializerFor(smc).getClass should be(classOf[TestSerializer]) + ser.serializerFor(smc).getClass should ===(classOf[TestSerializer]) } } } diff --git a/akka-actor-tests/src/test/scala/akka/util/DurationSpec.scala b/akka-actor-tests/src/test/scala/akka/util/DurationSpec.scala index 4aea8ed734..85f6d19b73 100644 --- a/akka-actor-tests/src/test/scala/akka/util/DurationSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/util/DurationSpec.scala @@ -18,13 +18,13 @@ class DurationSpec extends AkkaSpec { val one = 1 second val two = one + one val three = 3 * one - (0 * one) should be(zero) - (2 * one) should be(two) - (three - two) should be(one) - (three / 3) should be(one) - (two / one) should be(2) - (one + zero) should be(one) - (one / 1000000) should be(1.micro) + (0 * one) should ===(zero) + (2 * one) should ===(two) + (three - two) should ===(one) + (three / 3) should ===(one) + (two / one) should ===(2) + (one + zero) should ===(one) + (one / 1000000) should ===(1.micro) } "respect correct treatment of infinities" in { @@ -32,21 +32,21 @@ class DurationSpec extends AkkaSpec { val inf = Duration.Inf val minf = Duration.MinusInf val undefined = Duration.Undefined - (-inf) should be(minf) - (minf + inf) should be(undefined) - (inf - inf) should be(undefined) - (inf + minf) should be(undefined) - (minf - minf) should be(undefined) - (inf + inf) should be(inf) - (inf - minf) should be(inf) - (minf - inf) should be(minf) - (minf + minf) should be(minf) + (-inf) should ===(minf) + (minf + inf) should ===(undefined) + (inf - inf) should ===(undefined) + (inf + minf) should ===(undefined) + (minf - minf) should ===(undefined) + (inf + inf) should ===(inf) + (inf - minf) should ===(inf) + (minf - inf) should ===(minf) + (minf + minf) should ===(minf) assert(inf == inf) assert(minf == minf) - inf.compareTo(inf) should be(0) - inf.compareTo(one) should be(1) - minf.compareTo(minf) should be(0) - minf.compareTo(one) should be(-1) + inf.compareTo(inf) should ===(0) + inf.compareTo(one) should ===(1) + minf.compareTo(minf) should ===(0) + minf.compareTo(one) should ===(-1) assert(inf != minf) assert(minf != inf) assert(one != inf) @@ -58,7 +58,7 @@ class DurationSpec extends AkkaSpec { val x = unit.convert(Long.MaxValue, NANOSECONDS) val dur = Duration(x, unit) val mdur = Duration(-x, unit) - -mdur should be(dur) + -mdur should ===(dur) intercept[IllegalArgumentException] { Duration(x + 10000000d, unit) } intercept[IllegalArgumentException] { Duration(-x - 10000000d, unit) } if (unit != NANOSECONDS) { diff --git a/akka-actor-tests/src/test/scala/akka/util/IndexSpec.scala b/akka-actor-tests/src/test/scala/akka/util/IndexSpec.scala index 053a53630c..4c6d11ec15 100644 --- a/akka-actor-tests/src/test/scala/akka/util/IndexSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/util/IndexSpec.scala @@ -35,13 +35,13 @@ class IndexSpec extends AkkaSpec with Matchers with DefaultTimeout { } "take and return several values" in { val index = emptyIndex - index.put("s1", 1) should be(true) - index.put("s1", 1) should be(false) + index.put("s1", 1) should ===(true) + index.put("s1", 1) should ===(false) index.put("s1", 2) index.put("s1", 3) index.put("s2", 4) - index.valueIterator("s1").toSet should be(Set(1, 2, 3)) - index.valueIterator("s2").toSet should be(Set(4)) + index.valueIterator("s1").toSet should ===(Set(1, 2, 3)) + index.valueIterator("s2").toSet should ===(Set(4)) } "remove values" in { val index = emptyIndex @@ -50,16 +50,16 @@ class IndexSpec extends AkkaSpec with Matchers with DefaultTimeout { index.put("s2", 1) index.put("s2", 2) //Remove value - index.remove("s1", 1) should be(true) - index.remove("s1", 1) should be(false) - index.valueIterator("s1").toSet should be(Set(2)) + index.remove("s1", 1) should ===(true) + index.remove("s1", 1) should ===(false) + index.valueIterator("s1").toSet should ===(Set(2)) //Remove key index.remove("s2") match { - case Some(iter) ⇒ iter.toSet should be(Set(1, 2)) + case Some(iter) ⇒ iter.toSet should ===(Set(1, 2)) case None ⇒ fail() } - index.remove("s2") should be(None) - index.valueIterator("s2").toSet should be(Set()) + index.remove("s2") should ===(None) + index.valueIterator("s2").toSet should ===(Set.empty[Int]) } "remove the specified value" in { val index = emptyIndex @@ -71,9 +71,9 @@ class IndexSpec extends AkkaSpec with Matchers with DefaultTimeout { index.put("s3", 2) index.removeValue(1) - index.valueIterator("s1").toSet should be(Set(2, 3)) - index.valueIterator("s2").toSet should be(Set(2)) - index.valueIterator("s3").toSet should be(Set(2)) + index.valueIterator("s1").toSet should ===(Set(2, 3)) + index.valueIterator("s2").toSet should ===(Set(2)) + index.valueIterator("s3").toSet should ===(Set(2)) } "apply a function for all key-value pairs and find every value" in { val index = indexWithValues @@ -81,15 +81,15 @@ class IndexSpec extends AkkaSpec with Matchers with DefaultTimeout { var valueCount = 0 index.foreach((key, value) ⇒ { valueCount = valueCount + 1 - index.findValue(key)(_ == value) should be(Some(value)) + index.findValue(key)(_ == value) should ===(Some(value)) }) - valueCount should be(6) + valueCount should ===(6) } "be cleared" in { val index = indexWithValues - index.isEmpty should be(false) + index.isEmpty should ===(false) index.clear() - index.isEmpty should be(true) + index.isEmpty should ===(true) } "be able to be accessed in parallel" in { val index = new Index[Int, Int](100, _ compareTo _) @@ -113,7 +113,7 @@ class IndexSpec extends AkkaSpec with Matchers with DefaultTimeout { val key = Random.nextInt(nrOfKeys) val values = index.valueIterator(key) if (key >= nrOfKeys / 2) { - values.isEmpty should be(false) + values.isEmpty should ===(false) } } diff --git a/akka-actor-tests/src/test/scala/akka/util/SwitchSpec.scala b/akka-actor-tests/src/test/scala/akka/util/SwitchSpec.scala index a90e43aa7e..8391601e01 100644 --- a/akka-actor-tests/src/test/scala/akka/util/SwitchSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/util/SwitchSpec.scala @@ -14,22 +14,22 @@ class SwitchSpec extends WordSpec with Matchers { "on and off" in { val s = new Switch(false) - s.isOff should be(true) - s.isOn should be(false) + s.isOff should ===(true) + s.isOn should ===(false) - s.switchOn(()) should be(true) - s.isOn should be(true) - s.isOff should be(false) - s.switchOn(()) should be(false) - s.isOn should be(true) - s.isOff should be(false) + s.switchOn(()) should ===(true) + s.isOn should ===(true) + s.isOff should ===(false) + s.switchOn(()) should ===(false) + s.isOn should ===(true) + s.isOff should ===(false) - s.switchOff(()) should be(true) - s.isOff should be(true) - s.isOn should be(false) - s.switchOff(()) should be(false) - s.isOff should be(true) - s.isOn should be(false) + s.switchOff(()) should ===(true) + s.isOff should ===(true) + s.isOn should ===(false) + s.switchOff(()) should ===(false) + s.isOff should ===(true) + s.isOn should ===(false) } "revert when exception" in { @@ -37,42 +37,42 @@ class SwitchSpec extends WordSpec with Matchers { intercept[RuntimeException] { s.switchOn(throw new RuntimeException) } - s.isOff should be(true) + s.isOff should ===(true) } "run action without locking" in { val s = new Switch(false) - s.ifOffYield("yes") should be(Some("yes")) - s.ifOnYield("no") should be(None) - s.ifOff(()) should be(true) - s.ifOn(()) should be(false) + s.ifOffYield("yes") should ===(Some("yes")) + s.ifOnYield("no") should ===(None) + s.ifOff(()) should ===(true) + s.ifOn(()) should ===(false) s.switchOn(()) - s.ifOnYield("yes") should be(Some("yes")) - s.ifOffYield("no") should be(None) - s.ifOn(()) should be(true) - s.ifOff(()) should be(false) + s.ifOnYield("yes") should ===(Some("yes")) + s.ifOffYield("no") should ===(None) + s.ifOn(()) should ===(true) + s.ifOff(()) should ===(false) } "run action with locking" in { val s = new Switch(false) - s.whileOffYield("yes") should be(Some("yes")) - s.whileOnYield("no") should be(None) - s.whileOff(()) should be(true) - s.whileOn(()) should be(false) + s.whileOffYield("yes") should ===(Some("yes")) + s.whileOnYield("no") should ===(None) + s.whileOff(()) should ===(true) + s.whileOn(()) should ===(false) s.switchOn(()) - s.whileOnYield("yes") should be(Some("yes")) - s.whileOffYield("no") should be(None) - s.whileOn(()) should be(true) - s.whileOff(()) should be(false) + s.whileOnYield("yes") should ===(Some("yes")) + s.whileOffYield("no") should ===(None) + s.whileOn(()) should ===(true) + s.whileOff(()) should ===(false) } "run first or second action depending on state" in { val s = new Switch(false) - s.fold("on")("off") should be("off") + s.fold("on")("off") should ===("off") s.switchOn(()) - s.fold("on")("off") should be("on") + s.fold("on")("off") should ===("on") } "do proper locking" in { @@ -81,7 +81,7 @@ class SwitchSpec extends WordSpec with Matchers { s.locked { Thread.sleep(500) s.switchOn(()) - s.isOn should be(true) + s.isOn should ===(true) } val latch = new CountDownLatch(1) @@ -93,7 +93,7 @@ class SwitchSpec extends WordSpec with Matchers { }.start() latch.await(5, TimeUnit.SECONDS) - s.isOff should be(true) + s.isOff should ===(true) } } } diff --git a/akka-agent/src/test/scala/akka/agent/AgentSpec.scala b/akka-agent/src/test/scala/akka/agent/AgentSpec.scala index 3e67d1d38c..c04bfe6727 100644 --- a/akka-agent/src/test/scala/akka/agent/AgentSpec.scala +++ b/akka-agent/src/test/scala/akka/agent/AgentSpec.scala @@ -31,7 +31,7 @@ class AgentSpec extends AkkaSpec { agent send countDown countDown.await(5 seconds) - agent() should be("abcd") + agent() should ===("abcd") } "maintain order between send and sendOff" in { @@ -45,7 +45,7 @@ class AgentSpec extends AkkaSpec { agent send countDown l2.countDown countDown.await(5 seconds) - agent() should be("abcd") + agent() should ===("abcd") } "maintain order between alter and alterOff" in { @@ -59,9 +59,9 @@ class AgentSpec extends AkkaSpec { val result = Future.sequence(Seq(r1, r2, r3)).map(_.mkString(":")) l2.countDown - Await.result(result, 5 seconds) should be("ab:abc:abcd") + Await.result(result, 5 seconds) should ===("ab:abc:abcd") - agent() should be("abcd") + agent() should ===("abcd") } "be immediately readable" in { @@ -80,14 +80,14 @@ class AgentSpec extends AkkaSpec { agent send countDown countDown.await(5 seconds) - read should be(5) - agent() should be(10) + read should ===(5) + agent() should ===(10) } "be readable within a transaction" in { val agent = Agent(5) val value = atomic { t ⇒ agent() } - value should be(5) + value should ===(5) } "dispatch sends in successful transactions" in { @@ -100,7 +100,7 @@ class AgentSpec extends AkkaSpec { agent send countDown countDown.await(5 seconds) - agent() should be(10) + agent() should ===(10) } "not dispatch sends in aborted transactions" in { @@ -118,7 +118,7 @@ class AgentSpec extends AkkaSpec { agent send countDown countDown.await(5 seconds) - agent() should be(5) + agent() should ===(5) } "be able to return a 'queued' future" in { @@ -126,7 +126,7 @@ class AgentSpec extends AkkaSpec { agent send (_ + "b") agent send (_ + "c") - Await.result(agent.future, timeout.duration) should be("abc") + Await.result(agent.future, timeout.duration) should ===("abc") } "be able to await the value after updates have completed" in { @@ -134,15 +134,15 @@ class AgentSpec extends AkkaSpec { agent send (_ + "b") agent send (_ + "c") - Await.result(agent.future, timeout.duration) should be("abc") + Await.result(agent.future, timeout.duration) should ===("abc") } "be able to be mapped" in { val agent1 = Agent(5) val agent2 = agent1 map (_ * 2) - agent1() should be(5) - agent2() should be(10) + agent1() should ===(5) + agent2() should ===(10) } "be able to be used in a 'foreach' for comprehension" in { @@ -153,15 +153,15 @@ class AgentSpec extends AkkaSpec { result += value } - result should be(3) + result should ===(3) } "be able to be used in a 'map' for comprehension" in { val agent1 = Agent(5) val agent2 = for (value ← agent1) yield value * 2 - agent1() should be(5) - agent2() should be(10) + agent1() should ===(5) + agent2() should ===(10) } "be able to be used in a 'flatMap' for comprehension" in { @@ -173,9 +173,9 @@ class AgentSpec extends AkkaSpec { value2 ← agent2 } yield value1 + value2 - agent1() should be(1) - agent2() should be(2) - agent3() should be(3) + agent1() should ===(1) + agent2() should ===(2) + agent3() should ===(3) } } } diff --git a/akka-camel/src/test/scala/akka/camel/ActivationIntegrationTest.scala b/akka-camel/src/test/scala/akka/camel/ActivationIntegrationTest.scala index f3f928e6af..a03eb14fe7 100644 --- a/akka-camel/src/test/scala/akka/camel/ActivationIntegrationTest.scala +++ b/akka-camel/src/test/scala/akka/camel/ActivationIntegrationTest.scala @@ -26,9 +26,9 @@ class ActivationIntegrationTest extends WordSpec with Matchers with SharedCamelS "ActivationAware should be notified when endpoint is activated" in { val latch = new TestLatch(0) val actor = system.actorOf(Props(new TestConsumer("direct:actor-1", latch)), "act-direct-actor-1") - Await.result(camel.activationFutureFor(actor), 10 seconds) should be(actor) + Await.result(camel.activationFutureFor(actor), 10 seconds) should ===(actor) - template.requestBody("direct:actor-1", "test") should be("received test") + template.requestBody("direct:actor-1", "test") should ===("received test") } "ActivationAware should be notified when endpoint is de-activated" in { diff --git a/akka-camel/src/test/scala/akka/camel/CamelConfigSpec.scala b/akka-camel/src/test/scala/akka/camel/CamelConfigSpec.scala index 139a6594d6..365c0642f7 100644 --- a/akka-camel/src/test/scala/akka/camel/CamelConfigSpec.scala +++ b/akka-camel/src/test/scala/akka/camel/CamelConfigSpec.scala @@ -21,34 +21,34 @@ class CamelConfigSpec extends WordSpec with Matchers { } "CamelConfigSpec" must { "have correct activationTimeout config" in { - settings.ActivationTimeout should be(config.getMillisDuration("akka.camel.consumer.activation-timeout")) + settings.ActivationTimeout should ===(config.getMillisDuration("akka.camel.consumer.activation-timeout")) } "have correct autoAck config" in { - settings.AutoAck should be(config.getBoolean("akka.camel.consumer.auto-ack")) + settings.AutoAck should ===(config.getBoolean("akka.camel.consumer.auto-ack")) } "have correct replyTimeout config" in { - settings.ReplyTimeout should be(config.getMillisDuration("akka.camel.consumer.reply-timeout")) + settings.ReplyTimeout should ===(config.getMillisDuration("akka.camel.consumer.reply-timeout")) } "have correct streamingCache config" in { - settings.StreamingCache should be(config.getBoolean("akka.camel.streamingCache")) + settings.StreamingCache should ===(config.getBoolean("akka.camel.streamingCache")) } "have correct jmxStatistics config" in { - settings.JmxStatistics should be(config.getBoolean("akka.camel.jmx")) + settings.JmxStatistics should ===(config.getBoolean("akka.camel.jmx")) } "have correct body conversions config" in { val conversions = config.getConfig("akka.camel.conversions") - conversions.getString("file") should be("java.io.InputStream") - conversions.entrySet.size should be(1) + conversions.getString("file") should ===("java.io.InputStream") + conversions.entrySet.size should ===(1) } "have correct Context Provider" in { - settings.ContextProvider.isInstanceOf[DefaultContextProvider] should be(true) + settings.ContextProvider.isInstanceOf[DefaultContextProvider] should ===(true) } } } diff --git a/akka-camel/src/test/scala/akka/camel/ConcurrentActivationTest.scala b/akka-camel/src/test/scala/akka/camel/ConcurrentActivationTest.scala index 15b1923d86..008126f0df 100644 --- a/akka-camel/src/test/scala/akka/camel/ConcurrentActivationTest.scala +++ b/akka-camel/src/test/scala/akka/camel/ConcurrentActivationTest.scala @@ -58,13 +58,13 @@ class ConcurrentActivationTest extends WordSpec with Matchers with NonSharedCame } val (activations, deactivations) = Await.result(allRefsFuture, 10.seconds.dilated) // should be the size of the activated activated producers and consumers - activations.size should be(2 * number * number) + activations.size should ===(2 * number * number) // should be the size of the activated activated producers and consumers - deactivations.size should be(2 * number * number) + deactivations.size should ===(2 * number * number) def partitionNames(refs: immutable.Seq[ActorRef]) = refs.map(_.path.name).partition(_.startsWith("concurrent-test-echo-consumer")) def assertContainsSameElements(lists: (Seq[_], Seq[_])) { val (a, b) = lists - a.intersect(b).size should be(a.size) + a.intersect(b).size should ===(a.size) } val (activatedConsumerNames, activatedProducerNames) = partitionNames(activations) val (deactivatedConsumerNames, deactivatedProducerNames) = partitionNames(deactivations) diff --git a/akka-camel/src/test/scala/akka/camel/ConsumerIntegrationTest.scala b/akka-camel/src/test/scala/akka/camel/ConsumerIntegrationTest.scala index 825724c885..244c5fc784 100644 --- a/akka-camel/src/test/scala/akka/camel/ConsumerIntegrationTest.scala +++ b/akka-camel/src/test/scala/akka/camel/ConsumerIntegrationTest.scala @@ -44,7 +44,7 @@ class ConsumerIntegrationTest extends WordSpec with Matchers with NonSharedCamel case m: CamelMessage ⇒ sender() ! "received " + m.bodyAs[String] } }, name = "direct-a1") - camel.sendTo("direct:a1", msg = "some message") should be("received some message") + camel.sendTo("direct:a1", msg = "some message") should ===("received some message") } "Consumer must time-out if consumer is slow" taggedAs TimingTest in { @@ -59,7 +59,7 @@ class ConsumerIntegrationTest extends WordSpec with Matchers with NonSharedCamel intercept[CamelExecutionException] { camel.sendTo("direct:a3", msg = "some msg 3") - }.getCause.getClass should be(classOf[TimeoutException]) + }.getCause.getClass should ===(classOf[TimeoutException]) stop(ref) } @@ -82,7 +82,7 @@ class ConsumerIntegrationTest extends WordSpec with Matchers with NonSharedCamel consumer ! "throw" Await.ready(restarted, defaultTimeoutDuration) - camel.sendTo("direct:a2", msg = "xyz") should be("received xyz") + camel.sendTo("direct:a2", msg = "xyz") should ===("received xyz") } stop(consumer) } @@ -96,7 +96,7 @@ class ConsumerIntegrationTest extends WordSpec with Matchers with NonSharedCamel system.stop(consumer) Await.result(camel.deactivationFutureFor(consumer), defaultTimeoutDuration) - camel.routeCount should be(0) + camel.routeCount should ===(0) } "Consumer must register on uri passed in through constructor" in { @@ -104,10 +104,10 @@ class ConsumerIntegrationTest extends WordSpec with Matchers with NonSharedCamel Await.result(camel.activationFutureFor(consumer), defaultTimeoutDuration) camel.routeCount should be > (0) - camel.routes.get(0).getEndpoint.getEndpointUri should be("direct://test") + camel.routes.get(0).getEndpoint.getEndpointUri should ===("direct://test") system.stop(consumer) Await.result(camel.deactivationFutureFor(consumer), defaultTimeoutDuration) - camel.routeCount should be(0) + camel.routeCount should ===(0) stop(consumer) } @@ -118,7 +118,7 @@ class ConsumerIntegrationTest extends WordSpec with Matchers with NonSharedCamel } }, name = "direct-error-handler-test") filterEvents(EventFilter[TestException](occurrences = 1)) { - camel.sendTo("direct:error-handler-test", msg = "hello") should be("error: hello") + camel.sendTo("direct:error-handler-test", msg = "hello") should ===("error: hello") } stop(ref) } @@ -130,7 +130,7 @@ class ConsumerIntegrationTest extends WordSpec with Matchers with NonSharedCamel } }, name = "direct-failing-once-consumer") filterEvents(EventFilter[TestException](occurrences = 1)) { - camel.sendTo("direct:failing-once-concumer", msg = "hello") should be("accepted: hello") + camel.sendTo("direct:failing-once-concumer", msg = "hello") should ===("accepted: hello") } stop(ref) } @@ -140,7 +140,7 @@ class ConsumerIntegrationTest extends WordSpec with Matchers with NonSharedCamel def endpointUri = "direct:manual-ack" def receive = { case _ ⇒ sender() ! Ack } }, name = "direct-manual-ack-1") - camel.template.asyncSendBody("direct:manual-ack", "some message").get(defaultTimeoutDuration.toSeconds, TimeUnit.SECONDS) should be(null) //should not timeout + camel.template.asyncSendBody("direct:manual-ack", "some message").get(defaultTimeoutDuration.toSeconds, TimeUnit.SECONDS) should ===(null) //should not timeout stop(ref) } @@ -153,7 +153,7 @@ class ConsumerIntegrationTest extends WordSpec with Matchers with NonSharedCamel intercept[ExecutionException] { camel.template.asyncSendBody("direct:manual-ack", "some message").get(defaultTimeoutDuration.toSeconds, TimeUnit.SECONDS) - }.getCause.getCause should be(someException) + }.getCause.getCause should ===(someException) stop(ref) } @@ -173,7 +173,7 @@ class ConsumerIntegrationTest extends WordSpec with Matchers with NonSharedCamel val ref = start(new ErrorRespondingConsumer("direct:error-responding-consumer-1"), "error-responding-consumer") filterEvents(EventFilter[TestException](occurrences = 1)) { val response = camel.sendTo("direct:error-responding-consumer-1", "some body") - response should be("some body has an error") + response should ===("some body has an error") } stop(ref) } diff --git a/akka-camel/src/test/scala/akka/camel/DefaultCamelTest.scala b/akka-camel/src/test/scala/akka/camel/DefaultCamelTest.scala index 8f1aa34bd2..6786692c99 100644 --- a/akka-camel/src/test/scala/akka/camel/DefaultCamelTest.scala +++ b/akka-camel/src/test/scala/akka/camel/DefaultCamelTest.scala @@ -43,7 +43,7 @@ class DefaultCamelTest extends WordSpec with SharedCamelSystem with Matchers wit } "throws exception thrown by context.stop()" in { - exception.getMessage() should be("context"); + exception.getMessage() should ===("context"); } "tries to stop both template and context" in { diff --git a/akka-camel/src/test/scala/akka/camel/MessageScalaTest.scala b/akka-camel/src/test/scala/akka/camel/MessageScalaTest.scala index 1b462f7dcb..0e2a351d1e 100644 --- a/akka-camel/src/test/scala/akka/camel/MessageScalaTest.scala +++ b/akka-camel/src/test/scala/akka/camel/MessageScalaTest.scala @@ -14,7 +14,7 @@ import org.apache.camel.converter.stream.InputStreamCache class MessageScalaTest extends FunSuite with Matchers with SharedCamelSystem { implicit def camelContext = camel.context test("mustConvertDoubleBodyToString") { - CamelMessage(1.4, Map.empty).bodyAs[String] should be("1.4") + CamelMessage(1.4, Map.empty).bodyAs[String] should ===("1.4") } test("mustThrowExceptionWhenConvertingDoubleBodyToInputStream") { @@ -25,36 +25,36 @@ class MessageScalaTest extends FunSuite with Matchers with SharedCamelSystem { test("mustConvertDoubleHeaderToString") { val message = CamelMessage("test", Map("test" -> 1.4)) - message.headerAs[String]("test").get should be("1.4") + message.headerAs[String]("test").get should ===("1.4") } test("mustReturnSubsetOfHeaders") { val message = CamelMessage("test", Map("A" -> "1", "B" -> "2")) - message.headers(Set("B")) should be(Map("B" -> "2")) + message.headers(Set("B")) should ===(Map("B" -> "2")) } test("mustTransformBodyAndPreserveHeaders") { - CamelMessage("a", Map("A" -> "1")).mapBody((body: String) ⇒ body + "b") should be(CamelMessage("ab", Map("A" -> "1"))) + CamelMessage("a", Map("A" -> "1")).mapBody((body: String) ⇒ body + "b") should ===(CamelMessage("ab", Map("A" -> "1"))) } test("mustConvertBodyAndPreserveHeaders") { - CamelMessage(1.4, Map("A" -> "1")).withBodyAs[String] should be(CamelMessage("1.4", Map("A" -> "1"))) + CamelMessage(1.4, Map("A" -> "1")).withBodyAs[String] should ===(CamelMessage("1.4", Map("A" -> "1"))) } test("mustSetBodyAndPreserveHeaders") { - CamelMessage("test1", Map("A" -> "1")).copy(body = "test2") should be( + CamelMessage("test1", Map("A" -> "1")).copy(body = "test2") should ===( CamelMessage("test2", Map("A" -> "1"))) } test("mustSetHeadersAndPreserveBody") { - CamelMessage("test1", Map("A" -> "1")).copy(headers = Map("C" -> "3")) should be( + CamelMessage("test1", Map("A" -> "1")).copy(headers = Map("C" -> "3")) should ===( CamelMessage("test1", Map("C" -> "3"))) } test("mustBeAbleToReReadStreamCacheBody") { val msg = CamelMessage(new InputStreamCache("test1".getBytes("utf-8")), Map.empty) - msg.bodyAs[String] should be("test1") + msg.bodyAs[String] should ===("test1") // re-read - msg.bodyAs[String] should be("test1") + msg.bodyAs[String] should ===("test1") } } diff --git a/akka-camel/src/test/scala/akka/camel/ProducerFeatureTest.scala b/akka-camel/src/test/scala/akka/camel/ProducerFeatureTest.scala index 0b47a29316..81e9328440 100644 --- a/akka-camel/src/test/scala/akka/camel/ProducerFeatureTest.scala +++ b/akka-camel/src/test/scala/akka/camel/ProducerFeatureTest.scala @@ -79,12 +79,12 @@ class ProducerFeatureTest extends TestKit(ActorSystem("ProducerFeatureTest", Akk producer.tell(message, testActor) expectMsgPF(timeoutDuration) { case Failure(e: AkkaCamelException) ⇒ - e.getMessage should be("failure") - e.headers should be(Map(CamelMessage.MessageExchangeId -> "123")) + e.getMessage should ===("failure") + e.headers should ===(Map(CamelMessage.MessageExchangeId -> "123")) } } Await.ready(latch, timeoutDuration) - deadActor should be(Some(producer)) + deadActor should ===(Some(producer)) } "03 produce a message oneway" in { @@ -121,8 +121,8 @@ class ProducerFeatureTest extends TestKit(ActorSystem("ProducerFeatureTest", Akk producer.tell(message, testActor) expectMsgPF(timeoutDuration) { case Failure(e: AkkaCamelException) ⇒ - e.getMessage should be("failure") - e.headers should be(Map(CamelMessage.MessageExchangeId -> "123")) + e.getMessage should ===("failure") + e.headers should ===(Map(CamelMessage.MessageExchangeId -> "123")) } } } @@ -144,8 +144,8 @@ class ProducerFeatureTest extends TestKit(ActorSystem("ProducerFeatureTest", Akk producer.tell(message, testActor) expectMsgPF(timeoutDuration) { case Failure(e: AkkaCamelException) ⇒ - e.getMessage should be("failure") - e.headers should be(Map(CamelMessage.MessageExchangeId -> "123", "test" -> "failure")) + e.getMessage should ===("failure") + e.headers should ===(Map(CamelMessage.MessageExchangeId -> "123", "test" -> "failure")) } } } @@ -187,8 +187,8 @@ class ProducerFeatureTest extends TestKit(ActorSystem("ProducerFeatureTest", Akk producer.tell(message, testActor) expectMsgPF(timeoutDuration) { case Failure(e: AkkaCamelException) ⇒ - e.getMessage should be("failure") - e.headers should be(Map(CamelMessage.MessageExchangeId -> "123", "test" -> "failure")) + e.getMessage should ===("failure") + e.headers should ===(Map(CamelMessage.MessageExchangeId -> "123", "test" -> "failure")) } } } @@ -220,7 +220,7 @@ class ProducerFeatureTest extends TestKit(ActorSystem("ProducerFeatureTest", Akk val futureFailed = producer.tell("fail", testActor) expectMsgPF(timeoutDuration) { case Failure(e) ⇒ - e.getMessage should be("fail") + e.getMessage should ===("fail") } producer.tell("OK", testActor) expectMsg("OK") diff --git a/akka-camel/src/test/scala/akka/camel/UntypedProducerTest.scala b/akka-camel/src/test/scala/akka/camel/UntypedProducerTest.scala index 062fdb3814..f0b497b086 100644 --- a/akka-camel/src/test/scala/akka/camel/UntypedProducerTest.scala +++ b/akka-camel/src/test/scala/akka/camel/UntypedProducerTest.scala @@ -40,7 +40,7 @@ class UntypedProducerTest extends WordSpec with Matchers with BeforeAndAfterAll val expected = CamelMessage("received test", Map(CamelMessage.MessageExchangeId -> "123")) Await.result(future, timeout) match { - case result: CamelMessage ⇒ result should be(expected) + case result: CamelMessage ⇒ result should ===(expected) case unexpected ⇒ fail("Actor responded with unexpected message:" + unexpected) } @@ -55,8 +55,8 @@ class UntypedProducerTest extends WordSpec with Matchers with BeforeAndAfterAll Await.result(future, timeout) match { case e: AkkaCamelException ⇒ - e.getMessage should be("failure") - e.headers should be(Map(CamelMessage.MessageExchangeId -> "123")) + e.getMessage should ===("failure") + e.headers should ===(Map(CamelMessage.MessageExchangeId -> "123")) case unexpected ⇒ fail("Actor responded with unexpected message:" + unexpected) } } diff --git a/akka-camel/src/test/scala/akka/camel/internal/component/ActorEndpointPathTest.scala b/akka-camel/src/test/scala/akka/camel/internal/component/ActorEndpointPathTest.scala index d4cda5ab63..1bdb8f61dd 100644 --- a/akka-camel/src/test/scala/akka/camel/internal/component/ActorEndpointPathTest.scala +++ b/akka-camel/src/test/scala/akka/camel/internal/component/ActorEndpointPathTest.scala @@ -20,7 +20,7 @@ class ActorEndpointPathTest extends WordSpec with SharedCamelSystem with Matcher } "findActorIn returns None" when { - "non existing valid path" in { find("akka://system/user/unknownactor") should be(None) } + "non existing valid path" in { find("akka://system/user/unknownactor") should ===(None) } } "fromCamelPath throws IllegalArgumentException" when { "invalid path" in { @@ -29,4 +29,4 @@ class ActorEndpointPathTest extends WordSpec with SharedCamelSystem with Matcher } } } -} \ No newline at end of file +} diff --git a/akka-camel/src/test/scala/akka/camel/internal/component/ActorProducerTest.scala b/akka-camel/src/test/scala/akka/camel/internal/component/ActorProducerTest.scala index 891d0636e5..29f2d53d55 100644 --- a/akka-camel/src/test/scala/akka/camel/internal/component/ActorProducerTest.scala +++ b/akka-camel/src/test/scala/akka/camel/internal/component/ActorProducerTest.scala @@ -175,7 +175,7 @@ class ActorProducerTest extends TestKit(ActorSystem("test")) with WordSpecLike w probe.expectMsgType[CamelMessage] probe.sender() ! "some message" } - doneSync should be(false) + doneSync should ===(false) info("done async") asyncCallback.expectDoneAsyncWithin(1 second) @@ -237,7 +237,7 @@ class ActorProducerTest extends TestKit(ActorSystem("test")) with WordSpecLike w producer = given(outCapable = false, autoAck = true) val doneSync = producer.processExchangeAdapter(exchange, asyncCallback) - doneSync should be(true) + doneSync should ===(true) info("done sync") asyncCallback.expectDoneSyncWithin(1 second) info("async callback called") @@ -255,7 +255,7 @@ class ActorProducerTest extends TestKit(ActorSystem("test")) with WordSpecLike w val doneSync = producer.processExchangeAdapter(exchange, asyncCallback) - doneSync should be(false) + doneSync should ===(false) within(1 second) { probe.expectMsgType[CamelMessage] info("message sent to consumer") @@ -306,7 +306,7 @@ class ActorProducerTest extends TestKit(ActorSystem("test")) with WordSpecLike w val doneSync = producer.processExchangeAdapter(exchange, asyncCallback) - doneSync should be(false) + doneSync should ===(false) within(1 second) { probe.expectMsgType[CamelMessage] info("message sent to consumer") diff --git a/akka-camel/src/test/scala/akka/camel/internal/component/DurationConverterTest.scala b/akka-camel/src/test/scala/akka/camel/internal/component/DurationConverterTest.scala index c450767f0a..4d3c8a7a5b 100644 --- a/akka-camel/src/test/scala/akka/camel/internal/component/DurationConverterTest.scala +++ b/akka-camel/src/test/scala/akka/camel/internal/component/DurationConverterTest.scala @@ -15,27 +15,27 @@ class DurationConverterSpec extends WordSpec with Matchers { import DurationTypeConverter._ "DurationTypeConverter must convert '10 nanos'" in { - convertTo(classOf[Duration], "10 nanos") should be(10 nanos) + convertTo(classOf[Duration], "10 nanos") should ===(10 nanos) } "DurationTypeConverter must do the roundtrip" in { - convertTo(classOf[Duration], (10 seconds).toString()) should be(10 seconds) + convertTo(classOf[Duration], (10 seconds).toString()) should ===(10 seconds) } "DurationTypeConverter must throw if invalid format" in { - tryConvertTo(classOf[Duration], "abc nanos") should be(null) + tryConvertTo(classOf[Duration], "abc nanos") should ===(null) intercept[TypeConversionException] { - mandatoryConvertTo(classOf[Duration], "abc nanos") should be(10 nanos) - }.getValue should be("abc nanos") + mandatoryConvertTo(classOf[Duration], "abc nanos") should ===(10 nanos) + }.getValue should ===("abc nanos") } "DurationTypeConverter must throw if doesn't end with time unit" in { - tryConvertTo(classOf[Duration], "10233") should be(null) + tryConvertTo(classOf[Duration], "10233") should ===(null) intercept[TypeConversionException] { - mandatoryConvertTo(classOf[Duration], "10233") should be(10 nanos) - }.getValue should be("10233") + mandatoryConvertTo(classOf[Duration], "10233") should ===(10 nanos) + }.getValue should ===("10233") } } diff --git a/akka-cluster-metrics/src/multi-jvm/scala/akka/cluster/metrics/ClusterMetricsExtensionSpec.scala b/akka-cluster-metrics/src/multi-jvm/scala/akka/cluster/metrics/ClusterMetricsExtensionSpec.scala index d677c057b9..72a5d7b692 100644 --- a/akka-cluster-metrics/src/multi-jvm/scala/akka/cluster/metrics/ClusterMetricsExtensionSpec.scala +++ b/akka-cluster-metrics/src/multi-jvm/scala/akka/cluster/metrics/ClusterMetricsExtensionSpec.scala @@ -109,10 +109,10 @@ abstract class ClusterMetricsEnabledSpec extends MultiNodeSpec(ClusterMetricsEna "and gossip metrics around the node ring" taggedAs LongRunningTest in within(60 seconds) { awaitClusterUp(roles: _*) enterBarrier("cluster-started") - awaitAssert(clusterView.members.count(_.status == MemberStatus.Up) should be(roles.size)) + awaitAssert(clusterView.members.count(_.status == MemberStatus.Up) should ===(roles.size)) // TODO ensure same contract - //awaitAssert(clusterView.clusterMetrics.size should be(roles.size)) - awaitAssert(metricsView.clusterMetrics.size should be(roles.size)) + //awaitAssert(clusterView.clusterMetrics.size should ===(roles.size)) + awaitAssert(metricsView.clusterMetrics.size should ===(roles.size)) val collector = MetricsCollector(cluster.system) collector.sample.metrics.size should be > (3) enterBarrier("after") @@ -125,8 +125,8 @@ abstract class ClusterMetricsEnabledSpec extends MultiNodeSpec(ClusterMetricsEna runOn(node2, node3, node4, node5) { markNodeAsUnavailable(node1) // TODO ensure same contract - //awaitAssert(clusterView.clusterMetrics.size should be(roles.size - 1)) - awaitAssert(metricsView.clusterMetrics.size should be(roles.size - 1)) + //awaitAssert(clusterView.clusterMetrics.size should ===(roles.size - 1)) + awaitAssert(metricsView.clusterMetrics.size should ===(roles.size - 1)) } enterBarrier("finished") } @@ -149,14 +149,14 @@ abstract class ClusterMetricsDisabledSpec extends MultiNodeSpec(ClusterMetricsDi "not collect metrics, not publish metrics events, and not gossip metrics" taggedAs LongRunningTest in { awaitClusterUp(roles: _*) // TODO ensure same contract - //clusterView.clusterMetrics.size should be(0) - metricsView.clusterMetrics.size should be(0) + //clusterView.clusterMetrics.size should ===(0) + metricsView.clusterMetrics.size should ===(0) cluster.subscribe(testActor, classOf[ClusterMetricsChanged]) expectMsgType[CurrentClusterState] expectNoMsg // TODO ensure same contract - //clusterView.clusterMetrics.size should be(0) - metricsView.clusterMetrics.size should be(0) + //clusterView.clusterMetrics.size should ===(0) + metricsView.clusterMetrics.size should ===(0) enterBarrier("after") } } diff --git a/akka-cluster-metrics/src/multi-jvm/scala/akka/cluster/metrics/ClusterMetricsRoutingSpec.scala b/akka-cluster-metrics/src/multi-jvm/scala/akka/cluster/metrics/ClusterMetricsRoutingSpec.scala index b2ee12ed10..bcd0961e99 100644 --- a/akka-cluster-metrics/src/multi-jvm/scala/akka/cluster/metrics/ClusterMetricsRoutingSpec.scala +++ b/akka-cluster-metrics/src/multi-jvm/scala/akka/cluster/metrics/ClusterMetricsRoutingSpec.scala @@ -143,9 +143,9 @@ abstract class AdaptiveLoadBalancingRouterSpec extends MultiNodeSpec(AdaptiveLoa props(Props[Echo]), name) // it may take some time until router receives cluster member events - awaitAssert { currentRoutees(router).size should be(roles.size) } + awaitAssert { currentRoutees(router).size should ===(roles.size) } val routees = currentRoutees(router) - routees.map { case ActorRefRoutee(ref) ⇒ fullAddress(ref) }.toSet should be(roles.map(address).toSet) + routees.map { case ActorRefRoutee(ref) ⇒ fullAddress(ref) }.toSet should ===(roles.map(address).toSet) router } @@ -178,7 +178,7 @@ abstract class AdaptiveLoadBalancingRouterSpec extends MultiNodeSpec(AdaptiveLoa replies(node1) should be > (0) replies(node2) should be > (0) replies(node3) should be > (0) - replies.values.sum should be(iterationCount) + replies.values.sum should ===(iterationCount) } @@ -211,7 +211,7 @@ abstract class AdaptiveLoadBalancingRouterSpec extends MultiNodeSpec(AdaptiveLoa val replies = receiveReplies(iterationCount) replies(node3) should be > (replies(node2)) - replies.values.sum should be(iterationCount) + replies.values.sum should ===(iterationCount) } @@ -222,9 +222,9 @@ abstract class AdaptiveLoadBalancingRouterSpec extends MultiNodeSpec(AdaptiveLoa runOn(node1) { val router3 = system.actorOf(FromConfig.props(Props[Memory]), "router3") // it may take some time until router receives cluster member events - awaitAssert { currentRoutees(router3).size should be(9) } + awaitAssert { currentRoutees(router3).size should ===(9) } val routees = currentRoutees(router3) - routees.map { case ActorRefRoutee(ref) ⇒ fullAddress(ref) }.toSet should be(Set(address(node1))) + routees.map { case ActorRefRoutee(ref) ⇒ fullAddress(ref) }.toSet should ===(Set(address(node1))) } enterBarrier("after-4") } @@ -233,9 +233,9 @@ abstract class AdaptiveLoadBalancingRouterSpec extends MultiNodeSpec(AdaptiveLoa runOn(node1) { val router4 = system.actorOf(FromConfig.props(Props[Memory]), "router4") // it may take some time until router receives cluster member events - awaitAssert { currentRoutees(router4).size should be(6) } + awaitAssert { currentRoutees(router4).size should ===(6) } val routees = currentRoutees(router4) - routees.map { case ActorRefRoutee(ref) ⇒ fullAddress(ref) }.toSet should be(Set( + routees.map { case ActorRefRoutee(ref) ⇒ fullAddress(ref) }.toSet should ===(Set( address(node1), address(node2), address(node3))) } enterBarrier("after-5") diff --git a/akka-cluster-metrics/src/test/scala/akka/cluster/metrics/ClusterMetricsExtensionSpec.scala b/akka-cluster-metrics/src/test/scala/akka/cluster/metrics/ClusterMetricsExtensionSpec.scala index a127981a0e..d6edd82bec 100644 --- a/akka-cluster-metrics/src/test/scala/akka/cluster/metrics/ClusterMetricsExtensionSpec.scala +++ b/akka-cluster-metrics/src/test/scala/akka/cluster/metrics/ClusterMetricsExtensionSpec.scala @@ -49,14 +49,14 @@ class MetricsExtensionSpec extends AkkaSpec(MetricsConfig.clusterSigarMock) "collect metrics after start command" in { extension.supervisor ! CollectionStartMessage - awaitAssert(metricsNodeCount should be(nodeCount), 15 seconds) + awaitAssert(metricsNodeCount should ===(nodeCount), 15 seconds) } "collect mock sample during a time window" in { - awaitAssert(metricsHistorySize should be(sampleCount), 15 seconds) + awaitAssert(metricsHistorySize should ===(sampleCount), 15 seconds) extension.supervisor ! CollectionStopMessage awaitSample() - metricsNodeCount should be(nodeCount) + metricsNodeCount should ===(nodeCount) metricsHistorySize should be >= (sampleCount) } @@ -76,16 +76,16 @@ class MetricsExtensionSpec extends AkkaSpec(MetricsConfig.clusterSigarMock) (0.700, 0.343, 0.137), (0.700, 0.372, 0.148)) - expected.size should be(sampleCount) + expected.size should ===(sampleCount) history.zip(expected) foreach { case (mockMetrics, expectedData) ⇒ (mockMetrics, expectedData) match { case (Cpu(_, _, loadAverageMock, cpuCombinedMock, cpuStolenMock, _), (loadAverageEwma, cpuCombinedEwma, cpuStolenEwma)) ⇒ - loadAverageMock.get should be(loadAverageEwma +- epsilon) - cpuCombinedMock.get should be(cpuCombinedEwma +- epsilon) - cpuStolenMock.get should be(cpuStolenEwma +- epsilon) + loadAverageMock.get should ===(loadAverageEwma +- epsilon) + cpuCombinedMock.get should ===(cpuCombinedEwma +- epsilon) + cpuStolenMock.get should ===(cpuStolenEwma +- epsilon) } } } @@ -97,7 +97,7 @@ class MetricsExtensionSpec extends AkkaSpec(MetricsConfig.clusterSigarMock) val size1 = metricsHistorySize awaitSample() val size2 = metricsHistorySize - size1 should be(size2) + size1 should ===(size2) extension.supervisor ! CollectionStartMessage awaitSample() @@ -111,7 +111,7 @@ class MetricsExtensionSpec extends AkkaSpec(MetricsConfig.clusterSigarMock) awaitSample() val size5 = metricsHistorySize - size5 should be(size4) + size5 should ===(size4) } diff --git a/akka-cluster-metrics/src/test/scala/akka/cluster/metrics/ClusterMetricsRoutingSpec.scala b/akka-cluster-metrics/src/test/scala/akka/cluster/metrics/ClusterMetricsRoutingSpec.scala index 9435566ee1..a0ef169949 100644 --- a/akka-cluster-metrics/src/test/scala/akka/cluster/metrics/ClusterMetricsRoutingSpec.scala +++ b/akka-cluster-metrics/src/test/scala/akka/cluster/metrics/ClusterMetricsRoutingSpec.scala @@ -65,13 +65,13 @@ class MetricsSelectorSpec extends WordSpec with Matchers { "calculate weights from capacity" in { val capacity = Map(a1 -> 0.6, b1 -> 0.3, c1 -> 0.1) val weights = abstractSelector.weights(capacity) - weights should be(Map(c1 -> 1, b1 -> 3, a1 -> 6)) + weights should ===(Map(c1 -> 1, b1 -> 3, a1 -> 6)) } "handle low and zero capacity" in { val capacity = Map(a1 -> 0.0, b1 -> 1.0, c1 -> 0.005, d1 -> 0.004) val weights = abstractSelector.weights(capacity) - weights should be(Map(a1 -> 0, b1 -> 100, c1 -> 1, d1 -> 0)) + weights should ===(Map(a1 -> 0, b1 -> 100, c1 -> 1, d1 -> 0)) } } @@ -79,40 +79,40 @@ class MetricsSelectorSpec extends WordSpec with Matchers { "HeapMetricsSelector" must { "calculate capacity of heap metrics" in { val capacity = HeapMetricsSelector.capacity(nodeMetrics) - capacity(a1) should be(0.75 +- 0.0001) - capacity(b1) should be(0.75 +- 0.0001) - capacity(c1) should be(0.0 +- 0.0001) - capacity(d1) should be(0.001953125 +- 0.0001) + capacity(a1) should ===(0.75 +- 0.0001) + capacity(b1) should ===(0.75 +- 0.0001) + capacity(c1) should ===(0.0 +- 0.0001) + capacity(d1) should ===(0.001953125 +- 0.0001) } } "CpuMetricsSelector" must { "calculate capacity of cpuCombined metrics" in { val capacity = CpuMetricsSelector.capacity(nodeMetrics) - capacity(a1) should be(1.0 - 0.2 - 0.1 * (1.0 + factor) +- 0.0001) - capacity(b1) should be(1.0 - 0.4 - 0.2 * (1.0 + factor) +- 0.0001) - capacity(c1) should be(1.0 - 0.6 - 0.3 * (1.0 + factor) +- 0.0001) - capacity.contains(d1) should be(false) + capacity(a1) should ===(1.0 - 0.2 - 0.1 * (1.0 + factor) +- 0.0001) + capacity(b1) should ===(1.0 - 0.4 - 0.2 * (1.0 + factor) +- 0.0001) + capacity(c1) should ===(1.0 - 0.6 - 0.3 * (1.0 + factor) +- 0.0001) + capacity.contains(d1) should ===(false) } } "SystemLoadAverageMetricsSelector" must { "calculate capacity of systemLoadAverage metrics" in { val capacity = SystemLoadAverageMetricsSelector.capacity(nodeMetrics) - capacity(a1) should be(0.9375 +- 0.0001) - capacity(b1) should be(0.9375 +- 0.0001) - capacity(c1) should be(0.0 +- 0.0001) - capacity.contains(d1) should be(false) + capacity(a1) should ===(0.9375 +- 0.0001) + capacity(b1) should ===(0.9375 +- 0.0001) + capacity(c1) should ===(0.0 +- 0.0001) + capacity.contains(d1) should ===(false) } } "MixMetricsSelector" must { "aggregate capacity of all metrics" in { val capacity = MixMetricsSelector.capacity(nodeMetrics) - capacity(a1) should be((0.75 + 0.67 + 0.9375) / 3 +- 0.0001) - capacity(b1) should be((0.75 + 0.34 + 0.9375) / 3 +- 0.0001) - capacity(c1) should be((0.0 + 0.01 + 0.0) / 3 +- 0.0001) - capacity(d1) should be((0.001953125) / 1 +- 0.0001) + capacity(a1) should ===((0.75 + 0.67 + 0.9375) / 3 +- 0.0001) + capacity(b1) should ===((0.75 + 0.34 + 0.9375) / 3 +- 0.0001) + capacity(c1) should ===((0.0 + 0.01 + 0.0) / 3 +- 0.0001) + capacity(d1) should ===((0.001953125) / 1 +- 0.0001) } } diff --git a/akka-cluster-metrics/src/test/scala/akka/cluster/metrics/ClusterMetricsSettingsSpec.scala b/akka-cluster-metrics/src/test/scala/akka/cluster/metrics/ClusterMetricsSettingsSpec.scala index 723041d08f..5a85a578fb 100644 --- a/akka-cluster-metrics/src/test/scala/akka/cluster/metrics/ClusterMetricsSettingsSpec.scala +++ b/akka-cluster-metrics/src/test/scala/akka/cluster/metrics/ClusterMetricsSettingsSpec.scala @@ -22,22 +22,22 @@ class ClusterMetricsSettingsSpec extends AkkaSpec { import settings._ // Extension. - MetricsDispatcher should be(Dispatchers.DefaultDispatcherId) - PeriodicTasksInitialDelay should be(1 second) - NativeLibraryExtractFolder should be(System.getProperty("user.dir") + "/native") + MetricsDispatcher should ===(Dispatchers.DefaultDispatcherId) + PeriodicTasksInitialDelay should ===(1 second) + NativeLibraryExtractFolder should ===(System.getProperty("user.dir") + "/native") // Supervisor. - SupervisorName should be("cluster-metrics") - SupervisorStrategyProvider should be(classOf[ClusterMetricsStrategy].getName) - SupervisorStrategyConfiguration should be( + SupervisorName should ===("cluster-metrics") + SupervisorStrategyProvider should ===(classOf[ClusterMetricsStrategy].getName) + SupervisorStrategyConfiguration should ===( ConfigFactory.parseString("loggingEnabled=true,maxNrOfRetries=3,withinTimeRange=3s")) // Collector. - CollectorEnabled should be(true) - CollectorProvider should be("") - CollectorSampleInterval should be(3 seconds) - CollectorGossipInterval should be(3 seconds) - CollectorMovingAverageHalfLife should be(12 seconds) + CollectorEnabled should ===(true) + CollectorProvider should ===("") + CollectorSampleInterval should ===(3 seconds) + CollectorGossipInterval should ===(3 seconds) + CollectorMovingAverageHalfLife should ===(12 seconds) } } } diff --git a/akka-cluster-metrics/src/test/scala/akka/cluster/metrics/EWMASpec.scala b/akka-cluster-metrics/src/test/scala/akka/cluster/metrics/EWMASpec.scala index ab56dc3253..053b6ab842 100644 --- a/akka-cluster-metrics/src/test/scala/akka/cluster/metrics/EWMASpec.scala +++ b/akka-cluster-metrics/src/test/scala/akka/cluster/metrics/EWMASpec.scala @@ -20,34 +20,34 @@ class EWMASpec extends AkkaSpec(MetricsConfig.defaultEnabled) with MetricsCollec "calcualate same ewma for constant values" in { val ds = EWMA(value = 100.0, alpha = 0.18) :+ 100.0 :+ 100.0 :+ 100.0 - ds.value should be(100.0 +- 0.001) + ds.value should ===(100.0 +- 0.001) } "calcualate correct ewma for normal decay" in { val d0 = EWMA(value = 1000.0, alpha = 2.0 / (1 + 10)) - d0.value should be(1000.0 +- 0.01) + d0.value should ===(1000.0 +- 0.01) val d1 = d0 :+ 10.0 - d1.value should be(820.0 +- 0.01) + d1.value should ===(820.0 +- 0.01) val d2 = d1 :+ 10.0 - d2.value should be(672.73 +- 0.01) + d2.value should ===(672.73 +- 0.01) val d3 = d2 :+ 10.0 - d3.value should be(552.23 +- 0.01) + d3.value should ===(552.23 +- 0.01) val d4 = d3 :+ 10.0 - d4.value should be(453.64 +- 0.01) + d4.value should ===(453.64 +- 0.01) val dn = (1 to 100).foldLeft(d0)((d, _) ⇒ d :+ 10.0) - dn.value should be(10.0 +- 0.1) + dn.value should ===(10.0 +- 0.1) } "calculate ewma for alpha 1.0, max bias towards latest value" in { val d0 = EWMA(value = 100.0, alpha = 1.0) - d0.value should be(100.0 +- 0.01) + d0.value should ===(100.0 +- 0.01) val d1 = d0 :+ 1.0 - d1.value should be(1.0 +- 0.01) + d1.value should ===(1.0 +- 0.01) val d2 = d1 :+ 57.0 - d2.value should be(57.0 +- 0.01) + d2.value should ===(57.0 +- 0.01) val d3 = d2 :+ 10.0 - d3.value should be(10.0 +- 0.01) + d3.value should ===(10.0 +- 0.01) } "calculate alpha from half-life and collect interval" in { @@ -58,21 +58,21 @@ class EWMASpec extends AkkaSpec(MetricsConfig.defaultEnabled) with MetricsCollec val halfLife = n.toDouble / 2.8854 val collectInterval = 1.second val halfLifeDuration = (halfLife * 1000).millis - EWMA.alpha(halfLifeDuration, collectInterval) should be(expectedAlpha +- 0.001) + EWMA.alpha(halfLifeDuration, collectInterval) should ===(expectedAlpha +- 0.001) } "calculate sane alpha from short half-life" in { val alpha = EWMA.alpha(1.millis, 3.seconds) alpha should be <= (1.0) alpha should be >= (0.0) - alpha should be(1.0 +- 0.001) + alpha should ===(1.0 +- 0.001) } "calculate sane alpha from long half-life" in { val alpha = EWMA.alpha(1.day, 3.seconds) alpha should be <= (1.0) alpha should be >= (0.0) - alpha should be(0.0 +- 0.001) + alpha should ===(0.0 +- 0.001) } "calculate the ewma for multiple, variable, data streams" taggedAs LongRunningTest in { @@ -88,7 +88,7 @@ class EWMASpec extends AkkaSpec(MetricsConfig.defaultEnabled) with MetricsCollec case Some(previous) ⇒ if (latest.isSmooth && latest.value != previous.value) { val updated = previous :+ latest - updated.isSmooth should be(true) + updated.isSmooth should ===(true) updated.smoothValue should not be (previous.smoothValue) Some(updated) } else None diff --git a/akka-cluster-metrics/src/test/scala/akka/cluster/metrics/MetricSpec.scala b/akka-cluster-metrics/src/test/scala/akka/cluster/metrics/MetricSpec.scala index 3c5c5ef074..56892a1dad 100644 --- a/akka-cluster-metrics/src/test/scala/akka/cluster/metrics/MetricSpec.scala +++ b/akka-cluster-metrics/src/test/scala/akka/cluster/metrics/MetricSpec.scala @@ -19,35 +19,35 @@ class MetricNumericConverterSpec extends WordSpec with Matchers with MetricNumer "MetricNumericConverter" must { "convert" in { - convertNumber(0).isLeft should be(true) - convertNumber(1).left.get should be(1) - convertNumber(1L).isLeft should be(true) - convertNumber(0.0).isRight should be(true) + convertNumber(0).isLeft should ===(true) + convertNumber(1).left.get should ===(1) + convertNumber(1L).isLeft should ===(true) + convertNumber(0.0).isRight should ===(true) } "define a new metric" in { val Some(metric) = Metric.create(HeapMemoryUsed, 256L, decayFactor = Some(0.18)) - metric.name should be(HeapMemoryUsed) - metric.value should be(256L) - metric.isSmooth should be(true) - metric.smoothValue should be(256.0 +- 0.0001) + metric.name should ===(HeapMemoryUsed) + metric.value should ===(256L) + metric.isSmooth should ===(true) + metric.smoothValue should ===(256.0 +- 0.0001) } "define an undefined value with a None " in { - Metric.create("x", -1, None).isDefined should be(false) - Metric.create("x", java.lang.Double.NaN, None).isDefined should be(false) - Metric.create("x", Failure(new RuntimeException), None).isDefined should be(false) + Metric.create("x", -1, None).isDefined should ===(false) + Metric.create("x", java.lang.Double.NaN, None).isDefined should ===(false) + Metric.create("x", Failure(new RuntimeException), None).isDefined should ===(false) } "recognize whether a metric value is defined" in { - defined(0) should be(true) - defined(0.0) should be(true) + defined(0) should ===(true) + defined(0.0) should ===(true) } "recognize whether a metric value is not defined" in { - defined(-1) should be(false) - defined(-1.0) should be(false) - defined(Double.NaN) should be(false) + defined(-1) should ===(false) + defined(-1.0) should ===(false) + defined(Double.NaN) should ===(false) } } } @@ -61,11 +61,11 @@ class NodeMetricsSpec extends WordSpec with Matchers { "NodeMetrics must" must { "return correct result for 2 'same' nodes" in { - (NodeMetrics(node1, 0) sameAs NodeMetrics(node1, 0)) should be(true) + (NodeMetrics(node1, 0) sameAs NodeMetrics(node1, 0)) should ===(true) } "return correct result for 2 not 'same' nodes" in { - (NodeMetrics(node1, 0) sameAs NodeMetrics(node2, 0)) should be(false) + (NodeMetrics(node1, 0) sameAs NodeMetrics(node2, 0)) should ===(false) } "merge 2 NodeMetrics by most recent" in { @@ -73,10 +73,10 @@ class NodeMetricsSpec extends WordSpec with Matchers { val sample2 = NodeMetrics(node1, 2, Set(Metric.create("a", 11, None), Metric.create("c", 30, None)).flatten) val merged = sample1 merge sample2 - merged.timestamp should be(sample2.timestamp) - merged.metric("a").map(_.value) should be(Some(11)) - merged.metric("b").map(_.value) should be(Some(20)) - merged.metric("c").map(_.value) should be(Some(30)) + merged.timestamp should ===(sample2.timestamp) + merged.metric("a").map(_.value) should ===(Some(11)) + merged.metric("b").map(_.value) should ===(Some(20)) + merged.metric("c").map(_.value) should ===(Some(30)) } "not merge 2 NodeMetrics if master is more recent" in { @@ -84,8 +84,8 @@ class NodeMetricsSpec extends WordSpec with Matchers { val sample2 = NodeMetrics(node1, 0, Set(Metric.create("a", 11, None), Metric.create("c", 30, None)).flatten) val merged = sample1 merge sample2 // older and not same - merged.timestamp should be(sample1.timestamp) - merged.metrics should be(sample1.metrics) + merged.timestamp should ===(sample1.timestamp) + merged.metrics should ===(sample1.metrics) } "update 2 NodeMetrics by most recent" in { @@ -94,11 +94,11 @@ class NodeMetricsSpec extends WordSpec with Matchers { val updated = sample1 update sample2 - updated.metrics.size should be(3) - updated.timestamp should be(sample2.timestamp) - updated.metric("a").map(_.value) should be(Some(11)) - updated.metric("b").map(_.value) should be(Some(20)) - updated.metric("c").map(_.value) should be(Some(30)) + updated.metrics.size should ===(3) + updated.timestamp should ===(sample2.timestamp) + updated.metric("a").map(_.value) should ===(Some(11)) + updated.metric("b").map(_.value) should ===(Some(20)) + updated.metric("c").map(_.value) should ===(Some(30)) } "update 3 NodeMetrics with ewma applied" in { @@ -113,18 +113,18 @@ class NodeMetricsSpec extends WordSpec with Matchers { val updated = sample1 update sample2 update sample3 - updated.metrics.size should be(4) - updated.timestamp should be(sample3.timestamp) + updated.metrics.size should ===(4) + updated.timestamp should ===(sample3.timestamp) - updated.metric("a").map(_.value).get should be(3) - updated.metric("b").map(_.value).get should be(4) - updated.metric("c").map(_.value).get should be(5) - updated.metric("d").map(_.value).get should be(6) + updated.metric("a").map(_.value).get should ===(3) + updated.metric("b").map(_.value).get should ===(4) + updated.metric("c").map(_.value).get should ===(5) + updated.metric("d").map(_.value).get should ===(6) - updated.metric("a").map(_.smoothValue).get should be(1.512 +- epsilon) - updated.metric("b").map(_.smoothValue).get should be(4.000 +- epsilon) - updated.metric("c").map(_.smoothValue).get should be(5.000 +- epsilon) - updated.metric("d").map(_.smoothValue).get should be(6.000 +- epsilon) + updated.metric("a").map(_.smoothValue).get should ===(1.512 +- epsilon) + updated.metric("b").map(_.smoothValue).get should ===(4.000 +- epsilon) + updated.metric("c").map(_.smoothValue).get should ===(5.000 +- epsilon) + updated.metric("d").map(_.smoothValue).get should ===(6.000 +- epsilon) } } @@ -144,13 +144,13 @@ class MetricsGossipSpec extends AkkaSpec(MetricsConfig.defaultEnabled) with Impl m2.metrics.size should be > (3) val g1 = MetricsGossip.empty :+ m1 - g1.nodes.size should be(1) - g1.nodeMetricsFor(m1.address).map(_.metrics) should be(Some(m1.metrics)) + g1.nodes.size should ===(1) + g1.nodeMetricsFor(m1.address).map(_.metrics) should ===(Some(m1.metrics)) val g2 = g1 :+ m2 - g2.nodes.size should be(2) - g2.nodeMetricsFor(m1.address).map(_.metrics) should be(Some(m1.metrics)) - g2.nodeMetricsFor(m2.address).map(_.metrics) should be(Some(m2.metrics)) + g2.nodes.size should ===(2) + g2.nodeMetricsFor(m1.address).map(_.metrics) should ===(Some(m1.metrics)) + g2.nodeMetricsFor(m2.address).map(_.metrics) should ===(Some(m2.metrics)) } "merge peer metrics" in { @@ -158,15 +158,15 @@ class MetricsGossipSpec extends AkkaSpec(MetricsConfig.defaultEnabled) with Impl val m2 = NodeMetrics(Address("akka.tcp", "sys", "a", 2555), newTimestamp, collector.sample.metrics) val g1 = MetricsGossip.empty :+ m1 :+ m2 - g1.nodes.size should be(2) + g1.nodes.size should ===(2) val beforeMergeNodes = g1.nodes val m2Updated = m2 copy (metrics = collector.sample.metrics, timestamp = m2.timestamp + 1000) val g2 = g1 :+ m2Updated // merge peers - g2.nodes.size should be(2) - g2.nodeMetricsFor(m1.address).map(_.metrics) should be(Some(m1.metrics)) - g2.nodeMetricsFor(m2.address).map(_.metrics) should be(Some(m2Updated.metrics)) - g2.nodes collect { case peer if peer.address == m2.address ⇒ peer.timestamp should be(m2Updated.timestamp) } + g2.nodes.size should ===(2) + g2.nodeMetricsFor(m1.address).map(_.metrics) should ===(Some(m1.metrics)) + g2.nodeMetricsFor(m2.address).map(_.metrics) should ===(Some(m2Updated.metrics)) + g2.nodes collect { case peer if peer.address == m2.address ⇒ peer.timestamp should ===(m2Updated.timestamp) } } "merge an existing metric set for a node and update node ring" in { @@ -178,22 +178,22 @@ class MetricsGossipSpec extends AkkaSpec(MetricsConfig.defaultEnabled) with Impl val g1 = MetricsGossip.empty :+ m1 :+ m2 val g2 = MetricsGossip.empty :+ m3 :+ m2Updated - g1.nodes.map(_.address) should be(Set(m1.address, m2.address)) + g1.nodes.map(_.address) should ===(Set(m1.address, m2.address)) // should contain nodes 1,3, and the most recent version of 2 val mergedGossip = g1 merge g2 - mergedGossip.nodes.map(_.address) should be(Set(m1.address, m2.address, m3.address)) - mergedGossip.nodeMetricsFor(m1.address).map(_.metrics) should be(Some(m1.metrics)) - mergedGossip.nodeMetricsFor(m2.address).map(_.metrics) should be(Some(m2Updated.metrics)) - mergedGossip.nodeMetricsFor(m3.address).map(_.metrics) should be(Some(m3.metrics)) + mergedGossip.nodes.map(_.address) should ===(Set(m1.address, m2.address, m3.address)) + mergedGossip.nodeMetricsFor(m1.address).map(_.metrics) should ===(Some(m1.metrics)) + mergedGossip.nodeMetricsFor(m2.address).map(_.metrics) should ===(Some(m2Updated.metrics)) + mergedGossip.nodeMetricsFor(m3.address).map(_.metrics) should ===(Some(m3.metrics)) mergedGossip.nodes.foreach(_.metrics.size should be > (3)) - mergedGossip.nodeMetricsFor(m2.address).map(_.timestamp) should be(Some(m2Updated.timestamp)) + mergedGossip.nodeMetricsFor(m2.address).map(_.timestamp) should ===(Some(m2Updated.timestamp)) } "get the current NodeMetrics if it exists in the local nodes" in { val m1 = NodeMetrics(Address("akka.tcp", "sys", "a", 2554), newTimestamp, collector.sample.metrics) val g1 = MetricsGossip.empty :+ m1 - g1.nodeMetricsFor(m1.address).map(_.metrics) should be(Some(m1.metrics)) + g1.nodeMetricsFor(m1.address).map(_.metrics) should ===(Some(m1.metrics)) } "remove a node if it is no longer Up" in { @@ -201,12 +201,12 @@ class MetricsGossipSpec extends AkkaSpec(MetricsConfig.defaultEnabled) with Impl val m2 = NodeMetrics(Address("akka.tcp", "sys", "a", 2555), newTimestamp, collector.sample.metrics) val g1 = MetricsGossip.empty :+ m1 :+ m2 - g1.nodes.size should be(2) + g1.nodes.size should ===(2) val g2 = g1 remove m1.address - g2.nodes.size should be(1) - g2.nodes.exists(_.address == m1.address) should be(false) - g2.nodeMetricsFor(m1.address) should be(None) - g2.nodeMetricsFor(m2.address).map(_.metrics) should be(Some(m2.metrics)) + g2.nodes.size should ===(1) + g2.nodes.exists(_.address == m1.address) should ===(false) + g2.nodeMetricsFor(m1.address) should ===(None) + g2.nodeMetricsFor(m2.address).map(_.metrics) should ===(Some(m2.metrics)) } "filter nodes" in { @@ -214,12 +214,12 @@ class MetricsGossipSpec extends AkkaSpec(MetricsConfig.defaultEnabled) with Impl val m2 = NodeMetrics(Address("akka.tcp", "sys", "a", 2555), newTimestamp, collector.sample.metrics) val g1 = MetricsGossip.empty :+ m1 :+ m2 - g1.nodes.size should be(2) + g1.nodes.size should ===(2) val g2 = g1 filter Set(m2.address) - g2.nodes.size should be(1) - g2.nodes.exists(_.address == m1.address) should be(false) - g2.nodeMetricsFor(m1.address) should be(None) - g2.nodeMetricsFor(m2.address).map(_.metrics) should be(Some(m2.metrics)) + g2.nodes.size should ===(1) + g2.nodes.exists(_.address == m1.address) should ===(false) + g2.nodeMetricsFor(m1.address) should ===(None) + g2.nodeMetricsFor(m2.address).map(_.metrics) should ===(Some(m2.metrics)) } } } diff --git a/akka-cluster-metrics/src/test/scala/akka/cluster/metrics/MetricsCollectorSpec.scala b/akka-cluster-metrics/src/test/scala/akka/cluster/metrics/MetricsCollectorSpec.scala index 10242064f5..b8ecaab328 100644 --- a/akka-cluster-metrics/src/test/scala/akka/cluster/metrics/MetricsCollectorSpec.scala +++ b/akka-cluster-metrics/src/test/scala/akka/cluster/metrics/MetricsCollectorSpec.scala @@ -32,8 +32,8 @@ class MetricsCollectorSpec extends AkkaSpec(MetricsConfig.defaultEnabled) with I val merged12 = sample2 flatMap (latest ⇒ sample1 collect { case peer if latest sameAs peer ⇒ val m = peer :+ latest - m.value should be(latest.value) - m.isSmooth should be(peer.isSmooth || latest.isSmooth) + m.value should ===(latest.value) + m.isSmooth should ===(peer.isSmooth || latest.isSmooth) m }) @@ -42,8 +42,8 @@ class MetricsCollectorSpec extends AkkaSpec(MetricsConfig.defaultEnabled) with I val merged34 = sample4 flatMap (latest ⇒ sample3 collect { case peer if latest sameAs peer ⇒ val m = peer :+ latest - m.value should be(latest.value) - m.isSmooth should be(peer.isSmooth || latest.isSmooth) + m.value should ===(latest.value) + m.isSmooth should ===(peer.isSmooth || latest.isSmooth) m }) } @@ -86,9 +86,9 @@ class MetricsCollectorSpec extends AkkaSpec(MetricsConfig.defaultEnabled) with I // it's not present on all platforms val c = collector.asInstanceOf[JmxMetricsCollector] val heap = c.heapMemoryUsage - c.heapUsed(heap).isDefined should be(true) - c.heapCommitted(heap).isDefined should be(true) - c.processors.isDefined should be(true) + c.heapUsed(heap).isDefined should ===(true) + c.heapCommitted(heap).isDefined should ===(true) + c.processors.isDefined should ===(true) } "collect 50 node metrics samples in an acceptable duration" taggedAs LongRunningTest in within(10 seconds) { diff --git a/akka-cluster-metrics/src/test/scala/akka/cluster/metrics/protobuf/MessageSerializerSpec.scala b/akka-cluster-metrics/src/test/scala/akka/cluster/metrics/protobuf/MessageSerializerSpec.scala index 256413912c..505f61d16a 100644 --- a/akka-cluster-metrics/src/test/scala/akka/cluster/metrics/protobuf/MessageSerializerSpec.scala +++ b/akka-cluster-metrics/src/test/scala/akka/cluster/metrics/protobuf/MessageSerializerSpec.scala @@ -27,7 +27,7 @@ class MessageSerializerSpec extends AkkaSpec( val ref = serializer.fromBinary(blob, obj.getClass) obj match { case _ ⇒ - ref should be(obj) + ref should ===(obj) } } diff --git a/akka-cluster/src/multi-jvm/scala/akka/cluster/ClientDowningNodeThatIsUnreachableSpec.scala b/akka-cluster/src/multi-jvm/scala/akka/cluster/ClientDowningNodeThatIsUnreachableSpec.scala index 2eb717a775..e08ae78504 100644 --- a/akka-cluster/src/multi-jvm/scala/akka/cluster/ClientDowningNodeThatIsUnreachableSpec.scala +++ b/akka-cluster/src/multi-jvm/scala/akka/cluster/ClientDowningNodeThatIsUnreachableSpec.scala @@ -53,7 +53,7 @@ abstract class ClientDowningNodeThatIsUnreachableSpec(multiNodeConfig: ClientDow enterBarrier("down-third-node") awaitMembersUp(numberOfMembers = 3, canNotBePartOfMemberRing = Set(thirdAddress)) - clusterView.members.exists(_.address == thirdAddress) should be(false) + clusterView.members.exists(_.address == thirdAddress) should ===(false) } runOn(third) { diff --git a/akka-cluster/src/multi-jvm/scala/akka/cluster/ClientDowningNodeThatIsUpSpec.scala b/akka-cluster/src/multi-jvm/scala/akka/cluster/ClientDowningNodeThatIsUpSpec.scala index 88fea2444f..97db9ab74d 100644 --- a/akka-cluster/src/multi-jvm/scala/akka/cluster/ClientDowningNodeThatIsUpSpec.scala +++ b/akka-cluster/src/multi-jvm/scala/akka/cluster/ClientDowningNodeThatIsUpSpec.scala @@ -52,7 +52,7 @@ abstract class ClientDowningNodeThatIsUpSpec(multiNodeConfig: ClientDowningNodeT markNodeAsUnavailable(thirdAddress) awaitMembersUp(numberOfMembers = 3, canNotBePartOfMemberRing = Set(thirdAddress)) - clusterView.members.exists(_.address == thirdAddress) should be(false) + clusterView.members.exists(_.address == thirdAddress) should ===(false) } runOn(third) { diff --git a/akka-cluster/src/multi-jvm/scala/akka/cluster/ClusterAccrualFailureDetectorSpec.scala b/akka-cluster/src/multi-jvm/scala/akka/cluster/ClusterAccrualFailureDetectorSpec.scala index dc59c5547d..fb4db5dbcb 100644 --- a/akka-cluster/src/multi-jvm/scala/akka/cluster/ClusterAccrualFailureDetectorSpec.scala +++ b/akka-cluster/src/multi-jvm/scala/akka/cluster/ClusterAccrualFailureDetectorSpec.scala @@ -40,9 +40,9 @@ abstract class ClusterAccrualFailureDetectorSpec awaitClusterUp(first, second, third) Thread.sleep(5.seconds.dilated.toMillis) // let them heartbeat - cluster.failureDetector.isAvailable(first) should be(true) - cluster.failureDetector.isAvailable(second) should be(true) - cluster.failureDetector.isAvailable(third) should be(true) + cluster.failureDetector.isAvailable(first) should ===(true) + cluster.failureDetector.isAvailable(second) should ===(true) + cluster.failureDetector.isAvailable(third) should ===(true) enterBarrier("after-1") } @@ -59,14 +59,14 @@ abstract class ClusterAccrualFailureDetectorSpec // detect failure... awaitCond(!cluster.failureDetector.isAvailable(second), 15.seconds) // other connections still ok - cluster.failureDetector.isAvailable(third) should be(true) + cluster.failureDetector.isAvailable(third) should ===(true) } runOn(second) { // detect failure... awaitCond(!cluster.failureDetector.isAvailable(first), 15.seconds) // other connections still ok - cluster.failureDetector.isAvailable(third) should be(true) + cluster.failureDetector.isAvailable(third) should ===(true) } enterBarrier("partitioned") @@ -99,8 +99,8 @@ abstract class ClusterAccrualFailureDetectorSpec // remaning nodes should detect failure... awaitCond(!cluster.failureDetector.isAvailable(third), 15.seconds) // other connections still ok - cluster.failureDetector.isAvailable(first) should be(true) - cluster.failureDetector.isAvailable(second) should be(true) + cluster.failureDetector.isAvailable(first) should ===(true) + cluster.failureDetector.isAvailable(second) should ===(true) } enterBarrier("after-3") diff --git a/akka-cluster/src/multi-jvm/scala/akka/cluster/ClusterDeathWatchSpec.scala b/akka-cluster/src/multi-jvm/scala/akka/cluster/ClusterDeathWatchSpec.scala index 6cf47df028..1d186a0b52 100644 --- a/akka-cluster/src/multi-jvm/scala/akka/cluster/ClusterDeathWatchSpec.scala +++ b/akka-cluster/src/multi-jvm/scala/akka/cluster/ClusterDeathWatchSpec.scala @@ -204,7 +204,7 @@ abstract class ClusterDeathWatchSpec enterBarrier("fifth-terminated") runOn(first) { - expectMsgType[Terminated].actor.path.name should be("subject5") + expectMsgType[Terminated].actor.path.name should ===("subject5") } enterBarrier("after-3") @@ -221,8 +221,8 @@ abstract class ClusterDeathWatchSpec runOn(fourth) { val hello = system.actorOf(Props[Hello], "hello") - hello.isInstanceOf[RemoteActorRef] should be(true) - hello.path.address should be(address(first)) + hello.isInstanceOf[RemoteActorRef] should ===(true) + hello.path.address should ===(address(first)) watch(hello) enterBarrier("hello-deployed") diff --git a/akka-cluster/src/multi-jvm/scala/akka/cluster/ClusterMetricsDisabledSpec.scala b/akka-cluster/src/multi-jvm/scala/akka/cluster/ClusterMetricsDisabledSpec.scala index efa4335e56..51a5741f14 100644 --- a/akka-cluster/src/multi-jvm/scala/akka/cluster/ClusterMetricsDisabledSpec.scala +++ b/akka-cluster/src/multi-jvm/scala/akka/cluster/ClusterMetricsDisabledSpec.scala @@ -25,11 +25,11 @@ abstract class ClusterMetricsDisabledSpec extends MultiNodeSpec(ClusterMetricsDi "Cluster metrics" must { "not collect metrics, not publish ClusterMetricsChanged, and not gossip metrics" taggedAs LongRunningTest in { awaitClusterUp(roles: _*) - clusterView.clusterMetrics.size should be(0) + clusterView.clusterMetrics.size should ===(0) cluster.subscribe(testActor, classOf[ClusterMetricsChanged]) expectMsgType[CurrentClusterState] expectNoMsg - clusterView.clusterMetrics.size should be(0) + clusterView.clusterMetrics.size should ===(0) enterBarrier("after") } } diff --git a/akka-cluster/src/multi-jvm/scala/akka/cluster/ClusterMetricsSpec.scala b/akka-cluster/src/multi-jvm/scala/akka/cluster/ClusterMetricsSpec.scala index 294d7ca0bc..9735e306c8 100644 --- a/akka-cluster/src/multi-jvm/scala/akka/cluster/ClusterMetricsSpec.scala +++ b/akka-cluster/src/multi-jvm/scala/akka/cluster/ClusterMetricsSpec.scala @@ -40,8 +40,8 @@ abstract class ClusterMetricsSpec extends MultiNodeSpec(ClusterMetricsMultiJvmSp "and gossip metrics around the node ring" taggedAs LongRunningTest in within(60 seconds) { awaitClusterUp(roles: _*) enterBarrier("cluster-started") - awaitAssert(clusterView.members.count(_.status == MemberStatus.Up) should be(roles.size)) - awaitAssert(clusterView.clusterMetrics.size should be(roles.size)) + awaitAssert(clusterView.members.count(_.status == MemberStatus.Up) should ===(roles.size)) + awaitAssert(clusterView.clusterMetrics.size should ===(roles.size)) val collector = MetricsCollector(cluster.system, cluster.settings) collector.sample.metrics.size should be > (3) enterBarrier("after") @@ -53,7 +53,7 @@ abstract class ClusterMetricsSpec extends MultiNodeSpec(ClusterMetricsMultiJvmSp enterBarrier("first-left") runOn(second, third, fourth, fifth) { markNodeAsUnavailable(first) - awaitAssert(clusterView.clusterMetrics.size should be(roles.size - 1)) + awaitAssert(clusterView.clusterMetrics.size should ===(roles.size - 1)) } enterBarrier("finished") } diff --git a/akka-cluster/src/multi-jvm/scala/akka/cluster/ConvergenceSpec.scala b/akka-cluster/src/multi-jvm/scala/akka/cluster/ConvergenceSpec.scala index 3376ed2197..5b569ce7cd 100644 --- a/akka-cluster/src/multi-jvm/scala/akka/cluster/ConvergenceSpec.scala +++ b/akka-cluster/src/multi-jvm/scala/akka/cluster/ConvergenceSpec.scala @@ -69,12 +69,12 @@ abstract class ConvergenceSpec(multiNodeConfig: ConvergenceMultiNodeConfig) within(28 seconds) { // third becomes unreachable - awaitAssert(clusterView.unreachableMembers.size should be(1)) + awaitAssert(clusterView.unreachableMembers.size should ===(1)) awaitSeenSameState(first, second) // still one unreachable - clusterView.unreachableMembers.size should be(1) - clusterView.unreachableMembers.head.address should be(thirdAddress) - clusterView.members.size should be(3) + clusterView.unreachableMembers.size should ===(1) + clusterView.unreachableMembers.head.address should ===(thirdAddress) + clusterView.members.size should ===(3) } } @@ -95,11 +95,11 @@ abstract class ConvergenceSpec(multiNodeConfig: ConvergenceMultiNodeConfig) runOn(first, second, fourth) { for (n ← 1 to 5) { - awaitAssert(clusterView.members.size should be(3)) + awaitAssert(clusterView.members.size should ===(3)) awaitSeenSameState(first, second, fourth) - memberStatus(first) should be(Some(MemberStatus.Up)) - memberStatus(second) should be(Some(MemberStatus.Up)) - memberStatus(fourth) should be(None) + memberStatus(first) should ===(Some(MemberStatus.Up)) + memberStatus(second) should ===(Some(MemberStatus.Up)) + memberStatus(fourth) should ===(None) // wait and then check again Thread.sleep(1.second.dilated.toMillis) } diff --git a/akka-cluster/src/multi-jvm/scala/akka/cluster/DisallowJoinOfTwoClustersSpec.scala b/akka-cluster/src/multi-jvm/scala/akka/cluster/DisallowJoinOfTwoClustersSpec.scala index 13e2612332..1ee6553fc1 100644 --- a/akka-cluster/src/multi-jvm/scala/akka/cluster/DisallowJoinOfTwoClustersSpec.scala +++ b/akka-cluster/src/multi-jvm/scala/akka/cluster/DisallowJoinOfTwoClustersSpec.scala @@ -67,7 +67,7 @@ abstract class DisallowJoinOfTwoClustersSpec // no change expected 1 to 5 foreach { _ ⇒ - clusterView.members.size should be(expectedSize) + clusterView.members.size should ===(expectedSize) Thread.sleep(1000) } diff --git a/akka-cluster/src/multi-jvm/scala/akka/cluster/JoinInProgressSpec.scala b/akka-cluster/src/multi-jvm/scala/akka/cluster/JoinInProgressSpec.scala index 78dec29c9a..9bd4a52f53 100644 --- a/akka-cluster/src/multi-jvm/scala/akka/cluster/JoinInProgressSpec.scala +++ b/akka-cluster/src/multi-jvm/scala/akka/cluster/JoinInProgressSpec.scala @@ -54,7 +54,7 @@ abstract class JoinInProgressSpec val until = Deadline.now + 5.seconds while (!until.isOverdue) { Thread.sleep(200) - cluster.failureDetector.isAvailable(second) should be(true) + cluster.failureDetector.isAvailable(second) should ===(true) } } diff --git a/akka-cluster/src/multi-jvm/scala/akka/cluster/LeaderElectionSpec.scala b/akka-cluster/src/multi-jvm/scala/akka/cluster/LeaderElectionSpec.scala index 278cbeed44..02ec9b05be 100644 --- a/akka-cluster/src/multi-jvm/scala/akka/cluster/LeaderElectionSpec.scala +++ b/akka-cluster/src/multi-jvm/scala/akka/cluster/LeaderElectionSpec.scala @@ -51,7 +51,7 @@ abstract class LeaderElectionSpec(multiNodeConfig: LeaderElectionMultiNodeConfig awaitClusterUp(first, second, third, fourth) if (myself != controller) { - clusterView.isLeader should be(myself == sortedRoles.head) + clusterView.isLeader should ===(myself == sortedRoles.head) assertLeaderIn(sortedRoles) } @@ -104,7 +104,7 @@ abstract class LeaderElectionSpec(multiNodeConfig: LeaderElectionMultiNodeConfig enterBarrier("after-down" + n) awaitMembersUp(currentRoles.size - 1) val nextExpectedLeader = remainingRoles.head - clusterView.isLeader should be(myself == nextExpectedLeader) + clusterView.isLeader should ===(myself == nextExpectedLeader) assertLeaderIn(remainingRoles) enterBarrier("completed" + n) diff --git a/akka-cluster/src/multi-jvm/scala/akka/cluster/MBeanSpec.scala b/akka-cluster/src/multi-jvm/scala/akka/cluster/MBeanSpec.scala index d81a854379..deaa8e6e6e 100644 --- a/akka-cluster/src/multi-jvm/scala/akka/cluster/MBeanSpec.scala +++ b/akka-cluster/src/multi-jvm/scala/akka/cluster/MBeanSpec.scala @@ -45,35 +45,35 @@ abstract class MBeanSpec "Cluster MBean" must { "expose attributes" taggedAs LongRunningTest in { val info = mbeanServer.getMBeanInfo(mbeanName) - info.getAttributes.map(_.getName).toSet should be(Set( + info.getAttributes.map(_.getName).toSet should ===(Set( "ClusterStatus", "Members", "Unreachable", "MemberStatus", "Leader", "Singleton", "Available")) enterBarrier("after-1") } "expose operations" taggedAs LongRunningTest in { val info = mbeanServer.getMBeanInfo(mbeanName) - info.getOperations.map(_.getName).toSet should be(Set( + info.getOperations.map(_.getName).toSet should ===(Set( "join", "leave", "down")) enterBarrier("after-2") } "change attributes after startup" taggedAs LongRunningTest in { runOn(first) { - mbeanServer.getAttribute(mbeanName, "Available").asInstanceOf[Boolean] should be(false) - mbeanServer.getAttribute(mbeanName, "Singleton").asInstanceOf[Boolean] should be(false) - mbeanServer.getAttribute(mbeanName, "Leader") should be("") - mbeanServer.getAttribute(mbeanName, "Members") should be("") - mbeanServer.getAttribute(mbeanName, "Unreachable") should be("") - mbeanServer.getAttribute(mbeanName, "MemberStatus") should be("Removed") + mbeanServer.getAttribute(mbeanName, "Available").asInstanceOf[Boolean] should ===(false) + mbeanServer.getAttribute(mbeanName, "Singleton").asInstanceOf[Boolean] should ===(false) + mbeanServer.getAttribute(mbeanName, "Leader") should ===("") + mbeanServer.getAttribute(mbeanName, "Members") should ===("") + mbeanServer.getAttribute(mbeanName, "Unreachable") should ===("") + mbeanServer.getAttribute(mbeanName, "MemberStatus") should ===("Removed") } awaitClusterUp(first) runOn(first) { - awaitAssert(mbeanServer.getAttribute(mbeanName, "MemberStatus") should be("Up")) - awaitAssert(mbeanServer.getAttribute(mbeanName, "Leader") should be(address(first).toString)) - mbeanServer.getAttribute(mbeanName, "Singleton").asInstanceOf[Boolean] should be(true) - mbeanServer.getAttribute(mbeanName, "Members") should be(address(first).toString) - mbeanServer.getAttribute(mbeanName, "Unreachable") should be("") - mbeanServer.getAttribute(mbeanName, "Available").asInstanceOf[Boolean] should be(true) + awaitAssert(mbeanServer.getAttribute(mbeanName, "MemberStatus") should ===("Up")) + awaitAssert(mbeanServer.getAttribute(mbeanName, "Leader") should ===(address(first).toString)) + mbeanServer.getAttribute(mbeanName, "Singleton").asInstanceOf[Boolean] should ===(true) + mbeanServer.getAttribute(mbeanName, "Members") should ===(address(first).toString) + mbeanServer.getAttribute(mbeanName, "Unreachable") should ===("") + mbeanServer.getAttribute(mbeanName, "Available").asInstanceOf[Boolean] should ===(true) } enterBarrier("after-3") } @@ -86,12 +86,12 @@ abstract class MBeanSpec awaitMembersUp(4) assertMembers(clusterView.members, roles.map(address(_)): _*) - awaitAssert(mbeanServer.getAttribute(mbeanName, "MemberStatus") should be("Up")) + awaitAssert(mbeanServer.getAttribute(mbeanName, "MemberStatus") should ===("Up")) val expectedMembers = roles.sorted.map(address(_)).mkString(",") - awaitAssert(mbeanServer.getAttribute(mbeanName, "Members") should be(expectedMembers)) + awaitAssert(mbeanServer.getAttribute(mbeanName, "Members") should ===(expectedMembers)) val expectedLeader = address(roleOfLeader()) - awaitAssert(mbeanServer.getAttribute(mbeanName, "Leader") should be(expectedLeader.toString)) - mbeanServer.getAttribute(mbeanName, "Singleton").asInstanceOf[Boolean] should be(false) + awaitAssert(mbeanServer.getAttribute(mbeanName, "Leader") should ===(expectedLeader.toString)) + mbeanServer.getAttribute(mbeanName, "Singleton").asInstanceOf[Boolean] should ===(false) enterBarrier("after-4") } @@ -105,9 +105,9 @@ abstract class MBeanSpec enterBarrier("fourth-shutdown") runOn(first, second, third) { - awaitAssert(mbeanServer.getAttribute(mbeanName, "Unreachable") should be(fourthAddress.toString)) + awaitAssert(mbeanServer.getAttribute(mbeanName, "Unreachable") should ===(fourthAddress.toString)) val expectedMembers = Seq(first, second, third, fourth).sorted.map(address(_)).mkString(",") - awaitAssert(mbeanServer.getAttribute(mbeanName, "Members") should be(expectedMembers)) + awaitAssert(mbeanServer.getAttribute(mbeanName, "Members") should ===(expectedMembers)) } enterBarrier("fourth-unreachable") @@ -162,7 +162,7 @@ abstract class MBeanSpec // awaitAssert to make sure that all nodes detects unreachable within(15.seconds) { - awaitAssert(mbeanServer.getAttribute(mbeanName, "ClusterStatus") should be(expectedJson)) + awaitAssert(mbeanServer.getAttribute(mbeanName, "ClusterStatus") should ===(expectedJson)) } } @@ -182,7 +182,7 @@ abstract class MBeanSpec runOn(first, second, third) { awaitMembersUp(3, canNotBePartOfMemberRing = Set(fourthAddress)) assertMembers(clusterView.members, first, second, third) - awaitAssert(mbeanServer.getAttribute(mbeanName, "Unreachable") should be("")) + awaitAssert(mbeanServer.getAttribute(mbeanName, "Unreachable") should ===("")) } enterBarrier("after-6") @@ -197,7 +197,7 @@ abstract class MBeanSpec awaitMembersUp(2) assertMembers(clusterView.members, first, second) val expectedMembers = Seq(first, second).sorted.map(address(_)).mkString(",") - awaitAssert(mbeanServer.getAttribute(mbeanName, "Members") should be(expectedMembers)) + awaitAssert(mbeanServer.getAttribute(mbeanName, "Members") should ===(expectedMembers)) } runOn(third) { awaitCond(cluster.isTerminated) diff --git a/akka-cluster/src/multi-jvm/scala/akka/cluster/MinMembersBeforeUpSpec.scala b/akka-cluster/src/multi-jvm/scala/akka/cluster/MinMembersBeforeUpSpec.scala index 971725aa04..3edabe7cf0 100644 --- a/akka-cluster/src/multi-jvm/scala/akka/cluster/MinMembersBeforeUpSpec.scala +++ b/akka-cluster/src/multi-jvm/scala/akka/cluster/MinMembersBeforeUpSpec.scala @@ -94,12 +94,12 @@ abstract class MinMembersBeforeUpBase(multiNodeConfig: MultiNodeConfig) cluster join myself awaitAssert { clusterView.refreshCurrentState() - clusterView.status should be(Joining) + clusterView.status should ===(Joining) } } enterBarrier("first-started") - onUpLatch.isOpen should be(false) + onUpLatch.isOpen should ===(false) runOn(second) { cluster.join(first) @@ -108,14 +108,14 @@ abstract class MinMembersBeforeUpBase(multiNodeConfig: MultiNodeConfig) val expectedAddresses = Set(first, second) map address awaitAssert { clusterView.refreshCurrentState() - clusterView.members.map(_.address) should be(expectedAddresses) + clusterView.members.map(_.address) should ===(expectedAddresses) } - clusterView.members.map(_.status) should be(Set(Joining)) + clusterView.members.map(_.status) should ===(Set(Joining)) // and it should not change 1 to 5 foreach { _ ⇒ Thread.sleep(1000) - clusterView.members.map(_.address) should be(expectedAddresses) - clusterView.members.map(_.status) should be(Set(Joining)) + clusterView.members.map(_.address) should ===(expectedAddresses) + clusterView.members.map(_.status) should ===(Set(Joining)) } } enterBarrier("second-joined") diff --git a/akka-cluster/src/multi-jvm/scala/akka/cluster/MultiNodeClusterSpec.scala b/akka-cluster/src/multi-jvm/scala/akka/cluster/MultiNodeClusterSpec.scala index 8c4ffd4ecd..9e4388c25c 100644 --- a/akka-cluster/src/multi-jvm/scala/akka/cluster/MultiNodeClusterSpec.scala +++ b/akka-cluster/src/multi-jvm/scala/akka/cluster/MultiNodeClusterSpec.scala @@ -241,8 +241,8 @@ trait MultiNodeClusterSpec extends Suite with STMultiNodeSpec with WatchedByCoro def assertMembers(gotMembers: Iterable[Member], expectedAddresses: Address*): Unit = { import Member.addressOrdering val members = gotMembers.toIndexedSeq - members.size should be(expectedAddresses.length) - expectedAddresses.sorted.zipWithIndex.foreach { case (a, i) ⇒ members(i).address should be(a) } + members.size should ===(expectedAddresses.length) + expectedAddresses.sorted.zipWithIndex.foreach { case (a, i) ⇒ members(i).address should ===(a) } } /** @@ -288,22 +288,22 @@ trait MultiNodeClusterSpec extends Suite with STMultiNodeSpec with WatchedByCoro within(timeout) { if (!canNotBePartOfMemberRing.isEmpty) // don't run this on an empty set awaitAssert(canNotBePartOfMemberRing foreach (a ⇒ clusterView.members.map(_.address) should not contain (a))) - awaitAssert(clusterView.members.size should be(numberOfMembers)) - awaitAssert(clusterView.members.map(_.status) should be(Set(MemberStatus.Up))) + awaitAssert(clusterView.members.size should ===(numberOfMembers)) + awaitAssert(clusterView.members.map(_.status) should ===(Set(MemberStatus.Up))) // clusterView.leader is updated by LeaderChanged, await that to be updated also val expectedLeader = clusterView.members.headOption.map(_.address) - awaitAssert(clusterView.leader should be(expectedLeader)) + awaitAssert(clusterView.leader should ===(expectedLeader)) } } def awaitAllReachable(): Unit = - awaitAssert(clusterView.unreachableMembers should be(Set.empty)) + awaitAssert(clusterView.unreachableMembers should ===(Set.empty)) /** * Wait until the specified nodes have seen the same gossip overview. */ def awaitSeenSameState(addresses: Address*): Unit = - awaitAssert((addresses.toSet -- clusterView.seenBy) should be(Set.empty)) + awaitAssert((addresses.toSet -- clusterView.seenBy) should ===(Set.empty)) /** * Leader according to the address ordering of the roles. diff --git a/akka-cluster/src/multi-jvm/scala/akka/cluster/NodeMembershipSpec.scala b/akka-cluster/src/multi-jvm/scala/akka/cluster/NodeMembershipSpec.scala index b1f3dba9d8..c1f1893b66 100644 --- a/akka-cluster/src/multi-jvm/scala/akka/cluster/NodeMembershipSpec.scala +++ b/akka-cluster/src/multi-jvm/scala/akka/cluster/NodeMembershipSpec.scala @@ -38,9 +38,9 @@ abstract class NodeMembershipSpec runOn(first, second) { cluster.join(first) - awaitAssert(clusterView.members.size should be(2)) + awaitAssert(clusterView.members.size should ===(2)) assertMembers(clusterView.members, first, second) - awaitAssert(clusterView.members.map(_.status) should be(Set(MemberStatus.Up))) + awaitAssert(clusterView.members.map(_.status) should ===(Set(MemberStatus.Up))) } enterBarrier("after-1") @@ -52,9 +52,9 @@ abstract class NodeMembershipSpec cluster.join(first) } - awaitAssert(clusterView.members.size should be(3)) + awaitAssert(clusterView.members.size should ===(3)) assertMembers(clusterView.members, first, second, third) - awaitAssert(clusterView.members.map(_.status) should be(Set(MemberStatus.Up))) + awaitAssert(clusterView.members.map(_.status) should ===(Set(MemberStatus.Up))) enterBarrier("after-2") } @@ -63,10 +63,10 @@ abstract class NodeMembershipSpec val firstMember = clusterView.members.find(_.address == address(first)).get val secondMember = clusterView.members.find(_.address == address(second)).get val thirdMember = clusterView.members.find(_.address == address(third)).get - firstMember.isOlderThan(thirdMember) should be(true) - thirdMember.isOlderThan(firstMember) should be(false) - secondMember.isOlderThan(thirdMember) should be(true) - thirdMember.isOlderThan(secondMember) should be(false) + firstMember.isOlderThan(thirdMember) should ===(true) + thirdMember.isOlderThan(firstMember) should ===(false) + secondMember.isOlderThan(thirdMember) should ===(true) + thirdMember.isOlderThan(secondMember) should ===(false) enterBarrier("after-3") diff --git a/akka-cluster/src/multi-jvm/scala/akka/cluster/NodeUpSpec.scala b/akka-cluster/src/multi-jvm/scala/akka/cluster/NodeUpSpec.scala index c0564ac79b..2a534b8b2e 100644 --- a/akka-cluster/src/multi-jvm/scala/akka/cluster/NodeUpSpec.scala +++ b/akka-cluster/src/multi-jvm/scala/akka/cluster/NodeUpSpec.scala @@ -40,7 +40,7 @@ abstract class NodeUpSpec enterBarrier("first-join-attempt") Thread.sleep(2000) - clusterView.members should be(Set.empty) + clusterView.members should ===(Set.empty) enterBarrier("after-0") } @@ -70,8 +70,8 @@ abstract class NodeUpSpec // let it run for a while to make sure that nothing bad happens for (n ← 1 to 20) { Thread.sleep(100.millis.dilated.toMillis) - unexpected.get should be(SortedSet.empty) - clusterView.members.forall(_.status == MemberStatus.Up) should be(true) + unexpected.get should ===(SortedSet.empty) + clusterView.members.forall(_.status == MemberStatus.Up) should ===(true) } enterBarrier("after-2") diff --git a/akka-cluster/src/multi-jvm/scala/akka/cluster/RestartFirstSeedNodeSpec.scala b/akka-cluster/src/multi-jvm/scala/akka/cluster/RestartFirstSeedNodeSpec.scala index 004e25b95d..0298e7b320 100644 --- a/akka-cluster/src/multi-jvm/scala/akka/cluster/RestartFirstSeedNodeSpec.scala +++ b/akka-cluster/src/multi-jvm/scala/akka/cluster/RestartFirstSeedNodeSpec.scala @@ -90,8 +90,8 @@ abstract class RestartFirstSeedNodeSpec // now we can join seed1System, seed2, seed3 together runOn(seed1) { Cluster(seed1System).joinSeedNodes(seedNodes) - awaitAssert(Cluster(seed1System).readView.members.size should be(3)) - awaitAssert(Cluster(seed1System).readView.members.map(_.status) should be(Set(Up))) + awaitAssert(Cluster(seed1System).readView.members.size should ===(3)) + awaitAssert(Cluster(seed1System).readView.members.map(_.status) should ===(Set(Up))) } runOn(seed2, seed3) { cluster.joinSeedNodes(seedNodes) @@ -109,8 +109,8 @@ abstract class RestartFirstSeedNodeSpec runOn(seed1) { Cluster(restartedSeed1System).joinSeedNodes(seedNodes) within(20.seconds) { - awaitAssert(Cluster(restartedSeed1System).readView.members.size should be(3)) - awaitAssert(Cluster(restartedSeed1System).readView.members.map(_.status) should be(Set(Up))) + awaitAssert(Cluster(restartedSeed1System).readView.members.size should ===(3)) + awaitAssert(Cluster(restartedSeed1System).readView.members.map(_.status) should ===(Set(Up))) } } runOn(seed2, seed3) { diff --git a/akka-cluster/src/multi-jvm/scala/akka/cluster/RestartNodeSpec.scala b/akka-cluster/src/multi-jvm/scala/akka/cluster/RestartNodeSpec.scala index 2dbbaf1e93..8961ea8de6 100644 --- a/akka-cluster/src/multi-jvm/scala/akka/cluster/RestartNodeSpec.scala +++ b/akka-cluster/src/multi-jvm/scala/akka/cluster/RestartNodeSpec.scala @@ -92,8 +92,8 @@ abstract class RestartNodeSpec } runOn(second) { Cluster(secondSystem).joinSeedNodes(seedNodes) - awaitAssert(Cluster(secondSystem).readView.members.size should be(3)) - awaitAssert(Cluster(secondSystem).readView.members.map(_.status) should be(Set(Up))) + awaitAssert(Cluster(secondSystem).readView.members.size should ===(3)) + awaitAssert(Cluster(secondSystem).readView.members.map(_.status) should ===(Set(Up))) } enterBarrier("started") @@ -106,12 +106,12 @@ abstract class RestartNodeSpec // then immediately start restartedSecondSystem, which has the same address as secondSystem runOn(second) { Cluster(restartedSecondSystem).joinSeedNodes(seedNodes) - awaitAssert(Cluster(restartedSecondSystem).readView.members.size should be(3)) - awaitAssert(Cluster(restartedSecondSystem).readView.members.map(_.status) should be(Set(Up))) + awaitAssert(Cluster(restartedSecondSystem).readView.members.size should ===(3)) + awaitAssert(Cluster(restartedSecondSystem).readView.members.map(_.status) should ===(Set(Up))) } runOn(first, third) { awaitAssert { - Cluster(system).readView.members.size should be(3) + Cluster(system).readView.members.size should ===(3) Cluster(system).readView.members.exists { m ⇒ m.address == secondUniqueAddress.address && m.uniqueAddress.uid != secondUniqueAddress.uid } diff --git a/akka-cluster/src/multi-jvm/scala/akka/cluster/SingletonClusterSpec.scala b/akka-cluster/src/multi-jvm/scala/akka/cluster/SingletonClusterSpec.scala index c18edbe1db..161686b0f6 100644 --- a/akka-cluster/src/multi-jvm/scala/akka/cluster/SingletonClusterSpec.scala +++ b/akka-cluster/src/multi-jvm/scala/akka/cluster/SingletonClusterSpec.scala @@ -47,7 +47,7 @@ abstract class SingletonClusterSpec(multiNodeConfig: SingletonClusterMultiNodeCo runOn(first) { cluster.joinSeedNodes(Vector(first)) awaitMembersUp(1) - clusterView.isSingletonCluster should be(true) + clusterView.isSingletonCluster should ===(true) } enterBarrier("after-1") @@ -55,7 +55,7 @@ abstract class SingletonClusterSpec(multiNodeConfig: SingletonClusterMultiNodeCo "not be singleton cluster when joined with other node" taggedAs LongRunningTest in { awaitClusterUp(first, second) - clusterView.isSingletonCluster should be(false) + clusterView.isSingletonCluster should ===(false) assertLeader(first, second) enterBarrier("after-2") @@ -69,7 +69,7 @@ abstract class SingletonClusterSpec(multiNodeConfig: SingletonClusterMultiNodeCo markNodeAsUnavailable(secondAddress) awaitMembersUp(numberOfMembers = 1, canNotBePartOfMemberRing = Set(secondAddress), 30.seconds) - clusterView.isSingletonCluster should be(true) + clusterView.isSingletonCluster should ===(true) awaitCond(clusterView.isLeader) } diff --git a/akka-cluster/src/multi-jvm/scala/akka/cluster/StressSpec.scala b/akka-cluster/src/multi-jvm/scala/akka/cluster/StressSpec.scala index 28a7e04a46..396deb0d3d 100644 --- a/akka-cluster/src/multi-jvm/scala/akka/cluster/StressSpec.scala +++ b/akka-cluster/src/multi-jvm/scala/akka/cluster/StressSpec.scala @@ -986,7 +986,7 @@ abstract class StressSpec } val nextAddresses = clusterView.members.map(_.address) -- usedAddresses runOn(usedRoles: _*) { - nextAddresses.size should be(numberOfNodesJoinRemove) + nextAddresses.size should ===(numberOfNodesJoinRemove) } enterBarrier("join-remove-" + step) @@ -1023,7 +1023,7 @@ abstract class StressSpec def exerciseRouters(title: String, duration: FiniteDuration, batchInterval: FiniteDuration, expectDroppedMessages: Boolean, tree: Boolean): Unit = within(duration + 10.seconds) { - nbrUsedRoles should be(totalNumberOfNodes) + nbrUsedRoles should ===(totalNumberOfNodes) createResultAggregator(title, expectedResults = nbrUsedRoles, includeInHistory = false) val (masterRoles, otherRoles) = roles.take(nbrUsedRoles).splitAt(3) @@ -1040,7 +1040,7 @@ abstract class StressSpec workResult.sendCount should be > (0L) workResult.ackCount should be > (0L) if (!expectDroppedMessages) - workResult.retryCount should be(0) + workResult.retryCount should ===(0) enterBarrier("routers-done-" + step) } @@ -1079,13 +1079,13 @@ abstract class StressSpec supervisor ! Props[RemoteChild].withDeploy(Deploy(scope = RemoteScope(address(r)))) } supervisor ! GetChildrenCount - expectMsgType[ChildrenCount] should be(ChildrenCount(nbrUsedRoles, 0)) + expectMsgType[ChildrenCount] should ===(ChildrenCount(nbrUsedRoles, 0)) 1 to 5 foreach { _ ⇒ supervisor ! new RuntimeException("Simulated exception") } awaitAssert { supervisor ! GetChildrenCount val c = expectMsgType[ChildrenCount] - c should be(ChildrenCount(nbrUsedRoles, 5 * nbrUsedRoles)) + c should ===(ChildrenCount(nbrUsedRoles, 5 * nbrUsedRoles)) } // after 5 restart attempts the children should be stopped @@ -1094,7 +1094,7 @@ abstract class StressSpec supervisor ! GetChildrenCount val c = expectMsgType[ChildrenCount] // zero children - c should be(ChildrenCount(0, 6 * nbrUsedRoles)) + c should ===(ChildrenCount(0, 6 * nbrUsedRoles)) } supervisor ! Reset @@ -1116,9 +1116,9 @@ abstract class StressSpec def idleGossip(title: String): Unit = { createResultAggregator(title, expectedResults = nbrUsedRoles, includeInHistory = true) reportResult { - clusterView.members.size should be(nbrUsedRoles) + clusterView.members.size should ===(nbrUsedRoles) Thread.sleep(idleGossipDuration.toMillis) - clusterView.members.size should be(nbrUsedRoles) + clusterView.members.size should ===(nbrUsedRoles) } awaitClusterResult() } @@ -1193,7 +1193,7 @@ abstract class StressSpec case Some(m) ⇒ m.tell(End, testActor) val workResult = awaitWorkResult(m) - workResult.retryCount should be(0) + workResult.retryCount should ===(0) workResult.sendCount should be > (0L) workResult.ackCount should be > (0L) case None ⇒ fail("master not running") diff --git a/akka-cluster/src/multi-jvm/scala/akka/cluster/SunnyWeatherSpec.scala b/akka-cluster/src/multi-jvm/scala/akka/cluster/SunnyWeatherSpec.scala index 3456375251..2773b2983f 100644 --- a/akka-cluster/src/multi-jvm/scala/akka/cluster/SunnyWeatherSpec.scala +++ b/akka-cluster/src/multi-jvm/scala/akka/cluster/SunnyWeatherSpec.scala @@ -70,7 +70,7 @@ abstract class SunnyWeatherSpec for (n ← 1 to 30) { enterBarrier("period-" + n) - unexpected.get should be(SortedSet.empty) + unexpected.get should ===(SortedSet.empty) awaitMembersUp(roles.size) assertLeaderIn(roles) if (n % 5 == 0) log.debug("Passed period [{}]", n) diff --git a/akka-cluster/src/multi-jvm/scala/akka/cluster/SurviveNetworkInstabilitySpec.scala b/akka-cluster/src/multi-jvm/scala/akka/cluster/SurviveNetworkInstabilitySpec.scala index 2bd7297766..65e2ad84c7 100644 --- a/akka-cluster/src/multi-jvm/scala/akka/cluster/SurviveNetworkInstabilitySpec.scala +++ b/akka-cluster/src/multi-jvm/scala/akka/cluster/SurviveNetworkInstabilitySpec.scala @@ -87,7 +87,7 @@ abstract class SurviveNetworkInstabilitySpec def assertUnreachable(subjects: RoleName*): Unit = { val expected = subjects.toSet map address - awaitAssert(clusterView.unreachableMembers.map(_.address) should be(expected)) + awaitAssert(clusterView.unreachableMembers.map(_.address) should ===(expected)) } system.actorOf(Props[Echo], "echo") @@ -281,7 +281,7 @@ abstract class SurviveNetworkInstabilitySpec // system messages and quarantine system.actorSelection("/user/watcher") ! "boom" within(10.seconds) { - expectMsgType[QuarantinedEvent].address should be(address(second)) + expectMsgType[QuarantinedEvent].address should ===(address(second)) } system.eventStream.unsubscribe(testActor, classOf[QuarantinedEvent]) } @@ -327,8 +327,8 @@ abstract class SurviveNetworkInstabilitySpec runOn(side1AfterJoin: _*) { // side2 removed val expected = (side1AfterJoin map address).toSet - awaitAssert(clusterView.members.map(_.address) should be(expected)) - awaitAssert(clusterView.members.collectFirst { case m if m.address == address(eighth) ⇒ m.status } should be( + awaitAssert(clusterView.members.map(_.address) should ===(expected)) + awaitAssert(clusterView.members.collectFirst { case m if m.address == address(eighth) ⇒ m.status } should ===( Some(MemberStatus.Up))) } @@ -346,12 +346,12 @@ abstract class SurviveNetworkInstabilitySpec runOn(side1AfterJoin: _*) { val expected = (side1AfterJoin map address).toSet - clusterView.members.map(_.address) should be(expected) + clusterView.members.map(_.address) should ===(expected) } runOn(side2: _*) { val expected = ((side2 ++ side1) map address).toSet - clusterView.members.map(_.address) should be(expected) + clusterView.members.map(_.address) should ===(expected) assertUnreachable(side1: _*) } diff --git a/akka-cluster/src/multi-jvm/scala/akka/cluster/TransitionSpec.scala b/akka-cluster/src/multi-jvm/scala/akka/cluster/TransitionSpec.scala index 8f0f72224f..9e64b6dacc 100644 --- a/akka-cluster/src/multi-jvm/scala/akka/cluster/TransitionSpec.scala +++ b/akka-cluster/src/multi-jvm/scala/akka/cluster/TransitionSpec.scala @@ -59,17 +59,17 @@ abstract class TransitionSpec def seenLatestGossip: Set[RoleName] = clusterView.seenBy flatMap roleName def awaitSeen(addresses: Address*): Unit = awaitAssert { - (seenLatestGossip map address) should be(addresses.toSet) + (seenLatestGossip map address) should ===(addresses.toSet) } def awaitMembers(addresses: Address*): Unit = awaitAssert { clusterView.refreshCurrentState() - memberAddresses should be(addresses.toSet) + memberAddresses should ===(addresses.toSet) } def awaitMemberStatus(address: Address, status: MemberStatus): Unit = awaitAssert { clusterView.refreshCurrentState() - memberStatus(address) should be(status) + memberStatus(address) should ===(status) } def leaderActions(): Unit = @@ -134,7 +134,7 @@ abstract class TransitionSpec awaitMembers(first, second) awaitMemberStatus(first, Up) awaitMemberStatus(second, Joining) - awaitAssert(seenLatestGossip should be(Set(first, second))) + awaitAssert(seenLatestGossip should ===(Set(first, second))) } enterBarrier("convergence-joining-2") @@ -149,7 +149,7 @@ abstract class TransitionSpec runOn(first, second) { // gossip chat will synchronize the views awaitMemberStatus(second, Up) - awaitAssert(seenLatestGossip should be(Set(first, second))) + awaitAssert(seenLatestGossip should ===(Set(first, second))) awaitMemberStatus(first, Up) } @@ -163,7 +163,7 @@ abstract class TransitionSpec } runOn(second, third) { // gossip chat from the join will synchronize the views - awaitAssert(seenLatestGossip should be(Set(second, third))) + awaitAssert(seenLatestGossip should ===(Set(second, third))) } enterBarrier("third-joined-second") @@ -173,7 +173,7 @@ abstract class TransitionSpec awaitMembers(first, second, third) awaitMemberStatus(third, Joining) awaitMemberStatus(second, Up) - awaitAssert(seenLatestGossip should be(Set(first, second, third))) + awaitAssert(seenLatestGossip should ===(Set(first, second, third))) } first gossipTo third @@ -182,7 +182,7 @@ abstract class TransitionSpec awaitMemberStatus(first, Up) awaitMemberStatus(second, Up) awaitMemberStatus(third, Joining) - awaitAssert(seenLatestGossip should be(Set(first, second, third))) + awaitAssert(seenLatestGossip should ===(Set(first, second, third))) } enterBarrier("convergence-joining-3") @@ -201,7 +201,7 @@ abstract class TransitionSpec leader12 gossipTo other1 runOn(other1) { awaitMemberStatus(third, Up) - awaitAssert(seenLatestGossip should be(Set(leader12, myself))) + awaitAssert(seenLatestGossip should ===(Set(leader12, myself))) } // first non-leader gossipTo the other non-leader @@ -212,7 +212,7 @@ abstract class TransitionSpec } runOn(other2) { awaitMemberStatus(third, Up) - awaitAssert(seenLatestGossip should be(Set(first, second, third))) + awaitAssert(seenLatestGossip should ===(Set(first, second, third))) } // first non-leader gossipTo the leader @@ -221,7 +221,7 @@ abstract class TransitionSpec awaitMemberStatus(first, Up) awaitMemberStatus(second, Up) awaitMemberStatus(third, Up) - awaitAssert(seenLatestGossip should be(Set(first, second, third))) + awaitAssert(seenLatestGossip should ===(Set(first, second, third))) } enterBarrier("after-3") @@ -232,7 +232,7 @@ abstract class TransitionSpec markNodeAsUnavailable(second) reapUnreachable() awaitAssert(clusterView.unreachableMembers.map(_.address) should contain(address(second))) - awaitAssert(seenLatestGossip should be(Set(third))) + awaitAssert(seenLatestGossip should ===(Set(third))) } enterBarrier("after-second-unavailble") @@ -254,7 +254,7 @@ abstract class TransitionSpec runOn(first, third) { awaitAssert(clusterView.unreachableMembers.map(_.address) should contain(address(second))) awaitMemberStatus(second, Down) - awaitAssert(seenLatestGossip should be(Set(first, third))) + awaitAssert(seenLatestGossip should ===(Set(first, third))) } enterBarrier("after-6") diff --git a/akka-cluster/src/multi-jvm/scala/akka/cluster/UnreachableNodeJoinsAgainSpec.scala b/akka-cluster/src/multi-jvm/scala/akka/cluster/UnreachableNodeJoinsAgainSpec.scala index 47c8ba73c1..a517db900d 100644 --- a/akka-cluster/src/multi-jvm/scala/akka/cluster/UnreachableNodeJoinsAgainSpec.scala +++ b/akka-cluster/src/multi-jvm/scala/akka/cluster/UnreachableNodeJoinsAgainSpec.scala @@ -91,9 +91,9 @@ abstract class UnreachableNodeJoinsAgainSpec // victim becomes all alone awaitAssert { val members = clusterView.members - clusterView.unreachableMembers.size should be(roles.size - 1) + clusterView.unreachableMembers.size should ===(roles.size - 1) } - clusterView.unreachableMembers.map(_.address) should be((allButVictim map address).toSet) + clusterView.unreachableMembers.map(_.address) should ===((allButVictim map address).toSet) } } @@ -103,13 +103,13 @@ abstract class UnreachableNodeJoinsAgainSpec // victim becomes unreachable awaitAssert { val members = clusterView.members - clusterView.unreachableMembers.size should be(1) + clusterView.unreachableMembers.size should ===(1) } awaitSeenSameState(allButVictim map address: _*) // still one unreachable - clusterView.unreachableMembers.size should be(1) - clusterView.unreachableMembers.head.address should be(node(victim).address) - clusterView.unreachableMembers.head.status should be(MemberStatus.Up) + clusterView.unreachableMembers.size should ===(1) + clusterView.unreachableMembers.head.address should ===(node(victim).address) + clusterView.unreachableMembers.head.status should ===(MemberStatus.Up) } } @@ -125,8 +125,8 @@ abstract class UnreachableNodeJoinsAgainSpec runOn(allButVictim: _*) { // eventually removed awaitMembersUp(roles.size - 1, Set(victim)) - awaitAssert(clusterView.unreachableMembers should be(Set.empty), 15 seconds) - awaitAssert(clusterView.members.map(_.address) should be((allButVictim map address).toSet)) + awaitAssert(clusterView.unreachableMembers should ===(Set.empty), 15 seconds) + awaitAssert(clusterView.members.map(_.address) should ===((allButVictim map address).toSet)) } @@ -173,8 +173,8 @@ abstract class UnreachableNodeJoinsAgainSpec Cluster(freshSystem).join(masterAddress) within(15 seconds) { awaitAssert(Cluster(freshSystem).readView.members.map(_.address) should contain(victimAddress)) - awaitAssert(Cluster(freshSystem).readView.members.size should be(expectedNumberOfMembers)) - awaitAssert(Cluster(freshSystem).readView.members.map(_.status) should be(Set(MemberStatus.Up))) + awaitAssert(Cluster(freshSystem).readView.members.size should ===(expectedNumberOfMembers)) + awaitAssert(Cluster(freshSystem).readView.members.map(_.status) should ===(Set(MemberStatus.Up))) } // signal to master node that victim is done diff --git a/akka-cluster/src/multi-jvm/scala/akka/cluster/routing/AdaptiveLoadBalancingRouterSpec.scala b/akka-cluster/src/multi-jvm/scala/akka/cluster/routing/AdaptiveLoadBalancingRouterSpec.scala index 3d1036c0ad..7940f6613a 100644 --- a/akka-cluster/src/multi-jvm/scala/akka/cluster/routing/AdaptiveLoadBalancingRouterSpec.scala +++ b/akka-cluster/src/multi-jvm/scala/akka/cluster/routing/AdaptiveLoadBalancingRouterSpec.scala @@ -121,9 +121,9 @@ abstract class AdaptiveLoadBalancingRouterSpec extends MultiNodeSpec(AdaptiveLoa props(Props[Echo]), name) // it may take some time until router receives cluster member events - awaitAssert { currentRoutees(router).size should be(roles.size) } + awaitAssert { currentRoutees(router).size should ===(roles.size) } val routees = currentRoutees(router) - routees.map { case ActorRefRoutee(ref) ⇒ fullAddress(ref) }.toSet should be(roles.map(address).toSet) + routees.map { case ActorRefRoutee(ref) ⇒ fullAddress(ref) }.toSet should ===(roles.map(address).toSet) router } @@ -152,7 +152,7 @@ abstract class AdaptiveLoadBalancingRouterSpec extends MultiNodeSpec(AdaptiveLoa replies(first) should be > (0) replies(second) should be > (0) replies(third) should be > (0) - replies.values.sum should be(iterationCount) + replies.values.sum should ===(iterationCount) } @@ -185,7 +185,7 @@ abstract class AdaptiveLoadBalancingRouterSpec extends MultiNodeSpec(AdaptiveLoa val replies = receiveReplies(iterationCount) replies(third) should be > (replies(second)) - replies.values.sum should be(iterationCount) + replies.values.sum should ===(iterationCount) } @@ -196,9 +196,9 @@ abstract class AdaptiveLoadBalancingRouterSpec extends MultiNodeSpec(AdaptiveLoa runOn(first) { val router3 = system.actorOf(FromConfig.props(Props[Memory]), "router3") // it may take some time until router receives cluster member events - awaitAssert { currentRoutees(router3).size should be(9) } + awaitAssert { currentRoutees(router3).size should ===(9) } val routees = currentRoutees(router3) - routees.map { case ActorRefRoutee(ref) ⇒ fullAddress(ref) }.toSet should be(Set(address(first))) + routees.map { case ActorRefRoutee(ref) ⇒ fullAddress(ref) }.toSet should ===(Set(address(first))) } enterBarrier("after-4") } @@ -207,9 +207,9 @@ abstract class AdaptiveLoadBalancingRouterSpec extends MultiNodeSpec(AdaptiveLoa runOn(first) { val router4 = system.actorOf(FromConfig.props(Props[Memory]), "router4") // it may take some time until router receives cluster member events - awaitAssert { currentRoutees(router4).size should be(6) } + awaitAssert { currentRoutees(router4).size should ===(6) } val routees = currentRoutees(router4) - routees.map { case ActorRefRoutee(ref) ⇒ fullAddress(ref) }.toSet should be(Set( + routees.map { case ActorRefRoutee(ref) ⇒ fullAddress(ref) }.toSet should ===(Set( address(first), address(second), address(third))) } enterBarrier("after-5") diff --git a/akka-cluster/src/multi-jvm/scala/akka/cluster/routing/ClusterConsistentHashingGroupSpec.scala b/akka-cluster/src/multi-jvm/scala/akka/cluster/routing/ClusterConsistentHashingGroupSpec.scala index 53e426de91..217c632f9a 100644 --- a/akka-cluster/src/multi-jvm/scala/akka/cluster/routing/ClusterConsistentHashingGroupSpec.scala +++ b/akka-cluster/src/multi-jvm/scala/akka/cluster/routing/ClusterConsistentHashingGroupSpec.scala @@ -77,7 +77,7 @@ abstract class ClusterConsistentHashingGroupSpec extends MultiNodeSpec(ClusterCo settings = ClusterRouterGroupSettings(totalInstances = 10, paths, allowLocalRoutees = true, useRole = None)).props(), "router") // it may take some time until router receives cluster member events - awaitAssert { currentRoutees(router).size should be(3) } + awaitAssert { currentRoutees(router).size should ===(3) } val keys = List("A", "B", "C", "D", "E", "F", "G") for (_ ← 1 to 10; k ← keys) { router ! k } enterBarrier("messages-sent") @@ -86,11 +86,11 @@ abstract class ClusterConsistentHashingGroupSpec extends MultiNodeSpec(ClusterCo val b = expectMsgType[Collected].messages val c = expectMsgType[Collected].messages - a.intersect(b) should be(Set.empty) - a.intersect(c) should be(Set.empty) - b.intersect(c) should be(Set.empty) + a.intersect(b) should ===(Set.empty) + a.intersect(c) should ===(Set.empty) + b.intersect(c) should ===(Set.empty) - (a.size + b.size + c.size) should be(keys.size) + (a.size + b.size + c.size) should ===(keys.size) enterBarrier("after-2") } diff --git a/akka-cluster/src/multi-jvm/scala/akka/cluster/routing/ClusterConsistentHashingRouterSpec.scala b/akka-cluster/src/multi-jvm/scala/akka/cluster/routing/ClusterConsistentHashingRouterSpec.scala index 0e0a15828f..a3c6a1c4b8 100644 --- a/akka-cluster/src/multi-jvm/scala/akka/cluster/routing/ClusterConsistentHashingRouterSpec.scala +++ b/akka-cluster/src/multi-jvm/scala/akka/cluster/routing/ClusterConsistentHashingRouterSpec.scala @@ -88,9 +88,9 @@ abstract class ClusterConsistentHashingRouterSpec extends MultiNodeSpec(ClusterC "create routees from configuration" in { runOn(first) { // it may take some time until router receives cluster member events - awaitAssert { currentRoutees(router1).size should be(4) } + awaitAssert { currentRoutees(router1).size should ===(4) } val routees = currentRoutees(router1) - routees.map { case ActorRefRoutee(ref) ⇒ fullAddress(ref) }.toSet should be(Set(address(first), address(second))) + routees.map { case ActorRefRoutee(ref) ⇒ fullAddress(ref) }.toSet should ===(Set(address(first), address(second))) } enterBarrier("after-2") } @@ -111,9 +111,9 @@ abstract class ClusterConsistentHashingRouterSpec extends MultiNodeSpec(ClusterC runOn(first) { // it may take some time until router receives cluster member events - awaitAssert { currentRoutees(router1).size should be(6) } + awaitAssert { currentRoutees(router1).size should ===(6) } val routees = currentRoutees(router1) - routees.map { case ActorRefRoutee(ref) ⇒ fullAddress(ref) }.toSet should be(roles.map(address).toSet) + routees.map { case ActorRefRoutee(ref) ⇒ fullAddress(ref) }.toSet should ===(roles.map(address).toSet) } enterBarrier("after-3") @@ -126,9 +126,9 @@ abstract class ClusterConsistentHashingRouterSpec extends MultiNodeSpec(ClusterC props(Props[Echo]), "router2") // it may take some time until router receives cluster member events - awaitAssert { currentRoutees(router2).size should be(6) } + awaitAssert { currentRoutees(router2).size should ===(6) } val routees = currentRoutees(router2) - routees.map { case ActorRefRoutee(ref) ⇒ fullAddress(ref) }.toSet should be(roles.map(address).toSet) + routees.map { case ActorRefRoutee(ref) ⇒ fullAddress(ref) }.toSet should ===(roles.map(address).toSet) } enterBarrier("after-4") @@ -168,9 +168,9 @@ abstract class ClusterConsistentHashingRouterSpec extends MultiNodeSpec(ClusterC def assertHashMapping(router: ActorRef): Unit = { // it may take some time until router receives cluster member events - awaitAssert { currentRoutees(router).size should be(6) } + awaitAssert { currentRoutees(router).size should ===(6) } val routees = currentRoutees(router) - routees.map { case ActorRefRoutee(ref) ⇒ fullAddress(ref) }.toSet should be(roles.map(address).toSet) + routees.map { case ActorRefRoutee(ref) ⇒ fullAddress(ref) }.toSet should ===(roles.map(address).toSet) router ! "a" val destinationA = expectMsgType[ActorRef] diff --git a/akka-cluster/src/multi-jvm/scala/akka/cluster/routing/ClusterRoundRobinSpec.scala b/akka-cluster/src/multi-jvm/scala/akka/cluster/routing/ClusterRoundRobinSpec.scala index 4a0c7da642..ec33447658 100644 --- a/akka-cluster/src/multi-jvm/scala/akka/cluster/routing/ClusterRoundRobinSpec.scala +++ b/akka-cluster/src/multi-jvm/scala/akka/cluster/routing/ClusterRoundRobinSpec.scala @@ -140,10 +140,10 @@ abstract class ClusterRoundRobinSpec extends MultiNodeSpec(ClusterRoundRobinMult "deploy routees to the member nodes in the cluster" taggedAs LongRunningTest in { runOn(first) { - router1.isInstanceOf[RoutedActorRef] should be(true) + router1.isInstanceOf[RoutedActorRef] should ===(true) // max-nr-of-instances-per-node=2 times 2 nodes - awaitAssert(currentRoutees(router1).size should be(4)) + awaitAssert(currentRoutees(router1).size should ===(4)) val iterationCount = 10 for (i ← 0 until iterationCount) { @@ -154,9 +154,9 @@ abstract class ClusterRoundRobinSpec extends MultiNodeSpec(ClusterRoundRobinMult replies(first) should be > (0) replies(second) should be > (0) - replies(third) should be(0) - replies(fourth) should be(0) - replies.values.sum should be(iterationCount) + replies(third) should ===(0) + replies(fourth) should ===(0) + replies.values.sum should ===(iterationCount) } enterBarrier("after-2") @@ -173,7 +173,7 @@ abstract class ClusterRoundRobinSpec extends MultiNodeSpec(ClusterRoundRobinMult runOn(first) { // 2 nodes, 2 routees on each node within(10.seconds) { - awaitAssert(currentRoutees(router4).size should be(4)) + awaitAssert(currentRoutees(router4).size should ===(4)) } val iterationCount = 10 @@ -185,9 +185,9 @@ abstract class ClusterRoundRobinSpec extends MultiNodeSpec(ClusterRoundRobinMult replies(first) should be > (0) replies(second) should be > (0) - replies(third) should be(0) - replies(fourth) should be(0) - replies.values.sum should be(iterationCount) + replies(third) should ===(0) + replies(fourth) should ===(0) + replies.values.sum should ===(iterationCount) } enterBarrier("after-3") @@ -200,7 +200,7 @@ abstract class ClusterRoundRobinSpec extends MultiNodeSpec(ClusterRoundRobinMult runOn(first) { // max-nr-of-instances-per-node=2 times 4 nodes - awaitAssert(currentRoutees(router1).size should be(8)) + awaitAssert(currentRoutees(router1).size should ===(8)) val iterationCount = 10 for (i ← 0 until iterationCount) { @@ -210,7 +210,7 @@ abstract class ClusterRoundRobinSpec extends MultiNodeSpec(ClusterRoundRobinMult val replies = receiveReplies(PoolRoutee, iterationCount) replies.values.foreach { _ should be > (0) } - replies.values.sum should be(iterationCount) + replies.values.sum should ===(iterationCount) } enterBarrier("after-4") @@ -222,7 +222,7 @@ abstract class ClusterRoundRobinSpec extends MultiNodeSpec(ClusterRoundRobinMult runOn(first) { // 4 nodes, 2 routee on each node - awaitAssert(currentRoutees(router4).size should be(8)) + awaitAssert(currentRoutees(router4).size should ===(8)) val iterationCount = 10 for (i ← 0 until iterationCount) { @@ -232,7 +232,7 @@ abstract class ClusterRoundRobinSpec extends MultiNodeSpec(ClusterRoundRobinMult val replies = receiveReplies(GroupRoutee, iterationCount) replies.values.foreach { _ should be > (0) } - replies.values.sum should be(iterationCount) + replies.values.sum should ===(iterationCount) } enterBarrier("after-5") @@ -242,7 +242,7 @@ abstract class ClusterRoundRobinSpec extends MultiNodeSpec(ClusterRoundRobinMult runOn(first) { // max-nr-of-instances-per-node=1 times 3 nodes - awaitAssert(currentRoutees(router3).size should be(3)) + awaitAssert(currentRoutees(router3).size should ===(3)) val iterationCount = 10 for (i ← 0 until iterationCount) { @@ -251,11 +251,11 @@ abstract class ClusterRoundRobinSpec extends MultiNodeSpec(ClusterRoundRobinMult val replies = receiveReplies(PoolRoutee, iterationCount) - replies(first) should be(0) + replies(first) should ===(0) replies(second) should be > (0) replies(third) should be > (0) replies(fourth) should be > (0) - replies.values.sum should be(iterationCount) + replies.values.sum should ===(iterationCount) } enterBarrier("after-6") @@ -264,7 +264,7 @@ abstract class ClusterRoundRobinSpec extends MultiNodeSpec(ClusterRoundRobinMult "deploy routees to specified node role" taggedAs LongRunningTest in { runOn(first) { - awaitAssert(currentRoutees(router5).size should be(2)) + awaitAssert(currentRoutees(router5).size should ===(2)) val iterationCount = 10 for (i ← 0 until iterationCount) { @@ -275,9 +275,9 @@ abstract class ClusterRoundRobinSpec extends MultiNodeSpec(ClusterRoundRobinMult replies(first) should be > (0) replies(second) should be > (0) - replies(third) should be(0) - replies(fourth) should be(0) - replies.values.sum should be(iterationCount) + replies(third) should ===(0) + replies(fourth) should ===(0) + replies.values.sum should ===(iterationCount) } enterBarrier("after-7") @@ -286,10 +286,10 @@ abstract class ClusterRoundRobinSpec extends MultiNodeSpec(ClusterRoundRobinMult "deploy programatically defined routees to the member nodes in the cluster" taggedAs LongRunningTest in { runOn(first) { - router2.isInstanceOf[RoutedActorRef] should be(true) + router2.isInstanceOf[RoutedActorRef] should ===(true) // totalInstances = 3, maxInstancesPerNode = 1 - awaitAssert(currentRoutees(router2).size should be(3)) + awaitAssert(currentRoutees(router2).size should ===(3)) val iterationCount = 10 for (i ← 0 until iterationCount) { @@ -302,8 +302,8 @@ abstract class ClusterRoundRobinSpec extends MultiNodeSpec(ClusterRoundRobinMult val routees = currentRoutees(router2) val routeeAddresses = routees map { case ActorRefRoutee(ref) ⇒ fullAddress(ref) } - routeeAddresses.size should be(3) - replies.values.sum should be(iterationCount) + routeeAddresses.size should ===(3) + replies.values.sum should ===(iterationCount) } enterBarrier("after-8") @@ -318,15 +318,15 @@ abstract class ClusterRoundRobinSpec extends MultiNodeSpec(ClusterRoundRobinMult runOn(first) { // 4 nodes, 2 routees on each node - awaitAssert(currentRoutees(router4).size should be(8)) + awaitAssert(currentRoutees(router4).size should ===(8)) testConductor.blackhole(first, second, Direction.Both).await - awaitAssert(routees.size should be(6)) + awaitAssert(routees.size should ===(6)) routeeAddresses should not contain (address(second)) testConductor.passThrough(first, second, Direction.Both).await - awaitAssert(routees.size should be(8)) + awaitAssert(routees.size should ===(8)) routeeAddresses should contain(address(second)) } @@ -349,7 +349,7 @@ abstract class ClusterRoundRobinSpec extends MultiNodeSpec(ClusterRoundRobinMult }.get cluster.down(downAddress) - expectMsgType[Terminated](15.seconds).actor should be(downRouteeRef) + expectMsgType[Terminated](15.seconds).actor should ===(downRouteeRef) awaitAssert { routeeAddresses should contain(notUsedAddress) routeeAddresses should not contain (downAddress) @@ -362,8 +362,8 @@ abstract class ClusterRoundRobinSpec extends MultiNodeSpec(ClusterRoundRobinMult val replies = receiveReplies(PoolRoutee, iterationCount) - routeeAddresses.size should be(3) - replies.values.sum should be(iterationCount) + routeeAddresses.size should ===(3) + replies.values.sum should ===(iterationCount) } enterBarrier("after-10") diff --git a/akka-cluster/src/multi-jvm/scala/akka/cluster/routing/UseRoleIgnoredSpec.scala b/akka-cluster/src/multi-jvm/scala/akka/cluster/routing/UseRoleIgnoredSpec.scala index 77797a665f..15a2fc7b6a 100644 --- a/akka-cluster/src/multi-jvm/scala/akka/cluster/routing/UseRoleIgnoredSpec.scala +++ b/akka-cluster/src/multi-jvm/scala/akka/cluster/routing/UseRoleIgnoredSpec.scala @@ -101,7 +101,7 @@ abstract class UseRoleIgnoredSpec extends MultiNodeSpec(UseRoleIgnoredMultiJvmSp props(Props[SomeActor]), "router-2") - awaitAssert(currentRoutees(router).size should be(4)) + awaitAssert(currentRoutees(router).size should ===(4)) val iterationCount = 10 for (i ← 0 until iterationCount) { @@ -110,10 +110,10 @@ abstract class UseRoleIgnoredSpec extends MultiNodeSpec(UseRoleIgnoredMultiJvmSp val replies = receiveReplies(PoolRoutee, iterationCount) - replies(first) should be(0) // should not be deployed locally, does not have required role + replies(first) should ===(0) // should not be deployed locally, does not have required role replies(second) should be > 0 replies(third) should be > 0 - replies.values.sum should be(iterationCount) + replies.values.sum should ===(iterationCount) } enterBarrier("after-2") @@ -130,7 +130,7 @@ abstract class UseRoleIgnoredSpec extends MultiNodeSpec(UseRoleIgnoredMultiJvmSp props(Props[SomeActor]), "router-3") - awaitAssert(currentRoutees(router).size should be(4)) + awaitAssert(currentRoutees(router).size should ===(4)) val iterationCount = 10 for (i ← 0 until iterationCount) { @@ -139,10 +139,10 @@ abstract class UseRoleIgnoredSpec extends MultiNodeSpec(UseRoleIgnoredMultiJvmSp val replies = receiveReplies(PoolRoutee, iterationCount) - replies(first) should be(0) // should not be deployed locally, does not have required role + replies(first) should ===(0) // should not be deployed locally, does not have required role replies(second) should be > 0 replies(third) should be > 0 - replies.values.sum should be(iterationCount) + replies.values.sum should ===(iterationCount) } enterBarrier("after-3") @@ -159,7 +159,7 @@ abstract class UseRoleIgnoredSpec extends MultiNodeSpec(UseRoleIgnoredMultiJvmSp props(Props[SomeActor]), "router-4") - awaitAssert(currentRoutees(router).size should be(2)) + awaitAssert(currentRoutees(router).size should ===(2)) val iterationCount = 10 for (i ← 0 until iterationCount) { @@ -169,9 +169,9 @@ abstract class UseRoleIgnoredSpec extends MultiNodeSpec(UseRoleIgnoredMultiJvmSp val replies = receiveReplies(PoolRoutee, iterationCount) replies(first) should be > 0 - replies(second) should be(0) - replies(third) should be(0) - replies.values.sum should be(iterationCount) + replies(second) should ===(0) + replies(third) should ===(0) + replies.values.sum should ===(iterationCount) } enterBarrier("after-4") @@ -188,7 +188,7 @@ abstract class UseRoleIgnoredSpec extends MultiNodeSpec(UseRoleIgnoredMultiJvmSp props(Props[SomeActor]), "router-5") - awaitAssert(currentRoutees(router).size should be(6)) + awaitAssert(currentRoutees(router).size should ===(6)) val iterationCount = 10 for (i ← 0 until iterationCount) { @@ -200,7 +200,7 @@ abstract class UseRoleIgnoredSpec extends MultiNodeSpec(UseRoleIgnoredMultiJvmSp replies(first) should be > 0 replies(second) should be > 0 replies(third) should be > 0 - replies.values.sum should be(iterationCount) + replies.values.sum should ===(iterationCount) } enterBarrier("after-5") diff --git a/akka-cluster/src/test/scala/akka/cluster/ClusterConfigSpec.scala b/akka-cluster/src/test/scala/akka/cluster/ClusterConfigSpec.scala index 453654fb6f..5880631360 100644 --- a/akka-cluster/src/test/scala/akka/cluster/ClusterConfigSpec.scala +++ b/akka-cluster/src/test/scala/akka/cluster/ClusterConfigSpec.scala @@ -10,6 +10,7 @@ import akka.dispatch.Dispatchers import scala.concurrent.duration._ import akka.remote.PhiAccrualFailureDetector import akka.util.Helpers.ConfigOps +import akka.actor.Address @org.junit.runner.RunWith(classOf[org.scalatest.junit.JUnitRunner]) class ClusterConfigSpec extends AkkaSpec { @@ -19,40 +20,40 @@ class ClusterConfigSpec extends AkkaSpec { "be able to parse generic cluster config elements" in { val settings = new ClusterSettings(system.settings.config, system.name) import settings._ - LogInfo should be(true) - FailureDetectorConfig.getDouble("threshold") should be(8.0 +- 0.0001) - FailureDetectorConfig.getInt("max-sample-size") should be(1000) - FailureDetectorConfig.getMillisDuration("min-std-deviation") should be(100 millis) - FailureDetectorConfig.getMillisDuration("acceptable-heartbeat-pause") should be(3 seconds) - FailureDetectorImplementationClass should be(classOf[PhiAccrualFailureDetector].getName) - SeedNodes should be(Seq.empty[String]) - SeedNodeTimeout should be(5 seconds) - RetryUnsuccessfulJoinAfter should be(10 seconds) - PeriodicTasksInitialDelay should be(1 seconds) - GossipInterval should be(1 second) - GossipTimeToLive should be(2 seconds) - HeartbeatInterval should be(1 second) - MonitoredByNrOfMembers should be(5) - HeartbeatExpectedResponseAfter should be(5 seconds) - LeaderActionsInterval should be(1 second) - UnreachableNodesReaperInterval should be(1 second) - PublishStatsInterval should be(Duration.Undefined) - AutoDownUnreachableAfter should be(Duration.Undefined) - MinNrOfMembers should be(1) - MinNrOfMembersOfRole should be(Map.empty) - Roles should be(Set.empty) - JmxEnabled should be(true) - UseDispatcher should be(Dispatchers.DefaultDispatcherId) - GossipDifferentViewProbability should be(0.8 +- 0.0001) - ReduceGossipDifferentViewProbability should be(400) - SchedulerTickDuration should be(33 millis) - SchedulerTicksPerWheel should be(512) + LogInfo should ===(true) + FailureDetectorConfig.getDouble("threshold") should ===(8.0 +- 0.0001) + FailureDetectorConfig.getInt("max-sample-size") should ===(1000) + FailureDetectorConfig.getMillisDuration("min-std-deviation") should ===(100 millis) + FailureDetectorConfig.getMillisDuration("acceptable-heartbeat-pause") should ===(3 seconds) + FailureDetectorImplementationClass should ===(classOf[PhiAccrualFailureDetector].getName) + SeedNodes should ===(Vector.empty[Address]) + SeedNodeTimeout should ===(5 seconds) + RetryUnsuccessfulJoinAfter should ===(10 seconds) + PeriodicTasksInitialDelay should ===(1 seconds) + GossipInterval should ===(1 second) + GossipTimeToLive should ===(2 seconds) + HeartbeatInterval should ===(1 second) + MonitoredByNrOfMembers should ===(5) + HeartbeatExpectedResponseAfter should ===(5 seconds) + LeaderActionsInterval should ===(1 second) + UnreachableNodesReaperInterval should ===(1 second) + PublishStatsInterval should ===(Duration.Undefined) + AutoDownUnreachableAfter should ===(Duration.Undefined) + MinNrOfMembers should ===(1) + MinNrOfMembersOfRole should ===(Map.empty[String, Int]) + Roles should ===(Set.empty[String]) + JmxEnabled should ===(true) + UseDispatcher should ===(Dispatchers.DefaultDispatcherId) + GossipDifferentViewProbability should ===(0.8 +- 0.0001) + ReduceGossipDifferentViewProbability should ===(400) + SchedulerTickDuration should ===(33 millis) + SchedulerTicksPerWheel should ===(512) // TODO remove metrics - MetricsEnabled should be(true) - MetricsCollectorClass should be(classOf[SigarMetricsCollector].getName) - MetricsInterval should be(3 seconds) - MetricsGossipInterval should be(3 seconds) - MetricsMovingAverageHalfLife should be(12 seconds) + MetricsEnabled should ===(true) + MetricsCollectorClass should ===(classOf[SigarMetricsCollector].getName) + MetricsInterval should ===(3 seconds) + MetricsGossipInterval should ===(3 seconds) + MetricsMovingAverageHalfLife should ===(12 seconds) } } } diff --git a/akka-cluster/src/test/scala/akka/cluster/ClusterDeployerSpec.scala b/akka-cluster/src/test/scala/akka/cluster/ClusterDeployerSpec.scala index 8a11bd6fdb..1c152b4dde 100644 --- a/akka-cluster/src/test/scala/akka/cluster/ClusterDeployerSpec.scala +++ b/akka-cluster/src/test/scala/akka/cluster/ClusterDeployerSpec.scala @@ -52,7 +52,7 @@ class ClusterDeployerSpec extends AkkaSpec(ClusterDeployerSpec.deployerConf) { val deployment = system.asInstanceOf[ActorSystemImpl].provider.deployer.lookup(service.split("/").drop(1)) deployment should not be (None) - deployment should be(Some( + deployment should ===(Some( Deploy( service, deployment.get.config, @@ -68,7 +68,7 @@ class ClusterDeployerSpec extends AkkaSpec(ClusterDeployerSpec.deployerConf) { val deployment = system.asInstanceOf[ActorSystemImpl].provider.deployer.lookup(service.split("/").drop(1)) deployment should not be (None) - deployment should be(Some( + deployment should ===(Some( Deploy( service, deployment.get.config, @@ -81,8 +81,8 @@ class ClusterDeployerSpec extends AkkaSpec(ClusterDeployerSpec.deployerConf) { "have correct router mappings" in { val mapping = system.asInstanceOf[ActorSystemImpl].provider.deployer.routerTypeMapping - mapping("adaptive-pool") should be(classOf[akka.cluster.routing.AdaptiveLoadBalancingPool].getName) - mapping("adaptive-group") should be(classOf[akka.cluster.routing.AdaptiveLoadBalancingGroup].getName) + mapping("adaptive-pool") should ===(classOf[akka.cluster.routing.AdaptiveLoadBalancingPool].getName) + mapping("adaptive-group") should ===(classOf[akka.cluster.routing.AdaptiveLoadBalancingGroup].getName) } } diff --git a/akka-cluster/src/test/scala/akka/cluster/ClusterDomainEventSpec.scala b/akka-cluster/src/test/scala/akka/cluster/ClusterDomainEventSpec.scala index 204c4baecc..062bfd5b31 100644 --- a/akka-cluster/src/test/scala/akka/cluster/ClusterDomainEventSpec.scala +++ b/akka-cluster/src/test/scala/akka/cluster/ClusterDomainEventSpec.scala @@ -44,25 +44,25 @@ class ClusterDomainEventSpec extends WordSpec with Matchers { "be empty for the same gossip" in { val g1 = Gossip(members = SortedSet(aUp)) - diffUnreachable(g1, g1, selfDummyAddress) should be(Seq.empty) + diffUnreachable(g1, g1, selfDummyAddress) should ===(Seq.empty) } "be produced for new members" in { val (g1, _) = converge(Gossip(members = SortedSet(aUp))) val (g2, s2) = converge(Gossip(members = SortedSet(aUp, bUp, eJoining))) - diffMemberEvents(g1, g2) should be(Seq(MemberUp(bUp))) - diffUnreachable(g1, g2, selfDummyAddress) should be(Seq.empty) - diffSeen(g1, g2, selfDummyAddress) should be(Seq(SeenChanged(convergence = true, seenBy = s2.map(_.address)))) + diffMemberEvents(g1, g2) should ===(Seq(MemberUp(bUp))) + diffUnreachable(g1, g2, selfDummyAddress) should ===(Seq.empty) + diffSeen(g1, g2, selfDummyAddress) should ===(Seq(SeenChanged(convergence = true, seenBy = s2.map(_.address)))) } "be produced for changed status of members" in { val (g1, _) = converge(Gossip(members = SortedSet(aJoining, bUp, cUp))) val (g2, s2) = converge(Gossip(members = SortedSet(aUp, bUp, cLeaving, eJoining))) - diffMemberEvents(g1, g2) should be(Seq(MemberUp(aUp))) - diffUnreachable(g1, g2, selfDummyAddress) should be(Seq.empty) - diffSeen(g1, g2, selfDummyAddress) should be(Seq(SeenChanged(convergence = true, seenBy = s2.map(_.address)))) + diffMemberEvents(g1, g2) should ===(Seq(MemberUp(aUp))) + diffUnreachable(g1, g2, selfDummyAddress) should ===(Seq.empty) + diffSeen(g1, g2, selfDummyAddress) should ===(Seq(SeenChanged(convergence = true, seenBy = s2.map(_.address)))) } "be produced for members in unreachable" in { @@ -74,10 +74,10 @@ class ClusterDomainEventSpec extends WordSpec with Matchers { unreachable(aUp.uniqueAddress, bDown.uniqueAddress) val g2 = Gossip(members = SortedSet(aUp, cUp, bDown, eDown), overview = GossipOverview(reachability = reachability2)) - diffUnreachable(g1, g2, selfDummyAddress) should be(Seq(UnreachableMember(bDown))) + diffUnreachable(g1, g2, selfDummyAddress) should ===(Seq(UnreachableMember(bDown))) // never include self member in unreachable - diffUnreachable(g1, g2, bDown.uniqueAddress) should be(Seq()) - diffSeen(g1, g2, selfDummyAddress) should be(Seq.empty) + diffUnreachable(g1, g2, bDown.uniqueAddress) should ===(Seq()) + diffSeen(g1, g2, selfDummyAddress) should ===(Seq.empty) } "be produced for members becoming reachable after unreachable" in { @@ -91,57 +91,57 @@ class ClusterDomainEventSpec extends WordSpec with Matchers { reachable(aUp.uniqueAddress, bUp.uniqueAddress) val g2 = Gossip(members = SortedSet(aUp, cUp, bUp, eUp), overview = GossipOverview(reachability = reachability2)) - diffUnreachable(g1, g2, selfDummyAddress) should be(Seq(UnreachableMember(cUp))) + diffUnreachable(g1, g2, selfDummyAddress) should ===(Seq(UnreachableMember(cUp))) // never include self member in unreachable - diffUnreachable(g1, g2, cUp.uniqueAddress) should be(Seq()) - diffReachable(g1, g2, selfDummyAddress) should be(Seq(ReachableMember(bUp))) + diffUnreachable(g1, g2, cUp.uniqueAddress) should ===(Seq()) + diffReachable(g1, g2, selfDummyAddress) should ===(Seq(ReachableMember(bUp))) // never include self member in reachable - diffReachable(g1, g2, bUp.uniqueAddress) should be(Seq()) + diffReachable(g1, g2, bUp.uniqueAddress) should ===(Seq()) } "be produced for removed members" in { val (g1, _) = converge(Gossip(members = SortedSet(aUp, dExiting))) val (g2, s2) = converge(Gossip(members = SortedSet(aUp))) - diffMemberEvents(g1, g2) should be(Seq(MemberRemoved(dRemoved, Exiting))) - diffUnreachable(g1, g2, selfDummyAddress) should be(Seq.empty) - diffSeen(g1, g2, selfDummyAddress) should be(Seq(SeenChanged(convergence = true, seenBy = s2.map(_.address)))) + diffMemberEvents(g1, g2) should ===(Seq(MemberRemoved(dRemoved, Exiting))) + diffUnreachable(g1, g2, selfDummyAddress) should ===(Seq.empty) + diffSeen(g1, g2, selfDummyAddress) should ===(Seq(SeenChanged(convergence = true, seenBy = s2.map(_.address)))) } "be produced for convergence changes" in { val g1 = Gossip(members = SortedSet(aUp, bUp, eJoining)).seen(aUp.uniqueAddress).seen(bUp.uniqueAddress).seen(eJoining.uniqueAddress) val g2 = Gossip(members = SortedSet(aUp, bUp, eJoining)).seen(aUp.uniqueAddress).seen(bUp.uniqueAddress) - diffMemberEvents(g1, g2) should be(Seq.empty) - diffUnreachable(g1, g2, selfDummyAddress) should be(Seq.empty) - diffSeen(g1, g2, selfDummyAddress) should be(Seq(SeenChanged(convergence = true, seenBy = Set(aUp.address, bUp.address)))) - diffMemberEvents(g2, g1) should be(Seq.empty) - diffUnreachable(g2, g1, selfDummyAddress) should be(Seq.empty) - diffSeen(g2, g1, selfDummyAddress) should be(Seq(SeenChanged(convergence = true, seenBy = Set(aUp.address, bUp.address, eJoining.address)))) + diffMemberEvents(g1, g2) should ===(Seq.empty) + diffUnreachable(g1, g2, selfDummyAddress) should ===(Seq.empty) + diffSeen(g1, g2, selfDummyAddress) should ===(Seq(SeenChanged(convergence = true, seenBy = Set(aUp.address, bUp.address)))) + diffMemberEvents(g2, g1) should ===(Seq.empty) + diffUnreachable(g2, g1, selfDummyAddress) should ===(Seq.empty) + diffSeen(g2, g1, selfDummyAddress) should ===(Seq(SeenChanged(convergence = true, seenBy = Set(aUp.address, bUp.address, eJoining.address)))) } "be produced for leader changes" in { val (g1, _) = converge(Gossip(members = SortedSet(aUp, bUp, eJoining))) val (g2, s2) = converge(Gossip(members = SortedSet(bUp, eJoining))) - diffMemberEvents(g1, g2) should be(Seq(MemberRemoved(aRemoved, Up))) - diffUnreachable(g1, g2, selfDummyAddress) should be(Seq.empty) - diffSeen(g1, g2, selfDummyAddress) should be(Seq(SeenChanged(convergence = true, seenBy = s2.map(_.address)))) - diffLeader(g1, g2) should be(Seq(LeaderChanged(Some(bUp.address)))) + diffMemberEvents(g1, g2) should ===(Seq(MemberRemoved(aRemoved, Up))) + diffUnreachable(g1, g2, selfDummyAddress) should ===(Seq.empty) + diffSeen(g1, g2, selfDummyAddress) should ===(Seq(SeenChanged(convergence = true, seenBy = s2.map(_.address)))) + diffLeader(g1, g2) should ===(Seq(LeaderChanged(Some(bUp.address)))) } "be produced for role leader changes" in { val g0 = Gossip.empty val g1 = Gossip(members = SortedSet(aUp, bUp, cUp, dLeaving, eJoining)) val g2 = Gossip(members = SortedSet(bUp, cUp, dExiting, eJoining)) - diffRolesLeader(g0, g1) should be( + diffRolesLeader(g0, g1) should ===( Set(RoleLeaderChanged("AA", Some(aUp.address)), RoleLeaderChanged("AB", Some(aUp.address)), RoleLeaderChanged("BB", Some(bUp.address)), RoleLeaderChanged("DD", Some(dLeaving.address)), RoleLeaderChanged("DE", Some(dLeaving.address)), RoleLeaderChanged("EE", Some(eUp.address)))) - diffRolesLeader(g1, g2) should be( + diffRolesLeader(g1, g2) should ===( Set(RoleLeaderChanged("AA", None), RoleLeaderChanged("AB", Some(bUp.address)), RoleLeaderChanged("DE", Some(eJoining.address)))) diff --git a/akka-cluster/src/test/scala/akka/cluster/ClusterHeartbeatSenderStateSpec.scala b/akka-cluster/src/test/scala/akka/cluster/ClusterHeartbeatSenderStateSpec.scala index 4400182108..8cf4478027 100644 --- a/akka-cluster/src/test/scala/akka/cluster/ClusterHeartbeatSenderStateSpec.scala +++ b/akka-cluster/src/test/scala/akka/cluster/ClusterHeartbeatSenderStateSpec.scala @@ -63,59 +63,59 @@ class ClusterHeartbeatSenderStateSpec extends WordSpec with Matchers { "A ClusterHeartbeatSenderState" must { "return empty active set when no nodes" in { - emptyState.activeReceivers.isEmpty should be(true) + emptyState.activeReceivers.isEmpty should ===(true) } "init with empty" in { - emptyState.init(Set.empty, Set.empty).activeReceivers should be(Set.empty) + emptyState.init(Set.empty, Set.empty).activeReceivers should ===(Set.empty) } "init with self" in { - emptyState.init(Set(aa, bb, cc), Set.empty).activeReceivers should be(Set(bb, cc)) + emptyState.init(Set(aa, bb, cc), Set.empty).activeReceivers should ===(Set(bb, cc)) } "init without self" in { - emptyState.init(Set(bb, cc), Set.empty).activeReceivers should be(Set(bb, cc)) + emptyState.init(Set(bb, cc), Set.empty).activeReceivers should ===(Set(bb, cc)) } "use added members" in { - emptyState.addMember(bb).addMember(cc).activeReceivers should be(Set(bb, cc)) + emptyState.addMember(bb).addMember(cc).activeReceivers should ===(Set(bb, cc)) } "use added members also when unreachable" in { - emptyState.addMember(bb).addMember(cc).unreachableMember(bb).activeReceivers should be(Set(bb, cc)) + emptyState.addMember(bb).addMember(cc).unreachableMember(bb).activeReceivers should ===(Set(bb, cc)) } "not use removed members" in { - emptyState.addMember(bb).addMember(cc).removeMember(bb).activeReceivers should be(Set(cc)) + emptyState.addMember(bb).addMember(cc).removeMember(bb).activeReceivers should ===(Set(cc)) } "use specified number of members" in { // they are sorted by the hash (uid) of the UniqueAddress - emptyState.addMember(cc).addMember(dd).addMember(bb).addMember(ee).activeReceivers should be(Set(bb, cc, dd)) + emptyState.addMember(cc).addMember(dd).addMember(bb).addMember(ee).activeReceivers should ===(Set(bb, cc, dd)) } "use specified number of members + unreachable" in { // they are sorted by the hash (uid) of the UniqueAddress emptyState.addMember(cc).addMember(dd).addMember(bb).addMember(ee).unreachableMember(cc) - .activeReceivers should be(Set(bb, cc, dd, ee)) + .activeReceivers should ===(Set(bb, cc, dd, ee)) } "update failure detector in active set" in { val s1 = emptyState.addMember(bb).addMember(cc).addMember(dd) val s2 = s1.heartbeatRsp(bb).heartbeatRsp(cc).heartbeatRsp(dd).heartbeatRsp(ee) - s2.failureDetector.isMonitoring(bb.address) should be(true) - s2.failureDetector.isMonitoring(cc.address) should be(true) - s2.failureDetector.isMonitoring(dd.address) should be(true) - s2.failureDetector.isMonitoring(ee.address) should be(false) + s2.failureDetector.isMonitoring(bb.address) should ===(true) + s2.failureDetector.isMonitoring(cc.address) should ===(true) + s2.failureDetector.isMonitoring(dd.address) should ===(true) + s2.failureDetector.isMonitoring(ee.address) should ===(false) } "continue to use unreachable" in { val s1 = emptyState.addMember(cc).addMember(dd).addMember(ee) val s2 = s1.heartbeatRsp(cc).heartbeatRsp(dd).heartbeatRsp(ee) fd(s2, ee).markNodeAsUnavailable() - s2.failureDetector.isAvailable(ee.address) should be(false) - s2.addMember(bb).activeReceivers should be(Set(bb, cc, dd, ee)) + s2.failureDetector.isAvailable(ee.address) should ===(false) + s2.addMember(bb).activeReceivers should ===(Set(bb, cc, dd, ee)) } "remove unreachable when coming back" in { @@ -124,10 +124,10 @@ class ClusterHeartbeatSenderStateSpec extends WordSpec with Matchers { fd(s2, dd).markNodeAsUnavailable() fd(s2, ee).markNodeAsUnavailable() val s3 = s2.addMember(bb) - s3.activeReceivers should be(Set(bb, cc, dd, ee)) + s3.activeReceivers should ===(Set(bb, cc, dd, ee)) val s4 = s3.heartbeatRsp(bb).heartbeatRsp(cc).heartbeatRsp(dd).heartbeatRsp(ee) - s4.activeReceivers should be(Set(bb, cc, dd)) - s4.failureDetector.isMonitoring(ee.address) should be(false) + s4.activeReceivers should ===(Set(bb, cc, dd)) + s4.failureDetector.isMonitoring(ee.address) should ===(false) } "remove unreachable when member removed" in { @@ -136,11 +136,11 @@ class ClusterHeartbeatSenderStateSpec extends WordSpec with Matchers { fd(s2, cc).markNodeAsUnavailable() fd(s2, ee).markNodeAsUnavailable() val s3 = s2.addMember(bb).heartbeatRsp(bb) - s3.activeReceivers should be(Set(bb, cc, dd, ee)) + s3.activeReceivers should ===(Set(bb, cc, dd, ee)) val s4 = s3.removeMember(cc).removeMember(ee) - s4.activeReceivers should be(Set(bb, dd)) - s4.failureDetector.isMonitoring(cc.address) should be(false) - s4.failureDetector.isMonitoring(ee.address) should be(false) + s4.activeReceivers should ===(Set(bb, dd)) + s4.failureDetector.isMonitoring(cc.address) should ===(false) + s4.failureDetector.isMonitoring(ee.address) should ===(false) } "behave correctly for random operations" in { @@ -163,9 +163,9 @@ class ClusterHeartbeatSenderStateSpec extends WordSpec with Matchers { val oldUnreachable = state.oldReceiversNowUnreachable state = state.addMember(node) // keep unreachable - (oldUnreachable -- state.activeReceivers) should be(Set.empty) - state.failureDetector.isMonitoring(node.address) should be(false) - state.failureDetector.isAvailable(node.address) should be(true) + (oldUnreachable -- state.activeReceivers) should ===(Set.empty) + state.failureDetector.isMonitoring(node.address) should ===(false) + state.failureDetector.isAvailable(node.address) should ===(true) } case Remove ⇒ @@ -174,12 +174,12 @@ class ClusterHeartbeatSenderStateSpec extends WordSpec with Matchers { state = state.removeMember(node) // keep unreachable, unless it was the removed if (oldUnreachable(node)) - (oldUnreachable -- state.activeReceivers) should be(Set(node)) + (oldUnreachable -- state.activeReceivers) should ===(Set(node)) else - (oldUnreachable -- state.activeReceivers) should be(Set.empty) + (oldUnreachable -- state.activeReceivers) should ===(Set.empty) - state.failureDetector.isMonitoring(node.address) should be(false) - state.failureDetector.isAvailable(node.address) should be(true) + state.failureDetector.isMonitoring(node.address) should ===(false) + state.failureDetector.isAvailable(node.address) should ===(true) state.activeReceivers should not contain (node) } @@ -187,8 +187,8 @@ class ClusterHeartbeatSenderStateSpec extends WordSpec with Matchers { if (node != selfUniqueAddress && state.activeReceivers(node)) { state.failureDetector.heartbeat(node.address) // make sure the fd is created fd(state, node).markNodeAsUnavailable() - state.failureDetector.isMonitoring(node.address) should be(true) - state.failureDetector.isAvailable(node.address) should be(false) + state.failureDetector.isMonitoring(node.address) should ===(true) + state.failureDetector.isAvailable(node.address) should ===(false) state = state.unreachableMember(node) } @@ -203,13 +203,13 @@ class ClusterHeartbeatSenderStateSpec extends WordSpec with Matchers { state.oldReceiversNowUnreachable should not contain (node) if (oldUnreachable(node) && !oldRingReceivers(node)) - state.failureDetector.isMonitoring(node.address) should be(false) + state.failureDetector.isMonitoring(node.address) should ===(false) if (oldRingReceivers(node)) - state.failureDetector.isMonitoring(node.address) should be(true) + state.failureDetector.isMonitoring(node.address) should ===(true) - state.ring.myReceivers should be(oldRingReceivers) - state.failureDetector.isAvailable(node.address) should be(true) + state.ring.myReceivers should ===(oldRingReceivers) + state.failureDetector.isAvailable(node.address) should ===(true) } diff --git a/akka-cluster/src/test/scala/akka/cluster/ClusterSpec.scala b/akka-cluster/src/test/scala/akka/cluster/ClusterSpec.scala index 0aa2a67bb3..cb43a3a40b 100644 --- a/akka-cluster/src/test/scala/akka/cluster/ClusterSpec.scala +++ b/akka-cluster/src/test/scala/akka/cluster/ClusterSpec.scala @@ -48,7 +48,7 @@ class ClusterSpec extends AkkaSpec(ClusterSpec.config) with ImplicitSender { "A Cluster" must { "use the address of the remote transport" in { - cluster.selfAddress should be(selfAddress) + cluster.selfAddress should ===(selfAddress) } "register jmx mbean" in { @@ -59,13 +59,13 @@ class ClusterSpec extends AkkaSpec(ClusterSpec.config) with ImplicitSender { } "initially become singleton cluster when joining itself and reach convergence" in { - clusterView.members.size should be(0) + clusterView.members.size should ===(0) cluster.join(selfAddress) leaderActions() // Joining -> Up awaitCond(clusterView.isSingletonCluster) - clusterView.self.address should be(selfAddress) - clusterView.members.map(_.address) should be(Set(selfAddress)) - awaitAssert(clusterView.status should be(MemberStatus.Up)) + clusterView.self.address should ===(selfAddress) + clusterView.members.map(_.address) should ===(Set(selfAddress)) + awaitAssert(clusterView.status should ===(MemberStatus.Up)) } "publish inital state as snapshot to subscribers" in { @@ -98,7 +98,7 @@ class ClusterSpec extends AkkaSpec(ClusterSpec.config) with ImplicitSender { expectMsgClass(classOf[ClusterEvent.CurrentClusterState]) cluster.shutdown() - expectMsgType[ClusterEvent.MemberRemoved].member.address should be(selfAddress) + expectMsgType[ClusterEvent.MemberRemoved].member.address should ===(selfAddress) } } diff --git a/akka-cluster/src/test/scala/akka/cluster/EWMASpec.scala b/akka-cluster/src/test/scala/akka/cluster/EWMASpec.scala index b5b151dadd..76ab62723a 100644 --- a/akka-cluster/src/test/scala/akka/cluster/EWMASpec.scala +++ b/akka-cluster/src/test/scala/akka/cluster/EWMASpec.scala @@ -22,34 +22,34 @@ class EWMASpec extends AkkaSpec(MetricsEnabledSpec.config) with MetricsCollector "calcualate same ewma for constant values" in { val ds = EWMA(value = 100.0, alpha = 0.18) :+ 100.0 :+ 100.0 :+ 100.0 - ds.value should be(100.0 +- 0.001) + ds.value should ===(100.0 +- 0.001) } "calcualate correct ewma for normal decay" in { val d0 = EWMA(value = 1000.0, alpha = 2.0 / (1 + 10)) - d0.value should be(1000.0 +- 0.01) + d0.value should ===(1000.0 +- 0.01) val d1 = d0 :+ 10.0 - d1.value should be(820.0 +- 0.01) + d1.value should ===(820.0 +- 0.01) val d2 = d1 :+ 10.0 - d2.value should be(672.73 +- 0.01) + d2.value should ===(672.73 +- 0.01) val d3 = d2 :+ 10.0 - d3.value should be(552.23 +- 0.01) + d3.value should ===(552.23 +- 0.01) val d4 = d3 :+ 10.0 - d4.value should be(453.64 +- 0.01) + d4.value should ===(453.64 +- 0.01) val dn = (1 to 100).foldLeft(d0)((d, _) ⇒ d :+ 10.0) - dn.value should be(10.0 +- 0.1) + dn.value should ===(10.0 +- 0.1) } "calculate ewma for alpha 1.0, max bias towards latest value" in { val d0 = EWMA(value = 100.0, alpha = 1.0) - d0.value should be(100.0 +- 0.01) + d0.value should ===(100.0 +- 0.01) val d1 = d0 :+ 1.0 - d1.value should be(1.0 +- 0.01) + d1.value should ===(1.0 +- 0.01) val d2 = d1 :+ 57.0 - d2.value should be(57.0 +- 0.01) + d2.value should ===(57.0 +- 0.01) val d3 = d2 :+ 10.0 - d3.value should be(10.0 +- 0.01) + d3.value should ===(10.0 +- 0.01) } "calculate alpha from half-life and collect interval" in { @@ -60,21 +60,21 @@ class EWMASpec extends AkkaSpec(MetricsEnabledSpec.config) with MetricsCollector val halfLife = n.toDouble / 2.8854 val collectInterval = 1.second val halfLifeDuration = (halfLife * 1000).millis - EWMA.alpha(halfLifeDuration, collectInterval) should be(expectedAlpha +- 0.001) + EWMA.alpha(halfLifeDuration, collectInterval) should ===(expectedAlpha +- 0.001) } "calculate sane alpha from short half-life" in { val alpha = EWMA.alpha(1.millis, 3.seconds) alpha should be <= (1.0) alpha should be >= (0.0) - alpha should be(1.0 +- 0.001) + alpha should ===(1.0 +- 0.001) } "calculate sane alpha from long half-life" in { val alpha = EWMA.alpha(1.day, 3.seconds) alpha should be <= (1.0) alpha should be >= (0.0) - alpha should be(0.0 +- 0.001) + alpha should ===(0.0 +- 0.001) } "calculate the ewma for multiple, variable, data streams" taggedAs LongRunningTest in { @@ -90,7 +90,7 @@ class EWMASpec extends AkkaSpec(MetricsEnabledSpec.config) with MetricsCollector case Some(previous) ⇒ if (latest.isSmooth && latest.value != previous.value) { val updated = previous :+ latest - updated.isSmooth should be(true) + updated.isSmooth should ===(true) updated.smoothValue should not be (previous.smoothValue) Some(updated) } else None diff --git a/akka-cluster/src/test/scala/akka/cluster/GossipSpec.scala b/akka-cluster/src/test/scala/akka/cluster/GossipSpec.scala index 9f4f61517b..8e9ea46d01 100644 --- a/akka-cluster/src/test/scala/akka/cluster/GossipSpec.scala +++ b/akka-cluster/src/test/scala/akka/cluster/GossipSpec.scala @@ -29,43 +29,43 @@ class GossipSpec extends WordSpec with Matchers { "A Gossip" must { "reach convergence when it's empty" in { - Gossip.empty.convergence(a1.uniqueAddress) should be(true) + Gossip.empty.convergence(a1.uniqueAddress) should ===(true) } "reach convergence for one node" in { val g1 = (Gossip(members = SortedSet(a1))).seen(a1.uniqueAddress) - g1.convergence(a1.uniqueAddress) should be(true) + g1.convergence(a1.uniqueAddress) should ===(true) } "not reach convergence until all have seen version" in { val g1 = (Gossip(members = SortedSet(a1, b1))).seen(a1.uniqueAddress) - g1.convergence(a1.uniqueAddress) should be(false) + g1.convergence(a1.uniqueAddress) should ===(false) } "reach convergence for two nodes" in { val g1 = (Gossip(members = SortedSet(a1, b1))).seen(a1.uniqueAddress).seen(b1.uniqueAddress) - g1.convergence(a1.uniqueAddress) should be(true) + g1.convergence(a1.uniqueAddress) should ===(true) } "reach convergence, skipping joining" in { // e1 is joining val g1 = (Gossip(members = SortedSet(a1, b1, e1))).seen(a1.uniqueAddress).seen(b1.uniqueAddress) - g1.convergence(a1.uniqueAddress) should be(true) + g1.convergence(a1.uniqueAddress) should ===(true) } "reach convergence, skipping down" in { // e3 is down val g1 = (Gossip(members = SortedSet(a1, b1, e3))).seen(a1.uniqueAddress).seen(b1.uniqueAddress) - g1.convergence(a1.uniqueAddress) should be(true) + g1.convergence(a1.uniqueAddress) should ===(true) } "not reach convergence when unreachable" in { val r1 = Reachability.empty.unreachable(b1.uniqueAddress, a1.uniqueAddress) val g1 = (Gossip(members = SortedSet(a1, b1), overview = GossipOverview(reachability = r1))) .seen(a1.uniqueAddress).seen(b1.uniqueAddress) - g1.convergence(b1.uniqueAddress) should be(false) + g1.convergence(b1.uniqueAddress) should ===(false) // but from a1's point of view (it knows that itself is not unreachable) - g1.convergence(a1.uniqueAddress) should be(true) + g1.convergence(a1.uniqueAddress) should ===(true) } "reach convergence when downed node has observed unreachable" in { @@ -73,7 +73,7 @@ class GossipSpec extends WordSpec with Matchers { val r1 = Reachability.empty.unreachable(e3.uniqueAddress, a1.uniqueAddress) val g1 = (Gossip(members = SortedSet(a1, b1, e3), overview = GossipOverview(reachability = r1))) .seen(a1.uniqueAddress).seen(b1.uniqueAddress).seen(e3.uniqueAddress) - g1.convergence(b1.uniqueAddress) should be(true) + g1.convergence(b1.uniqueAddress) should ===(true) } "merge members by status priority" in { @@ -81,12 +81,12 @@ class GossipSpec extends WordSpec with Matchers { val g2 = Gossip(members = SortedSet(a2, c2, e2)) val merged1 = g1 merge g2 - merged1.members should be(SortedSet(a2, c1, e1)) - merged1.members.toSeq.map(_.status) should be(Seq(Up, Leaving, Up)) + merged1.members should ===(SortedSet(a2, c1, e1)) + merged1.members.toSeq.map(_.status) should ===(Seq(Up, Leaving, Up)) val merged2 = g2 merge g1 - merged2.members should be(SortedSet(a2, c1, e1)) - merged2.members.toSeq.map(_.status) should be(Seq(Up, Leaving, Up)) + merged2.members should ===(SortedSet(a2, c1, e1)) + merged2.members.toSeq.map(_.status) should ===(Seq(Up, Leaving, Up)) } @@ -97,10 +97,10 @@ class GossipSpec extends WordSpec with Matchers { val g2 = Gossip(members = SortedSet(a1, b1, c1, d1), overview = GossipOverview(reachability = r2)) val merged1 = g1 merge g2 - merged1.overview.reachability.allUnreachable should be(Set(a1.uniqueAddress, c1.uniqueAddress, d1.uniqueAddress)) + merged1.overview.reachability.allUnreachable should ===(Set(a1.uniqueAddress, c1.uniqueAddress, d1.uniqueAddress)) val merged2 = g2 merge g1 - merged2.overview.reachability.allUnreachable should be(merged1.overview.reachability.allUnreachable) + merged2.overview.reachability.allUnreachable should ===(merged1.overview.reachability.allUnreachable) } "merge members by removing removed members" in { @@ -111,18 +111,18 @@ class GossipSpec extends WordSpec with Matchers { val g2 = Gossip(members = SortedSet(a1, b1, c3), overview = GossipOverview(reachability = r2)) val merged1 = g1 merge g2 - merged1.members should be(SortedSet(a1, b1)) - merged1.overview.reachability.allUnreachable should be(Set(a1.uniqueAddress)) + merged1.members should ===(SortedSet(a1, b1)) + merged1.overview.reachability.allUnreachable should ===(Set(a1.uniqueAddress)) val merged2 = g2 merge g1 - merged2.overview.reachability.allUnreachable should be(merged1.overview.reachability.allUnreachable) - merged2.members should be(merged1.members) + merged2.overview.reachability.allUnreachable should ===(merged1.overview.reachability.allUnreachable) + merged2.members should ===(merged1.members) } "have leader as first member based on ordering, except Exiting status" in { - Gossip(members = SortedSet(c2, e2)).leader should be(Some(c2.uniqueAddress)) - Gossip(members = SortedSet(c3, e2)).leader should be(Some(e2.uniqueAddress)) - Gossip(members = SortedSet(c3)).leader should be(Some(c3.uniqueAddress)) + Gossip(members = SortedSet(c2, e2)).leader should ===(Some(c2.uniqueAddress)) + Gossip(members = SortedSet(c3, e2)).leader should ===(Some(e2.uniqueAddress)) + Gossip(members = SortedSet(c3)).leader should ===(Some(c3.uniqueAddress)) } "merge seen table correctly" in { @@ -133,13 +133,13 @@ class GossipSpec extends WordSpec with Matchers { def checkMerged(merged: Gossip) { val seen = merged.overview.seen.toSeq - seen.length should be(0) + seen.length should ===(0) - merged seenByNode (a1.uniqueAddress) should be(false) - merged seenByNode (b1.uniqueAddress) should be(false) - merged seenByNode (c1.uniqueAddress) should be(false) - merged seenByNode (d1.uniqueAddress) should be(false) - merged seenByNode (e1.uniqueAddress) should be(false) + merged seenByNode (a1.uniqueAddress) should ===(false) + merged seenByNode (b1.uniqueAddress) should ===(false) + merged seenByNode (c1.uniqueAddress) should ===(false) + merged seenByNode (d1.uniqueAddress) should ===(false) + merged seenByNode (e1.uniqueAddress) should ===(false) } checkMerged(g3 merge g2) @@ -150,12 +150,12 @@ class GossipSpec extends WordSpec with Matchers { // a2 and e1 is Joining val g1 = Gossip(members = SortedSet(a2, b1.copyUp(3), e1), overview = GossipOverview(reachability = Reachability.empty.unreachable(a2.uniqueAddress, e1.uniqueAddress))) - g1.youngestMember should be(b1) + g1.youngestMember should ===(b1) val g2 = Gossip(members = SortedSet(a2, b1.copyUp(3), e1), overview = GossipOverview(reachability = Reachability.empty.unreachable(a2.uniqueAddress, b1.uniqueAddress).unreachable(a2.uniqueAddress, e1.uniqueAddress))) - g2.youngestMember should be(b1) + g2.youngestMember should ===(b1) val g3 = Gossip(members = SortedSet(a2, b1.copyUp(3), e2.copyUp(4))) - g3.youngestMember should be(e2) + g3.youngestMember should ===(e2) } } } diff --git a/akka-cluster/src/test/scala/akka/cluster/HeartbeatNodeRingPerfSpec.scala b/akka-cluster/src/test/scala/akka/cluster/HeartbeatNodeRingPerfSpec.scala index 5564f3ddfc..eb741688b7 100644 --- a/akka-cluster/src/test/scala/akka/cluster/HeartbeatNodeRingPerfSpec.scala +++ b/akka-cluster/src/test/scala/akka/cluster/HeartbeatNodeRingPerfSpec.scala @@ -28,7 +28,7 @@ class HeartbeatNodeRingPerfSpec extends WordSpec with Matchers { private def myReceivers(ring: HeartbeatNodeRing): Unit = { val r = HeartbeatNodeRing(ring.selfAddress, ring.nodes, Set.empty, ring.monitoredByNrOfMembers) - r.myReceivers.isEmpty should be(false) + r.myReceivers.isEmpty should ===(false) } s"HeartbeatNodeRing of size $nodesSize" must { diff --git a/akka-cluster/src/test/scala/akka/cluster/HeartbeatNodeRingSpec.scala b/akka-cluster/src/test/scala/akka/cluster/HeartbeatNodeRingSpec.scala index 17ba1e2c4e..64c6451432 100644 --- a/akka-cluster/src/test/scala/akka/cluster/HeartbeatNodeRingSpec.scala +++ b/akka-cluster/src/test/scala/akka/cluster/HeartbeatNodeRingSpec.scala @@ -27,37 +27,37 @@ class HeartbeatNodeRingSpec extends WordSpec with Matchers { "pick specified number of nodes as receivers" in { val ring = HeartbeatNodeRing(cc, nodes, Set.empty, 3) - ring.myReceivers should be(ring.receivers(cc)) + ring.myReceivers should ===(ring.receivers(cc)) nodes foreach { n ⇒ val receivers = ring.receivers(n) - receivers.size should be(3) + receivers.size should ===(3) receivers should not contain (n) } } "pick specified number of nodes + unreachable as receivers" in { val ring = HeartbeatNodeRing(cc, nodes, unreachable = Set(aa, dd, ee), monitoredByNrOfMembers = 3) - ring.myReceivers should be(ring.receivers(cc)) + ring.myReceivers should ===(ring.receivers(cc)) - ring.receivers(aa) should be(Set(bb, cc, dd, ff)) // unreachable ee skipped - ring.receivers(bb) should be(Set(cc, dd, ee, ff)) // unreachable aa skipped - ring.receivers(cc) should be(Set(dd, ee, ff, bb)) // unreachable aa skipped - ring.receivers(dd) should be(Set(ee, ff, aa, bb, cc)) - ring.receivers(ee) should be(Set(ff, aa, bb, cc)) - ring.receivers(ff) should be(Set(aa, bb, cc)) // unreachable dd and ee skipped + ring.receivers(aa) should ===(Set(bb, cc, dd, ff)) // unreachable ee skipped + ring.receivers(bb) should ===(Set(cc, dd, ee, ff)) // unreachable aa skipped + ring.receivers(cc) should ===(Set(dd, ee, ff, bb)) // unreachable aa skipped + ring.receivers(dd) should ===(Set(ee, ff, aa, bb, cc)) + ring.receivers(ee) should ===(Set(ff, aa, bb, cc)) + ring.receivers(ff) should ===(Set(aa, bb, cc)) // unreachable dd and ee skipped } "pick all except own as receivers when less than total number of nodes" in { val expected = Set(aa, bb, dd, ee, ff) - HeartbeatNodeRing(cc, nodes, Set.empty, 5).myReceivers should be(expected) - HeartbeatNodeRing(cc, nodes, Set.empty, 6).myReceivers should be(expected) - HeartbeatNodeRing(cc, nodes, Set.empty, 7).myReceivers should be(expected) + HeartbeatNodeRing(cc, nodes, Set.empty, 5).myReceivers should ===(expected) + HeartbeatNodeRing(cc, nodes, Set.empty, 6).myReceivers should ===(expected) + HeartbeatNodeRing(cc, nodes, Set.empty, 7).myReceivers should ===(expected) } "pick none when alone" in { val ring = HeartbeatNodeRing(cc, Set(cc), Set.empty, 3) - ring.myReceivers should be(Set()) + ring.myReceivers should ===(Set()) } } diff --git a/akka-cluster/src/test/scala/akka/cluster/MemberOrderingSpec.scala b/akka-cluster/src/test/scala/akka/cluster/MemberOrderingSpec.scala index 8d19249b82..123b31a553 100644 --- a/akka-cluster/src/test/scala/akka/cluster/MemberOrderingSpec.scala +++ b/akka-cluster/src/test/scala/akka/cluster/MemberOrderingSpec.scala @@ -28,10 +28,10 @@ class MemberOrderingSpec extends WordSpec with Matchers { m(AddressFromURIString("akka://sys@darkstar:1111"), Up) val seq = members.toSeq - seq.size should be(3) - seq(0) should be(m(AddressFromURIString("akka://sys@darkstar:1111"), Up)) - seq(1) should be(m(AddressFromURIString("akka://sys@darkstar:1112"), Up)) - seq(2) should be(m(AddressFromURIString("akka://sys@darkstar:1113"), Joining)) + seq.size should ===(3) + seq(0) should ===(m(AddressFromURIString("akka://sys@darkstar:1111"), Up)) + seq(1) should ===(m(AddressFromURIString("akka://sys@darkstar:1112"), Up)) + seq(2) should ===(m(AddressFromURIString("akka://sys@darkstar:1113"), Joining)) } "be sorted by address correctly" in { @@ -45,8 +45,8 @@ class MemberOrderingSpec extends WordSpec with Matchers { val expected = IndexedSeq(m1, m2, m3, m4, m5) val shuffled = Random.shuffle(expected) - shuffled.sorted should be(expected) - (SortedSet.empty[Member] ++ shuffled).toIndexedSeq should be(expected) + shuffled.sorted should ===(expected) + (SortedSet.empty[Member] ++ shuffled).toIndexedSeq should ===(expected) } "have stable equals and hashCode" in { @@ -57,14 +57,14 @@ class MemberOrderingSpec extends WordSpec with Matchers { val m22 = m11.copy(status = Up) val m3 = m(address.copy(port = Some(10000)), Up) - m1 should be(m2) - m1.hashCode should be(m2.hashCode) + m1 should ===(m2) + m1.hashCode should ===(m2.hashCode) m3 should not be (m2) m3 should not be (m1) - m11 should be(m22) - m11.hashCode should be(m22.hashCode) + m11 should ===(m22) + m11.hashCode should ===(m22.hashCode) // different uid m1 should not be (m11) @@ -78,14 +78,14 @@ class MemberOrderingSpec extends WordSpec with Matchers { val x = m(address1, Exiting) val y = m(address1, Removed) val z = m(address2, Up) - Member.ordering.compare(x, y) should be(0) - Member.ordering.compare(x, z) should be(Member.ordering.compare(y, z)) + Member.ordering.compare(x, y) should ===(0) + Member.ordering.compare(x, z) should ===(Member.ordering.compare(y, z)) // different uid val a = m(address1, Joining) val b = Member(UniqueAddress(address1, -3), Set.empty) - Member.ordering.compare(a, b) should be(1) - Member.ordering.compare(b, a) should be(-1) + Member.ordering.compare(a, b) should ===(1) + Member.ordering.compare(b, a) should ===(-1) } @@ -94,10 +94,10 @@ class MemberOrderingSpec extends WordSpec with Matchers { val address2 = address1.copy(port = Some(9002)) val address3 = address1.copy(port = Some(9003)) - (SortedSet(m(address1, Joining)) - m(address1, Up)) should be(SortedSet.empty[Member]) - (SortedSet(m(address1, Exiting)) - m(address1, Removed)) should be(SortedSet.empty[Member]) - (SortedSet(m(address1, Up)) - m(address1, Exiting)) should be(SortedSet.empty[Member]) - (SortedSet(m(address2, Up), m(address3, Joining), m(address1, Exiting)) - m(address1, Removed)) should be( + (SortedSet(m(address1, Joining)) - m(address1, Up)) should ===(SortedSet.empty[Member]) + (SortedSet(m(address1, Exiting)) - m(address1, Removed)) should ===(SortedSet.empty[Member]) + (SortedSet(m(address1, Up)) - m(address1, Exiting)) should ===(SortedSet.empty[Member]) + (SortedSet(m(address2, Up), m(address3, Joining), m(address1, Exiting)) - m(address1, Removed)) should ===( SortedSet(m(address2, Up), m(address3, Joining))) } @@ -113,11 +113,11 @@ class MemberOrderingSpec extends WordSpec with Matchers { AddressFromURIString("akka://sys@darkstar:1111") val seq = addresses.toSeq - seq.size should be(4) - seq(0) should be(AddressFromURIString("akka://sys@darkstar:1110")) - seq(1) should be(AddressFromURIString("akka://sys@darkstar:1111")) - seq(2) should be(AddressFromURIString("akka://sys@darkstar:1112")) - seq(3) should be(AddressFromURIString("akka://sys@darkstar:1113")) + seq.size should ===(4) + seq(0) should ===(AddressFromURIString("akka://sys@darkstar:1110")) + seq(1) should ===(AddressFromURIString("akka://sys@darkstar:1111")) + seq(2) should ===(AddressFromURIString("akka://sys@darkstar:1112")) + seq(3) should ===(AddressFromURIString("akka://sys@darkstar:1113")) } "order addresses by hostname" in { @@ -128,11 +128,11 @@ class MemberOrderingSpec extends WordSpec with Matchers { AddressFromURIString("akka://sys@darkstar0:1110") val seq = addresses.toSeq - seq.size should be(4) - seq(0) should be(AddressFromURIString("akka://sys@darkstar0:1110")) - seq(1) should be(AddressFromURIString("akka://sys@darkstar1:1110")) - seq(2) should be(AddressFromURIString("akka://sys@darkstar2:1110")) - seq(3) should be(AddressFromURIString("akka://sys@darkstar3:1110")) + seq.size should ===(4) + seq(0) should ===(AddressFromURIString("akka://sys@darkstar0:1110")) + seq(1) should ===(AddressFromURIString("akka://sys@darkstar1:1110")) + seq(2) should ===(AddressFromURIString("akka://sys@darkstar2:1110")) + seq(3) should ===(AddressFromURIString("akka://sys@darkstar3:1110")) } "order addresses by hostname and port" in { @@ -143,11 +143,11 @@ class MemberOrderingSpec extends WordSpec with Matchers { AddressFromURIString("akka://sys@darkstar0:1110") val seq = addresses.toSeq - seq.size should be(4) - seq(0) should be(AddressFromURIString("akka://sys@darkstar0:1110")) - seq(1) should be(AddressFromURIString("akka://sys@darkstar0:1111")) - seq(2) should be(AddressFromURIString("akka://sys@darkstar2:1110")) - seq(3) should be(AddressFromURIString("akka://sys@darkstar2:1111")) + seq.size should ===(4) + seq(0) should ===(AddressFromURIString("akka://sys@darkstar0:1110")) + seq(1) should ===(AddressFromURIString("akka://sys@darkstar0:1111")) + seq(2) should ===(AddressFromURIString("akka://sys@darkstar2:1110")) + seq(3) should ===(AddressFromURIString("akka://sys@darkstar2:1111")) } } @@ -165,7 +165,7 @@ class MemberOrderingSpec extends WordSpec with Matchers { val m8 = m(address.copy(port = Some(9000)), Up) val expected = IndexedSeq(m7, m8, m1, m2, m3, m4, m5, m6) val shuffled = Random.shuffle(expected) - shuffled.sorted(Member.leaderStatusOrdering) should be(expected) + shuffled.sorted(Member.leaderStatusOrdering) should ===(expected) } } } diff --git a/akka-cluster/src/test/scala/akka/cluster/MetricNumericConverterSpec.scala b/akka-cluster/src/test/scala/akka/cluster/MetricNumericConverterSpec.scala index 318ac0efd3..b147dbdaa4 100644 --- a/akka-cluster/src/test/scala/akka/cluster/MetricNumericConverterSpec.scala +++ b/akka-cluster/src/test/scala/akka/cluster/MetricNumericConverterSpec.scala @@ -17,35 +17,35 @@ class MetricNumericConverterSpec extends WordSpec with Matchers with MetricNumer "MetricNumericConverter" must { "convert" in { - convertNumber(0).isLeft should be(true) - convertNumber(1).left.get should be(1) - convertNumber(1L).isLeft should be(true) - convertNumber(0.0).isRight should be(true) + convertNumber(0).isLeft should ===(true) + convertNumber(1).left.get should ===(1) + convertNumber(1L).isLeft should ===(true) + convertNumber(0.0).isRight should ===(true) } "define a new metric" in { val Some(metric) = Metric.create(HeapMemoryUsed, 256L, decayFactor = Some(0.18)) - metric.name should be(HeapMemoryUsed) - metric.value should be(256L) - metric.isSmooth should be(true) - metric.smoothValue should be(256.0 +- 0.0001) + metric.name should ===(HeapMemoryUsed) + metric.value should ===(256L) + metric.isSmooth should ===(true) + metric.smoothValue should ===(256.0 +- 0.0001) } "define an undefined value with a None " in { - Metric.create("x", -1, None).isDefined should be(false) - Metric.create("x", java.lang.Double.NaN, None).isDefined should be(false) - Metric.create("x", Failure(new RuntimeException), None).isDefined should be(false) + Metric.create("x", -1, None).isDefined should ===(false) + Metric.create("x", java.lang.Double.NaN, None).isDefined should ===(false) + Metric.create("x", Failure(new RuntimeException), None).isDefined should ===(false) } "recognize whether a metric value is defined" in { - defined(0) should be(true) - defined(0.0) should be(true) + defined(0) should ===(true) + defined(0.0) should ===(true) } "recognize whether a metric value is not defined" in { - defined(-1) should be(false) - defined(-1.0) should be(false) - defined(Double.NaN) should be(false) + defined(-1) should ===(false) + defined(-1.0) should ===(false) + defined(Double.NaN) should ===(false) } } } diff --git a/akka-cluster/src/test/scala/akka/cluster/MetricsCollectorSpec.scala b/akka-cluster/src/test/scala/akka/cluster/MetricsCollectorSpec.scala index 12940f5be8..30b4cf6d8a 100644 --- a/akka-cluster/src/test/scala/akka/cluster/MetricsCollectorSpec.scala +++ b/akka-cluster/src/test/scala/akka/cluster/MetricsCollectorSpec.scala @@ -44,8 +44,8 @@ class MetricsCollectorSpec extends AkkaSpec(MetricsEnabledSpec.config) with Impl val merged12 = sample2 flatMap (latest ⇒ sample1 collect { case peer if latest sameAs peer ⇒ val m = peer :+ latest - m.value should be(latest.value) - m.isSmooth should be(peer.isSmooth || latest.isSmooth) + m.value should ===(latest.value) + m.isSmooth should ===(peer.isSmooth || latest.isSmooth) m }) @@ -54,8 +54,8 @@ class MetricsCollectorSpec extends AkkaSpec(MetricsEnabledSpec.config) with Impl val merged34 = sample4 flatMap (latest ⇒ sample3 collect { case peer if latest sameAs peer ⇒ val m = peer :+ latest - m.value should be(latest.value) - m.isSmooth should be(peer.isSmooth || latest.isSmooth) + m.value should ===(latest.value) + m.isSmooth should ===(peer.isSmooth || latest.isSmooth) m }) } @@ -95,9 +95,9 @@ class MetricsCollectorSpec extends AkkaSpec(MetricsEnabledSpec.config) with Impl // it's not present on all platforms val c = collector.asInstanceOf[JmxMetricsCollector] val heap = c.heapMemoryUsage - c.heapUsed(heap).isDefined should be(true) - c.heapCommitted(heap).isDefined should be(true) - c.processors.isDefined should be(true) + c.heapUsed(heap).isDefined should ===(true) + c.heapCommitted(heap).isDefined should ===(true) + c.processors.isDefined should ===(true) } "collect 50 node metrics samples in an acceptable duration" taggedAs LongRunningTest in within(10 seconds) { diff --git a/akka-cluster/src/test/scala/akka/cluster/MetricsGossipSpec.scala b/akka-cluster/src/test/scala/akka/cluster/MetricsGossipSpec.scala index fce30c1f41..415d037ef9 100644 --- a/akka-cluster/src/test/scala/akka/cluster/MetricsGossipSpec.scala +++ b/akka-cluster/src/test/scala/akka/cluster/MetricsGossipSpec.scala @@ -27,13 +27,13 @@ class MetricsGossipSpec extends AkkaSpec(MetricsEnabledSpec.config) with Implici m2.metrics.size should be > (3) val g1 = MetricsGossip.empty :+ m1 - g1.nodes.size should be(1) - g1.nodeMetricsFor(m1.address).map(_.metrics) should be(Some(m1.metrics)) + g1.nodes.size should ===(1) + g1.nodeMetricsFor(m1.address).map(_.metrics) should ===(Some(m1.metrics)) val g2 = g1 :+ m2 - g2.nodes.size should be(2) - g2.nodeMetricsFor(m1.address).map(_.metrics) should be(Some(m1.metrics)) - g2.nodeMetricsFor(m2.address).map(_.metrics) should be(Some(m2.metrics)) + g2.nodes.size should ===(2) + g2.nodeMetricsFor(m1.address).map(_.metrics) should ===(Some(m1.metrics)) + g2.nodeMetricsFor(m2.address).map(_.metrics) should ===(Some(m2.metrics)) } "merge peer metrics" in { @@ -41,15 +41,15 @@ class MetricsGossipSpec extends AkkaSpec(MetricsEnabledSpec.config) with Implici val m2 = NodeMetrics(Address("akka.tcp", "sys", "a", 2555), newTimestamp, collector.sample.metrics) val g1 = MetricsGossip.empty :+ m1 :+ m2 - g1.nodes.size should be(2) + g1.nodes.size should ===(2) val beforeMergeNodes = g1.nodes val m2Updated = m2 copy (metrics = collector.sample.metrics, timestamp = m2.timestamp + 1000) val g2 = g1 :+ m2Updated // merge peers - g2.nodes.size should be(2) - g2.nodeMetricsFor(m1.address).map(_.metrics) should be(Some(m1.metrics)) - g2.nodeMetricsFor(m2.address).map(_.metrics) should be(Some(m2Updated.metrics)) - g2.nodes collect { case peer if peer.address == m2.address ⇒ peer.timestamp should be(m2Updated.timestamp) } + g2.nodes.size should ===(2) + g2.nodeMetricsFor(m1.address).map(_.metrics) should ===(Some(m1.metrics)) + g2.nodeMetricsFor(m2.address).map(_.metrics) should ===(Some(m2Updated.metrics)) + g2.nodes collect { case peer if peer.address == m2.address ⇒ peer.timestamp should ===(m2Updated.timestamp) } } "merge an existing metric set for a node and update node ring" in { @@ -61,22 +61,22 @@ class MetricsGossipSpec extends AkkaSpec(MetricsEnabledSpec.config) with Implici val g1 = MetricsGossip.empty :+ m1 :+ m2 val g2 = MetricsGossip.empty :+ m3 :+ m2Updated - g1.nodes.map(_.address) should be(Set(m1.address, m2.address)) + g1.nodes.map(_.address) should ===(Set(m1.address, m2.address)) // should contain nodes 1,3, and the most recent version of 2 val mergedGossip = g1 merge g2 - mergedGossip.nodes.map(_.address) should be(Set(m1.address, m2.address, m3.address)) - mergedGossip.nodeMetricsFor(m1.address).map(_.metrics) should be(Some(m1.metrics)) - mergedGossip.nodeMetricsFor(m2.address).map(_.metrics) should be(Some(m2Updated.metrics)) - mergedGossip.nodeMetricsFor(m3.address).map(_.metrics) should be(Some(m3.metrics)) + mergedGossip.nodes.map(_.address) should ===(Set(m1.address, m2.address, m3.address)) + mergedGossip.nodeMetricsFor(m1.address).map(_.metrics) should ===(Some(m1.metrics)) + mergedGossip.nodeMetricsFor(m2.address).map(_.metrics) should ===(Some(m2Updated.metrics)) + mergedGossip.nodeMetricsFor(m3.address).map(_.metrics) should ===(Some(m3.metrics)) mergedGossip.nodes.foreach(_.metrics.size should be > (3)) - mergedGossip.nodeMetricsFor(m2.address).map(_.timestamp) should be(Some(m2Updated.timestamp)) + mergedGossip.nodeMetricsFor(m2.address).map(_.timestamp) should ===(Some(m2Updated.timestamp)) } "get the current NodeMetrics if it exists in the local nodes" in { val m1 = NodeMetrics(Address("akka.tcp", "sys", "a", 2554), newTimestamp, collector.sample.metrics) val g1 = MetricsGossip.empty :+ m1 - g1.nodeMetricsFor(m1.address).map(_.metrics) should be(Some(m1.metrics)) + g1.nodeMetricsFor(m1.address).map(_.metrics) should ===(Some(m1.metrics)) } "remove a node if it is no longer Up" in { @@ -84,12 +84,12 @@ class MetricsGossipSpec extends AkkaSpec(MetricsEnabledSpec.config) with Implici val m2 = NodeMetrics(Address("akka.tcp", "sys", "a", 2555), newTimestamp, collector.sample.metrics) val g1 = MetricsGossip.empty :+ m1 :+ m2 - g1.nodes.size should be(2) + g1.nodes.size should ===(2) val g2 = g1 remove m1.address - g2.nodes.size should be(1) - g2.nodes.exists(_.address == m1.address) should be(false) - g2.nodeMetricsFor(m1.address) should be(None) - g2.nodeMetricsFor(m2.address).map(_.metrics) should be(Some(m2.metrics)) + g2.nodes.size should ===(1) + g2.nodes.exists(_.address == m1.address) should ===(false) + g2.nodeMetricsFor(m1.address) should ===(None) + g2.nodeMetricsFor(m2.address).map(_.metrics) should ===(Some(m2.metrics)) } "filter nodes" in { @@ -97,12 +97,12 @@ class MetricsGossipSpec extends AkkaSpec(MetricsEnabledSpec.config) with Implici val m2 = NodeMetrics(Address("akka.tcp", "sys", "a", 2555), newTimestamp, collector.sample.metrics) val g1 = MetricsGossip.empty :+ m1 :+ m2 - g1.nodes.size should be(2) + g1.nodes.size should ===(2) val g2 = g1 filter Set(m2.address) - g2.nodes.size should be(1) - g2.nodes.exists(_.address == m1.address) should be(false) - g2.nodeMetricsFor(m1.address) should be(None) - g2.nodeMetricsFor(m2.address).map(_.metrics) should be(Some(m2.metrics)) + g2.nodes.size should ===(1) + g2.nodes.exists(_.address == m1.address) should ===(false) + g2.nodeMetricsFor(m1.address) should ===(None) + g2.nodeMetricsFor(m2.address).map(_.metrics) should ===(Some(m2.metrics)) } } } diff --git a/akka-cluster/src/test/scala/akka/cluster/NodeMetricsSpec.scala b/akka-cluster/src/test/scala/akka/cluster/NodeMetricsSpec.scala index 9f4b5efe55..c2d7616f91 100644 --- a/akka-cluster/src/test/scala/akka/cluster/NodeMetricsSpec.scala +++ b/akka-cluster/src/test/scala/akka/cluster/NodeMetricsSpec.scala @@ -19,11 +19,11 @@ class NodeMetricsSpec extends WordSpec with Matchers { "NodeMetrics must" must { "return correct result for 2 'same' nodes" in { - (NodeMetrics(node1, 0) sameAs NodeMetrics(node1, 0)) should be(true) + (NodeMetrics(node1, 0) sameAs NodeMetrics(node1, 0)) should ===(true) } "return correct result for 2 not 'same' nodes" in { - (NodeMetrics(node1, 0) sameAs NodeMetrics(node2, 0)) should be(false) + (NodeMetrics(node1, 0) sameAs NodeMetrics(node2, 0)) should ===(false) } "merge 2 NodeMetrics by most recent" in { @@ -31,10 +31,10 @@ class NodeMetricsSpec extends WordSpec with Matchers { val sample2 = NodeMetrics(node1, 2, Set(Metric.create("a", 11, None), Metric.create("c", 30, None)).flatten) val merged = sample1 merge sample2 - merged.timestamp should be(sample2.timestamp) - merged.metric("a").map(_.value) should be(Some(11)) - merged.metric("b").map(_.value) should be(Some(20)) - merged.metric("c").map(_.value) should be(Some(30)) + merged.timestamp should ===(sample2.timestamp) + merged.metric("a").map(_.value) should ===(Some(11)) + merged.metric("b").map(_.value) should ===(Some(20)) + merged.metric("c").map(_.value) should ===(Some(30)) } "not merge 2 NodeMetrics if master is more recent" in { @@ -42,8 +42,8 @@ class NodeMetricsSpec extends WordSpec with Matchers { val sample2 = NodeMetrics(node1, 0, Set(Metric.create("a", 11, None), Metric.create("c", 30, None)).flatten) val merged = sample1 merge sample2 // older and not same - merged.timestamp should be(sample1.timestamp) - merged.metrics should be(sample1.metrics) + merged.timestamp should ===(sample1.timestamp) + merged.metrics should ===(sample1.metrics) } } } diff --git a/akka-cluster/src/test/scala/akka/cluster/ReachabilityPerfSpec.scala b/akka-cluster/src/test/scala/akka/cluster/ReachabilityPerfSpec.scala index ae5f6c439e..3a9a9c3f7a 100644 --- a/akka-cluster/src/test/scala/akka/cluster/ReachabilityPerfSpec.scala +++ b/akka-cluster/src/test/scala/akka/cluster/ReachabilityPerfSpec.scala @@ -52,27 +52,27 @@ class ReachabilityPerfSpec extends WordSpec with Matchers { } private def merge(expectedRecords: Int)(r1: Reachability, r2: Reachability): Unit = { - r1.merge(allowed, r2).records.size should be(expectedRecords) + r1.merge(allowed, r2).records.size should ===(expectedRecords) } private def checkStatus(r1: Reachability): Unit = { val record = r1.records.head - r1.status(record.observer, record.subject) should be(record.status) + r1.status(record.observer, record.subject) should ===(record.status) } private def checkAggregatedStatus(r1: Reachability): Unit = { val record = r1.records.head - r1.status(record.subject) should be(record.status) + r1.status(record.subject) should ===(record.status) } private def allUnreachableOrTerminated(r1: Reachability): Unit = { val record = r1.records.head - r1.allUnreachableOrTerminated.isEmpty should be(false) + r1.allUnreachableOrTerminated.isEmpty should ===(false) } private def allUnreachable(r1: Reachability): Unit = { val record = r1.records.head - r1.allUnreachable.isEmpty should be(false) + r1.allUnreachable.isEmpty should ===(false) } private def recordsFrom(r1: Reachability): Unit = { diff --git a/akka-cluster/src/test/scala/akka/cluster/ReachabilitySpec.scala b/akka-cluster/src/test/scala/akka/cluster/ReachabilitySpec.scala index 8b10f8fe61..8729e9987d 100644 --- a/akka-cluster/src/test/scala/akka/cluster/ReachabilitySpec.scala +++ b/akka-cluster/src/test/scala/akka/cluster/ReachabilitySpec.scala @@ -23,22 +23,22 @@ class ReachabilitySpec extends WordSpec with Matchers { "be reachable when empty" in { val r = Reachability.empty - r.isReachable(nodeA) should be(true) - r.allUnreachable should be(Set.empty) + r.isReachable(nodeA) should ===(true) + r.allUnreachable should ===(Set.empty) } "be unreachable when one observed unreachable" in { val r = Reachability.empty.unreachable(nodeB, nodeA) - r.isReachable(nodeA) should be(false) - r.allUnreachable should be(Set(nodeA)) + r.isReachable(nodeA) should ===(false) + r.allUnreachable should ===(Set(nodeA)) } "not be reachable when terminated" in { val r = Reachability.empty.terminated(nodeB, nodeA) - r.isReachable(nodeA) should be(false) + r.isReachable(nodeA) should ===(false) // allUnreachable doesn't include terminated - r.allUnreachable should be(Set.empty) - r.allUnreachableOrTerminated should be(Set(nodeA)) + r.allUnreachable should ===(Set.empty) + r.allUnreachableOrTerminated should ===(Set(nodeA)) } "not change terminated entry" in { @@ -54,14 +54,14 @@ class ReachabilitySpec extends WordSpec with Matchers { "be unreachable when some observed unreachable and others reachable" in { val r = Reachability.empty.unreachable(nodeB, nodeA).unreachable(nodeC, nodeA).reachable(nodeD, nodeA) - r.isReachable(nodeA) should be(false) + r.isReachable(nodeA) should ===(false) } "be reachable when all observed reachable again" in { val r = Reachability.empty.unreachable(nodeB, nodeA).unreachable(nodeC, nodeA). reachable(nodeB, nodeA).reachable(nodeC, nodeA). unreachable(nodeB, nodeC).unreachable(nodeC, nodeB) - r.isReachable(nodeA) should be(true) + r.isReachable(nodeA) should ===(true) } "exclude observations from specific (downed) nodes" in { @@ -70,11 +70,11 @@ class ReachabilitySpec extends WordSpec with Matchers { unreachable(nodeC, nodeB). unreachable(nodeB, nodeA).unreachable(nodeB, nodeC) - r.isReachable(nodeA) should be(false) - r.isReachable(nodeB) should be(false) - r.isReachable(nodeC) should be(false) - r.allUnreachableOrTerminated should be(Set(nodeA, nodeB, nodeC)) - r.removeObservers(Set(nodeB)).allUnreachableOrTerminated should be(Set(nodeB)) + r.isReachable(nodeA) should ===(false) + r.isReachable(nodeB) should ===(false) + r.isReachable(nodeC) should ===(false) + r.allUnreachableOrTerminated should ===(Set(nodeA, nodeB, nodeC)) + r.removeObservers(Set(nodeB)).allUnreachableOrTerminated should ===(Set(nodeB)) } "be pruned when all records of an observer are Reachable" in { @@ -82,12 +82,12 @@ class ReachabilitySpec extends WordSpec with Matchers { unreachable(nodeB, nodeA).unreachable(nodeB, nodeC). unreachable(nodeD, nodeC). reachable(nodeB, nodeA).reachable(nodeB, nodeC) - r.isReachable(nodeA) should be(true) - r.isReachable(nodeC) should be(false) - r.records should be(Vector(Record(nodeD, nodeC, Unreachable, 1L))) + r.isReachable(nodeA) should ===(true) + r.isReachable(nodeC) should ===(false) + r.records should ===(Vector(Record(nodeD, nodeC, Unreachable, 1L))) val r2 = r.unreachable(nodeB, nodeD).unreachable(nodeB, nodeE) - r2.records.toSet should be(Set( + r2.records.toSet should ===(Set( Record(nodeD, nodeC, Unreachable, 1L), Record(nodeB, nodeD, Unreachable, 5L), Record(nodeB, nodeE, Unreachable, 6L))) @@ -101,9 +101,9 @@ class ReachabilitySpec extends WordSpec with Matchers { Reachability.Record(nodeD, nodeB, Terminated, 4)) val versions = Map(nodeA -> 3L, nodeC -> 3L, nodeD -> 4L) val r = Reachability(records, versions) - r.status(nodeA) should be(Reachable) - r.status(nodeB) should be(Terminated) - r.status(nodeD) should be(Unreachable) + r.status(nodeA) should ===(Reachable) + r.status(nodeB) should ===(Terminated) + r.status(nodeD) should ===(Unreachable) } "have correct status for a mix of nodes" in { @@ -114,29 +114,29 @@ class ReachabilitySpec extends WordSpec with Matchers { reachable(nodeE, nodeD). unreachable(nodeA, nodeE).terminated(nodeB, nodeE) - r.status(nodeB, nodeA) should be(Unreachable) - r.status(nodeC, nodeA) should be(Unreachable) - r.status(nodeD, nodeA) should be(Unreachable) + r.status(nodeB, nodeA) should ===(Unreachable) + r.status(nodeC, nodeA) should ===(Unreachable) + r.status(nodeD, nodeA) should ===(Unreachable) - r.status(nodeC, nodeB) should be(Reachable) - r.status(nodeD, nodeB) should be(Unreachable) + r.status(nodeC, nodeB) should ===(Reachable) + r.status(nodeD, nodeB) should ===(Unreachable) - r.status(nodeA, nodeE) should be(Unreachable) - r.status(nodeB, nodeE) should be(Terminated) + r.status(nodeA, nodeE) should ===(Unreachable) + r.status(nodeB, nodeE) should ===(Terminated) - r.isReachable(nodeA) should be(false) - r.isReachable(nodeB) should be(false) - r.isReachable(nodeC) should be(true) - r.isReachable(nodeD) should be(true) - r.isReachable(nodeE) should be(false) + r.isReachable(nodeA) should ===(false) + r.isReachable(nodeB) should ===(false) + r.isReachable(nodeC) should ===(true) + r.isReachable(nodeD) should ===(true) + r.isReachable(nodeE) should ===(false) - r.allUnreachable should be(Set(nodeA, nodeB)) - r.allUnreachableFrom(nodeA) should be(Set(nodeE)) - r.allUnreachableFrom(nodeB) should be(Set(nodeA)) - r.allUnreachableFrom(nodeC) should be(Set(nodeA)) - r.allUnreachableFrom(nodeD) should be(Set(nodeA, nodeB)) + r.allUnreachable should ===(Set(nodeA, nodeB)) + r.allUnreachableFrom(nodeA) should ===(Set(nodeE)) + r.allUnreachableFrom(nodeB) should ===(Set(nodeA)) + r.allUnreachableFrom(nodeC) should ===(Set(nodeA)) + r.allUnreachableFrom(nodeD) should ===(Set(nodeA, nodeB)) - r.observersGroupedByUnreachable should be(Map( + r.observersGroupedByUnreachable should ===(Map( nodeA -> Set(nodeB, nodeC, nodeD), nodeB -> Set(nodeD), nodeE -> Set(nodeA))) @@ -147,18 +147,18 @@ class ReachabilitySpec extends WordSpec with Matchers { val r2 = r1.reachable(nodeB, nodeA).unreachable(nodeD, nodeE).unreachable(nodeC, nodeA) val merged = r1.merge(Set(nodeA, nodeB, nodeC, nodeD, nodeE), r2) - merged.status(nodeB, nodeA) should be(Reachable) - merged.status(nodeC, nodeA) should be(Unreachable) - merged.status(nodeC, nodeD) should be(Unreachable) - merged.status(nodeD, nodeE) should be(Unreachable) - merged.status(nodeE, nodeA) should be(Reachable) + merged.status(nodeB, nodeA) should ===(Reachable) + merged.status(nodeC, nodeA) should ===(Unreachable) + merged.status(nodeC, nodeD) should ===(Unreachable) + merged.status(nodeD, nodeE) should ===(Unreachable) + merged.status(nodeE, nodeA) should ===(Reachable) - merged.isReachable(nodeA) should be(false) - merged.isReachable(nodeD) should be(false) - merged.isReachable(nodeE) should be(false) + merged.isReachable(nodeA) should ===(false) + merged.isReachable(nodeD) should ===(false) + merged.isReachable(nodeE) should ===(false) val merged2 = r2.merge(Set(nodeA, nodeB, nodeC, nodeD, nodeE), r1) - merged2.records.toSet should be(merged.records.toSet) + merged2.records.toSet should ===(merged.records.toSet) } "merge by taking allowed set into account" in { @@ -168,21 +168,21 @@ class ReachabilitySpec extends WordSpec with Matchers { val allowed = Set(nodeA, nodeB, nodeC, nodeE) val merged = r1.merge(allowed, r2) - merged.status(nodeB, nodeA) should be(Reachable) - merged.status(nodeC, nodeA) should be(Unreachable) - merged.status(nodeC, nodeD) should be(Reachable) - merged.status(nodeD, nodeE) should be(Reachable) - merged.status(nodeE, nodeA) should be(Reachable) + merged.status(nodeB, nodeA) should ===(Reachable) + merged.status(nodeC, nodeA) should ===(Unreachable) + merged.status(nodeC, nodeD) should ===(Reachable) + merged.status(nodeD, nodeE) should ===(Reachable) + merged.status(nodeE, nodeA) should ===(Reachable) - merged.isReachable(nodeA) should be(false) - merged.isReachable(nodeD) should be(true) - merged.isReachable(nodeE) should be(true) + merged.isReachable(nodeA) should ===(false) + merged.isReachable(nodeD) should ===(true) + merged.isReachable(nodeE) should ===(true) - merged.versions.keySet should be(Set(nodeB, nodeC)) + merged.versions.keySet should ===(Set(nodeB, nodeC)) val merged2 = r2.merge(allowed, r1) - merged2.records.toSet should be(merged.records.toSet) - merged2.versions should be(merged.versions) + merged2.records.toSet should ===(merged.records.toSet) + merged2.versions should ===(merged.versions) } "merge correctly after pruning" in { @@ -191,12 +191,12 @@ class ReachabilitySpec extends WordSpec with Matchers { val r3 = r1.reachable(nodeB, nodeA) // nodeB pruned val merged = r2.merge(Set(nodeA, nodeB, nodeC, nodeD, nodeE), r3) - merged.records.toSet should be(Set( + merged.records.toSet should ===(Set( Record(nodeA, nodeE, Unreachable, 1), Record(nodeC, nodeD, Unreachable, 1))) val merged3 = r3.merge(Set(nodeA, nodeB, nodeC, nodeD, nodeE), r2) - merged3.records.toSet should be(merged.records.toSet) + merged3.records.toSet should ===(merged.records.toSet) } "merge versions correctly" in { @@ -205,10 +205,10 @@ class ReachabilitySpec extends WordSpec with Matchers { val merged = r1.merge(Set(nodeA, nodeB, nodeC, nodeD, nodeE), r2) val expected = Map(nodeA -> 6L, nodeB -> 5L, nodeC -> 7L, nodeD -> 1L) - merged.versions should be(expected) + merged.versions should ===(expected) val merged2 = r2.merge(Set(nodeA, nodeB, nodeC, nodeD, nodeE), r1) - merged2.versions should be(expected) + merged2.versions should ===(expected) } "remove node" in { @@ -219,10 +219,10 @@ class ReachabilitySpec extends WordSpec with Matchers { unreachable(nodeB, nodeE). remove(Set(nodeA, nodeB)) - r.status(nodeB, nodeA) should be(Reachable) - r.status(nodeC, nodeD) should be(Unreachable) - r.status(nodeB, nodeC) should be(Reachable) - r.status(nodeB, nodeE) should be(Reachable) + r.status(nodeB, nodeA) should ===(Reachable) + r.status(nodeC, nodeD) should ===(Unreachable) + r.status(nodeB, nodeC) should ===(Reachable) + r.status(nodeB, nodeE) should ===(Reachable) } } diff --git a/akka-cluster/src/test/scala/akka/cluster/SerializationChecksSpec.scala b/akka-cluster/src/test/scala/akka/cluster/SerializationChecksSpec.scala index a569624a88..e0e1fa6e1c 100644 --- a/akka-cluster/src/test/scala/akka/cluster/SerializationChecksSpec.scala +++ b/akka-cluster/src/test/scala/akka/cluster/SerializationChecksSpec.scala @@ -10,8 +10,8 @@ class SerializationChecksSpec extends AkkaSpec { "Settings serialize-messages and serialize-creators" must { "be on for tests" in { - system.settings.SerializeAllCreators should be(true) - system.settings.SerializeAllMessages should be(true) + system.settings.SerializeAllCreators should ===(true) + system.settings.SerializeAllMessages should ===(true) } } diff --git a/akka-cluster/src/test/scala/akka/cluster/SerializeCreatorsVerificationSpec.scala b/akka-cluster/src/test/scala/akka/cluster/SerializeCreatorsVerificationSpec.scala index 5e160dc3c6..522846bd74 100644 --- a/akka-cluster/src/test/scala/akka/cluster/SerializeCreatorsVerificationSpec.scala +++ b/akka-cluster/src/test/scala/akka/cluster/SerializeCreatorsVerificationSpec.scala @@ -9,7 +9,7 @@ import akka.testkit.AkkaSpec class SerializeCreatorsVerificationSpec extends AkkaSpec { "serialize-creators should be on" in { - system.settings.SerializeAllCreators should be(true) + system.settings.SerializeAllCreators should ===(true) } } \ No newline at end of file diff --git a/akka-cluster/src/test/scala/akka/cluster/VectorClockPerfSpec.scala b/akka-cluster/src/test/scala/akka/cluster/VectorClockPerfSpec.scala index 0a78ddd215..04f3e14df7 100644 --- a/akka-cluster/src/test/scala/akka/cluster/VectorClockPerfSpec.scala +++ b/akka-cluster/src/test/scala/akka/cluster/VectorClockPerfSpec.scala @@ -56,11 +56,11 @@ class VectorClockPerfSpec extends WordSpec with Matchers { } def compareTo(order: Ordering)(vc1: VectorClock, vc2: VectorClock): Unit = { - vc1 compareTo vc2 should be(order) + vc1 compareTo vc2 should ===(order) } def !==(vc1: VectorClock, vc2: VectorClock): Unit = { - vc1 == vc2 should be(false) + vc1 == vc2 should ===(false) } s"VectorClock comparisons of size $clockSize" must { diff --git a/akka-cluster/src/test/scala/akka/cluster/VectorClockSpec.scala b/akka-cluster/src/test/scala/akka/cluster/VectorClockSpec.scala index c0641cdcb8..5d035d2839 100644 --- a/akka-cluster/src/test/scala/akka/cluster/VectorClockSpec.scala +++ b/akka-cluster/src/test/scala/akka/cluster/VectorClockSpec.scala @@ -5,6 +5,7 @@ package akka.cluster import akka.testkit.AkkaSpec +import scala.collection.immutable.TreeMap class VectorClockSpec extends AkkaSpec { import VectorClock._ @@ -13,14 +14,14 @@ class VectorClockSpec extends AkkaSpec { "have zero versions when created" in { val clock = VectorClock() - clock.versions should be(Map()) + clock.versions should ===(TreeMap.empty[VectorClock.Node, Long]) } "not happen before itself" in { val clock1 = VectorClock() val clock2 = VectorClock() - clock1 <> clock2 should be(false) + clock1 <> clock2 should ===(false) } "pass misc comparison test 1" in { @@ -34,7 +35,7 @@ class VectorClockSpec extends AkkaSpec { val clock3_2 = clock2_2 :+ Node("2") val clock4_2 = clock3_2 :+ Node("1") - clock4_1 <> clock4_2 should be(false) + clock4_1 <> clock4_2 should ===(false) } "pass misc comparison test 2" in { @@ -49,7 +50,7 @@ class VectorClockSpec extends AkkaSpec { val clock4_2 = clock3_2 :+ Node("1") val clock5_2 = clock4_2 :+ Node("3") - clock4_1 < clock5_2 should be(true) + clock4_1 < clock5_2 should ===(true) } "pass misc comparison test 3" in { @@ -59,7 +60,7 @@ class VectorClockSpec extends AkkaSpec { val clock1_2 = VectorClock() val clock2_2 = clock1_2 :+ Node("2") - clock2_1 <> clock2_2 should be(true) + clock2_1 <> clock2_2 should ===(true) } "pass misc comparison test 4" in { @@ -73,7 +74,7 @@ class VectorClockSpec extends AkkaSpec { val clock3_4 = clock2_4 :+ Node("1") val clock4_4 = clock3_4 :+ Node("3") - clock4_3 <> clock4_4 should be(true) + clock4_3 <> clock4_4 should ===(true) } "pass misc comparison test 5" in { @@ -87,8 +88,8 @@ class VectorClockSpec extends AkkaSpec { val clock4_2 = clock3_2 :+ Node("2") val clock5_2 = clock4_2 :+ Node("3") - clock3_1 < clock5_2 should be(true) - clock5_2 > clock3_1 should be(true) + clock3_1 < clock5_2 should ===(true) + clock5_2 > clock3_1 should ===(true) } "pass misc comparison test 6" in { @@ -100,8 +101,8 @@ class VectorClockSpec extends AkkaSpec { val clock2_2 = clock1_2 :+ Node("1") val clock3_2 = clock2_2 :+ Node("1") - clock3_1 <> clock3_2 should be(true) - clock3_2 <> clock3_1 should be(true) + clock3_1 <> clock3_2 should ===(true) + clock3_2 <> clock3_1 should ===(true) } "pass misc comparison test 7" in { @@ -115,8 +116,8 @@ class VectorClockSpec extends AkkaSpec { val clock2_2 = clock1_2 :+ Node("2") val clock3_2 = clock2_2 :+ Node("2") - clock5_1 <> clock3_2 should be(true) - clock3_2 <> clock5_1 should be(true) + clock5_1 <> clock3_2 should ===(true) + clock3_2 <> clock5_1 should ===(true) } "pass misc comparison test 8" in { @@ -128,8 +129,8 @@ class VectorClockSpec extends AkkaSpec { val clock4_1 = clock3_1 :+ Node.fromHash("3") - clock4_1 <> clock1_2 should be(true) - clock1_2 <> clock4_1 should be(true) + clock4_1 <> clock1_2 should ===(true) + clock1_2 <> clock4_1 should ===(true) } "correctly merge two clocks" in { @@ -148,24 +149,24 @@ class VectorClockSpec extends AkkaSpec { val clock3_2 = clock2_2 :+ node2 val merged1 = clock3_2 merge clock5_1 - merged1.versions.size should be(3) - merged1.versions.contains(node1) should be(true) - merged1.versions.contains(node2) should be(true) - merged1.versions.contains(node3) should be(true) + merged1.versions.size should ===(3) + merged1.versions.contains(node1) should ===(true) + merged1.versions.contains(node2) should ===(true) + merged1.versions.contains(node3) should ===(true) val merged2 = clock5_1 merge clock3_2 - merged2.versions.size should be(3) - merged2.versions.contains(node1) should be(true) - merged2.versions.contains(node2) should be(true) - merged2.versions.contains(node3) should be(true) + merged2.versions.size should ===(3) + merged2.versions.contains(node1) should ===(true) + merged2.versions.contains(node2) should ===(true) + merged2.versions.contains(node3) should ===(true) - clock3_2 < merged1 should be(true) - clock5_1 < merged1 should be(true) + clock3_2 < merged1 should ===(true) + clock5_1 < merged1 should ===(true) - clock3_2 < merged2 should be(true) - clock5_1 < merged2 should be(true) + clock3_2 < merged2 should ===(true) + clock5_1 < merged2 should ===(true) - merged1 == merged2 should be(true) + merged1 == merged2 should ===(true) } "correctly merge two disjoint vector clocks" in { @@ -185,26 +186,26 @@ class VectorClockSpec extends AkkaSpec { val clock3_2 = clock2_2 :+ node4 val merged1 = clock3_2 merge clock5_1 - merged1.versions.size should be(4) - merged1.versions.contains(node1) should be(true) - merged1.versions.contains(node2) should be(true) - merged1.versions.contains(node3) should be(true) - merged1.versions.contains(node4) should be(true) + merged1.versions.size should ===(4) + merged1.versions.contains(node1) should ===(true) + merged1.versions.contains(node2) should ===(true) + merged1.versions.contains(node3) should ===(true) + merged1.versions.contains(node4) should ===(true) val merged2 = clock5_1 merge clock3_2 - merged2.versions.size should be(4) - merged2.versions.contains(node1) should be(true) - merged2.versions.contains(node2) should be(true) - merged2.versions.contains(node3) should be(true) - merged2.versions.contains(node4) should be(true) + merged2.versions.size should ===(4) + merged2.versions.contains(node1) should ===(true) + merged2.versions.contains(node2) should ===(true) + merged2.versions.contains(node3) should ===(true) + merged2.versions.contains(node4) should ===(true) - clock3_2 < merged1 should be(true) - clock5_1 < merged1 should be(true) + clock3_2 < merged1 should ===(true) + clock5_1 < merged1 should ===(true) - clock3_2 < merged2 should be(true) - clock5_1 < merged2 should be(true) + clock3_2 < merged2 should ===(true) + clock5_1 < merged2 should ===(true) - merged1 == merged2 should be(true) + merged1 == merged2 should ===(true) } "pass blank clock incrementing" in { @@ -217,14 +218,14 @@ class VectorClockSpec extends AkkaSpec { val vv1 = v1 :+ node1 val vv2 = v2 :+ node2 - (vv1 > v1) should be(true) - (vv2 > v2) should be(true) + (vv1 > v1) should ===(true) + (vv2 > v2) should ===(true) - (vv1 > v2) should be(true) - (vv2 > v1) should be(true) + (vv1 > v2) should ===(true) + (vv2 > v1) should ===(true) - (vv2 > vv1) should be(false) - (vv1 > vv2) should be(false) + (vv2 > vv1) should ===(false) + (vv1 > vv2) should ===(false) } "pass merging behavior" in { @@ -242,8 +243,8 @@ class VectorClockSpec extends AkkaSpec { var c = a2.merge(b1) var c1 = c :+ node3 - (c1 > a2) should be(true) - (c1 > b1) should be(true) + (c1 > a2) should ===(true) + (c1 > b1) should ===(true) } } } diff --git a/akka-cluster/src/test/scala/akka/cluster/protobuf/ClusterMessageSerializerSpec.scala b/akka-cluster/src/test/scala/akka/cluster/protobuf/ClusterMessageSerializerSpec.scala index ffb37f9322..074483f46d 100644 --- a/akka-cluster/src/test/scala/akka/cluster/protobuf/ClusterMessageSerializerSpec.scala +++ b/akka-cluster/src/test/scala/akka/cluster/protobuf/ClusterMessageSerializerSpec.scala @@ -23,11 +23,11 @@ class ClusterMessageSerializerSpec extends AkkaSpec( obj match { case env: GossipEnvelope ⇒ val env2 = obj.asInstanceOf[GossipEnvelope] - env2.from should be(env.from) - env2.to should be(env.to) - env2.gossip should be(env.gossip) + env2.from should ===(env.from) + env2.to should ===(env.to) + env2.gossip should ===(env.gossip) case _ ⇒ - ref should be(obj) + ref should ===(obj) } } diff --git a/akka-cluster/src/test/scala/akka/cluster/routing/MetricsSelectorSpec.scala b/akka-cluster/src/test/scala/akka/cluster/routing/MetricsSelectorSpec.scala index 4a8329804b..16a4edcd65 100644 --- a/akka-cluster/src/test/scala/akka/cluster/routing/MetricsSelectorSpec.scala +++ b/akka-cluster/src/test/scala/akka/cluster/routing/MetricsSelectorSpec.scala @@ -65,13 +65,13 @@ class MetricsSelectorSpec extends WordSpec with Matchers { "calculate weights from capacity" in { val capacity = Map(a1 -> 0.6, b1 -> 0.3, c1 -> 0.1) val weights = abstractSelector.weights(capacity) - weights should be(Map(c1 -> 1, b1 -> 3, a1 -> 6)) + weights should ===(Map(c1 -> 1, b1 -> 3, a1 -> 6)) } "handle low and zero capacity" in { val capacity = Map(a1 -> 0.0, b1 -> 1.0, c1 -> 0.005, d1 -> 0.004) val weights = abstractSelector.weights(capacity) - weights should be(Map(a1 -> 0, b1 -> 100, c1 -> 1, d1 -> 0)) + weights should ===(Map(a1 -> 0, b1 -> 100, c1 -> 1, d1 -> 0)) } } @@ -79,40 +79,40 @@ class MetricsSelectorSpec extends WordSpec with Matchers { "HeapMetricsSelector" must { "calculate capacity of heap metrics" in { val capacity = HeapMetricsSelector.capacity(nodeMetrics) - capacity(a1) should be(0.75 +- 0.0001) - capacity(b1) should be(0.75 +- 0.0001) - capacity(c1) should be(0.0 +- 0.0001) - capacity(d1) should be(0.001953125 +- 0.0001) + capacity(a1) should ===(0.75 +- 0.0001) + capacity(b1) should ===(0.75 +- 0.0001) + capacity(c1) should ===(0.0 +- 0.0001) + capacity(d1) should ===(0.001953125 +- 0.0001) } } "CpuMetricsSelector" must { "calculate capacity of cpuCombined metrics" in { val capacity = CpuMetricsSelector.capacity(nodeMetrics) - capacity(a1) should be(0.9 +- 0.0001) - capacity(b1) should be(0.5 +- 0.0001) - capacity(c1) should be(0.0 +- 0.0001) - capacity.contains(d1) should be(false) + capacity(a1) should ===(0.9 +- 0.0001) + capacity(b1) should ===(0.5 +- 0.0001) + capacity(c1) should ===(0.0 +- 0.0001) + capacity.contains(d1) should ===(false) } } "SystemLoadAverageMetricsSelector" must { "calculate capacity of systemLoadAverage metrics" in { val capacity = SystemLoadAverageMetricsSelector.capacity(nodeMetrics) - capacity(a1) should be(0.9375 +- 0.0001) - capacity(b1) should be(0.9375 +- 0.0001) - capacity(c1) should be(0.0 +- 0.0001) - capacity.contains(d1) should be(false) + capacity(a1) should ===(0.9375 +- 0.0001) + capacity(b1) should ===(0.9375 +- 0.0001) + capacity(c1) should ===(0.0 +- 0.0001) + capacity.contains(d1) should ===(false) } } "MixMetricsSelector" must { "aggregate capacity of all metrics" in { val capacity = MixMetricsSelector.capacity(nodeMetrics) - capacity(a1) should be((0.75 + 0.9 + 0.9375) / 3 +- 0.0001) - capacity(b1) should be((0.75 + 0.5 + 0.9375) / 3 +- 0.0001) - capacity(c1) should be((0.0 + 0.0 + 0.0) / 3 +- 0.0001) - capacity(d1) should be((0.001953125) / 1 +- 0.0001) + capacity(a1) should ===((0.75 + 0.9 + 0.9375) / 3 +- 0.0001) + capacity(b1) should ===((0.75 + 0.5 + 0.9375) / 3 +- 0.0001) + capacity(c1) should ===((0.0 + 0.0 + 0.0) / 3 +- 0.0001) + capacity(d1) should ===((0.001953125) / 1 +- 0.0001) } } diff --git a/akka-cluster/src/test/scala/akka/cluster/routing/WeightedRouteesSpec.scala b/akka-cluster/src/test/scala/akka/cluster/routing/WeightedRouteesSpec.scala index 9fb106a57a..570219efa0 100644 --- a/akka-cluster/src/test/scala/akka/cluster/routing/WeightedRouteesSpec.scala +++ b/akka-cluster/src/test/scala/akka/cluster/routing/WeightedRouteesSpec.scala @@ -34,21 +34,21 @@ class WeightedRouteesSpec extends AkkaSpec(ConfigFactory.parseString(""" val weights = Map(a1 -> 1, b1 -> 3, c1 -> 10) val weighted = new WeightedRoutees(routees, a1, weights) - weighted(1) should be(routeeA) - 2 to 4 foreach { weighted(_) should be(routeeB) } - 5 to 14 foreach { weighted(_) should be(routeeC) } - weighted.total should be(14) + weighted(1) should ===(routeeA) + 2 to 4 foreach { weighted(_) should ===(routeeB) } + 5 to 14 foreach { weighted(_) should ===(routeeC) } + weighted.total should ===(14) } "check boundaries" in { val empty = new WeightedRoutees(Vector(), a1, Map.empty) - empty.isEmpty should be(true) + empty.isEmpty should ===(true) intercept[IllegalArgumentException] { empty.total } val empty2 = new WeightedRoutees(Vector(routeeA), a1, Map(a1 -> 0)) - empty2.isEmpty should be(true) + empty2.isEmpty should ===(true) intercept[IllegalArgumentException] { empty2.total } @@ -57,7 +57,7 @@ class WeightedRouteesSpec extends AkkaSpec(ConfigFactory.parseString(""" } val weighted = new WeightedRoutees(routees, a1, Map.empty) - weighted.total should be(3) + weighted.total should ===(3) intercept[IllegalArgumentException] { weighted(0) } @@ -70,11 +70,11 @@ class WeightedRouteesSpec extends AkkaSpec(ConfigFactory.parseString(""" val weights = Map(a1 -> 1, b1 -> 7) val weighted = new WeightedRoutees(routees, a1, weights) - weighted(1) should be(routeeA) - 2 to 8 foreach { weighted(_) should be(routeeB) } + weighted(1) should ===(routeeA) + 2 to 8 foreach { weighted(_) should ===(routeeB) } // undefined, uses the mean of the weights, i.e. 4 - 9 to 12 foreach { weighted(_) should be(routeeC) } - weighted.total should be(12) + 9 to 12 foreach { weighted(_) should ===(routeeC) } + weighted.total should ===(12) } "allocate weighted local routees" in { @@ -82,7 +82,7 @@ class WeightedRouteesSpec extends AkkaSpec(ConfigFactory.parseString(""" val routees2 = Vector(testActorRoutee, routeeB, routeeC) val weighted = new WeightedRoutees(routees2, a1, weights) - 1 to 2 foreach { weighted(_) should be(testActorRoutee) } + 1 to 2 foreach { weighted(_) should ===(testActorRoutee) } 3 to weighted.total foreach { weighted(_) should not be (testActorRoutee) } } diff --git a/akka-contrib/src/multi-jvm/scala/akka/contrib/pattern/ClusterClientSpec.scala b/akka-contrib/src/multi-jvm/scala/akka/contrib/pattern/ClusterClientSpec.scala index a60486723b..617f93d108 100644 --- a/akka-contrib/src/multi-jvm/scala/akka/contrib/pattern/ClusterClientSpec.scala +++ b/akka-contrib/src/multi-jvm/scala/akka/contrib/pattern/ClusterClientSpec.scala @@ -72,7 +72,7 @@ class ClusterClientSpec extends MultiNodeSpec(ClusterClientSpec) with STMultiNod def awaitCount(expected: Int): Unit = { awaitAssert { DistributedPubSubExtension(system).mediator ! DistributedPubSubMediator.Count - expectMsgType[Int] should be(expected) + expectMsgType[Int] should ===(expected) } } @@ -145,7 +145,7 @@ class ClusterClientSpec extends MultiNodeSpec(ClusterClientSpec) with STMultiNod runOn(client) { // note that "hi" was sent to 2 "serviceB" - receiveN(3).toSet should be(Set("hello", "hi")) + receiveN(3).toSet should ===(Set("hello", "hi")) } { //not used, only demo diff --git a/akka-contrib/src/multi-jvm/scala/akka/contrib/pattern/ClusterShardingSpec.scala b/akka-contrib/src/multi-jvm/scala/akka/contrib/pattern/ClusterShardingSpec.scala index 178ce21929..7a6ce4e75d 100644 --- a/akka-contrib/src/multi-jvm/scala/akka/contrib/pattern/ClusterShardingSpec.scala +++ b/akka-contrib/src/multi-jvm/scala/akka/contrib/pattern/ClusterShardingSpec.scala @@ -280,22 +280,22 @@ class ClusterShardingSpec extends MultiNodeSpec(ClusterShardingSpec) with STMult region ! EntryEnvelope(2, Increment) region ! Get(2) expectMsg(3) - lastSender.path should be(node(second) / "user" / "counterRegion" / "2" / "2") + lastSender.path should ===(node(second) / "user" / "counterRegion" / "2" / "2") region ! Get(11) expectMsg(1) // local on first - lastSender.path should be(region.path / "11" / "11") + lastSender.path should ===(region.path / "11" / "11") region ! Get(12) expectMsg(1) - lastSender.path should be(node(second) / "user" / "counterRegion" / "0" / "12") + lastSender.path should ===(node(second) / "user" / "counterRegion" / "0" / "12") } enterBarrier("first-update") runOn(second) { region ! Get(2) expectMsg(3) - lastSender.path should be(region.path / "2" / "2") + lastSender.path should ===(region.path / "2" / "2") } enterBarrier("after-3") @@ -332,7 +332,7 @@ class ClusterShardingSpec extends MultiNodeSpec(ClusterShardingSpec) with STMult within(1.second) { region.tell(Get(2), probe1.ref) probe1.expectMsg(4) - probe1.lastSender.path should be(region.path / "2" / "2") + probe1.lastSender.path should ===(region.path / "2" / "2") } } val probe2 = TestProbe() @@ -340,7 +340,7 @@ class ClusterShardingSpec extends MultiNodeSpec(ClusterShardingSpec) with STMult within(1.second) { region.tell(Get(12), probe2.ref) probe2.expectMsg(1) - probe2.lastSender.path should be(region.path / "0" / "12") + probe2.lastSender.path should ===(region.path / "0" / "12") } } } @@ -357,7 +357,7 @@ class ClusterShardingSpec extends MultiNodeSpec(ClusterShardingSpec) with STMult region ! EntryEnvelope(3, Increment) region ! Get(3) expectMsg(10) - lastSender.path should be(region.path / "3" / "3") // local + lastSender.path should ===(region.path / "3" / "3") // local } enterBarrier("third-update") @@ -366,7 +366,7 @@ class ClusterShardingSpec extends MultiNodeSpec(ClusterShardingSpec) with STMult region ! EntryEnvelope(4, Increment) region ! Get(4) expectMsg(20) - lastSender.path should be(region.path / "4" / "4") // local + lastSender.path should ===(region.path / "4" / "4") // local } enterBarrier("fourth-update") @@ -374,25 +374,25 @@ class ClusterShardingSpec extends MultiNodeSpec(ClusterShardingSpec) with STMult region ! EntryEnvelope(3, Increment) region ! Get(3) expectMsg(11) - lastSender.path should be(node(third) / "user" / "counterRegion" / "3" / "3") + lastSender.path should ===(node(third) / "user" / "counterRegion" / "3" / "3") region ! EntryEnvelope(4, Increment) region ! Get(4) expectMsg(21) - lastSender.path should be(node(fourth) / "user" / "counterRegion" / "4" / "4") + lastSender.path should ===(node(fourth) / "user" / "counterRegion" / "4" / "4") } enterBarrier("first-update") runOn(third) { region ! Get(3) expectMsg(11) - lastSender.path should be(region.path / "3" / "3") + lastSender.path should ===(region.path / "3" / "3") } runOn(fourth) { region ! Get(4) expectMsg(21) - lastSender.path should be(region.path / "4" / "4") + lastSender.path should ===(region.path / "4" / "4") } enterBarrier("after-6") @@ -412,7 +412,7 @@ class ClusterShardingSpec extends MultiNodeSpec(ClusterShardingSpec) with STMult within(1.second) { region.tell(Get(3), probe3.ref) probe3.expectMsg(11) - probe3.lastSender.path should be(node(third) / "user" / "counterRegion" / "3" / "3") + probe3.lastSender.path should ===(node(third) / "user" / "counterRegion" / "3" / "3") } } val probe4 = TestProbe() @@ -420,7 +420,7 @@ class ClusterShardingSpec extends MultiNodeSpec(ClusterShardingSpec) with STMult within(1.second) { region.tell(Get(4), probe4.ref) probe4.expectMsg(21) - probe4.lastSender.path should be(node(fourth) / "user" / "counterRegion" / "4" / "4") + probe4.lastSender.path should ===(node(fourth) / "user" / "counterRegion" / "4" / "4") } } @@ -636,7 +636,7 @@ class ClusterShardingSpec extends MultiNodeSpec(ClusterShardingSpec) with STMult val counter13 = lastSender - counter1.path.parent should be(counter13.path.parent) + counter1.path.parent should ===(counter13.path.parent) //Send the shard the passivate message from the counter watch(counter1) @@ -726,7 +726,7 @@ class ClusterShardingSpec extends MultiNodeSpec(ClusterShardingSpec) with STMult autoMigrateRegion ! Get(1) expectMsg(2) - lastSender.path should be(node(third) / "user" / "AutoMigrateRegionTestRegion" / "1" / "1") + lastSender.path should ===(node(third) / "user" / "AutoMigrateRegionTestRegion" / "1" / "1") //Kill region 3 system.actorSelection(lastSender.path.parent.parent) ! PoisonPill diff --git a/akka-contrib/src/multi-jvm/scala/akka/contrib/pattern/ClusterSingletonManagerChaosSpec.scala b/akka-contrib/src/multi-jvm/scala/akka/contrib/pattern/ClusterSingletonManagerChaosSpec.scala index 515c509ac4..10cec8a784 100644 --- a/akka-contrib/src/multi-jvm/scala/akka/contrib/pattern/ClusterSingletonManagerChaosSpec.scala +++ b/akka-contrib/src/multi-jvm/scala/akka/contrib/pattern/ClusterSingletonManagerChaosSpec.scala @@ -99,10 +99,10 @@ class ClusterSingletonManagerChaosSpec extends MultiNodeSpec(ClusterSingletonMan def awaitMemberUp(memberProbe: TestProbe, nodes: RoleName*): Unit = { runOn(nodes.filterNot(_ == nodes.head): _*) { - memberProbe.expectMsgType[MemberUp](15.seconds).member.address should be(node(nodes.head).address) + memberProbe.expectMsgType[MemberUp](15.seconds).member.address should ===(node(nodes.head).address) } runOn(nodes.head) { - memberProbe.receiveN(nodes.size, 15.seconds).collect { case MemberUp(m) ⇒ m.address }.toSet should be( + memberProbe.receiveN(nodes.size, 15.seconds).collect { case MemberUp(m) ⇒ m.address }.toSet should ===( nodes.map(node(_).address).toSet) } enterBarrier(nodes.head.name + "-up") @@ -139,7 +139,7 @@ class ClusterSingletonManagerChaosSpec extends MultiNodeSpec(ClusterSingletonMan runOn(controller) { echo(first) ! "hello" - expectMsgType[ActorRef](3.seconds).path.address should be(node(first).address) + expectMsgType[ActorRef](3.seconds).path.address should ===(node(first).address) } enterBarrier("first-verified") @@ -160,7 +160,7 @@ class ClusterSingletonManagerChaosSpec extends MultiNodeSpec(ClusterSingletonMan runOn(controller) { echo(fourth) ! "hello" - expectMsgType[ActorRef](3.seconds).path.address should be(node(fourth).address) + expectMsgType[ActorRef](3.seconds).path.address should ===(node(fourth).address) } enterBarrier("fourth-verified") diff --git a/akka-contrib/src/multi-jvm/scala/akka/contrib/pattern/ClusterSingletonManagerSpec.scala b/akka-contrib/src/multi-jvm/scala/akka/contrib/pattern/ClusterSingletonManagerSpec.scala index bf4eb63e87..02312846b1 100644 --- a/akka-contrib/src/multi-jvm/scala/akka/contrib/pattern/ClusterSingletonManagerSpec.scala +++ b/akka-contrib/src/multi-jvm/scala/akka/contrib/pattern/ClusterSingletonManagerSpec.scala @@ -246,10 +246,10 @@ class ClusterSingletonManagerSpec extends MultiNodeSpec(ClusterSingletonManagerS def awaitMemberUp(memberProbe: TestProbe, nodes: RoleName*): Unit = { runOn(nodes.filterNot(_ == nodes.head): _*) { - memberProbe.expectMsgType[MemberUp](15.seconds).member.address should be(node(nodes.head).address) + memberProbe.expectMsgType[MemberUp](15.seconds).member.address should ===(node(nodes.head).address) } runOn(nodes.head) { - memberProbe.receiveN(nodes.size, 15.seconds).collect { case MemberUp(m) ⇒ m.address }.toSet should be( + memberProbe.receiveN(nodes.size, 15.seconds).collect { case MemberUp(m) ⇒ m.address }.toSet should ===( nodes.map(node(_).address).toSet) } enterBarrier(nodes.head.name + "-up") diff --git a/akka-contrib/src/multi-jvm/scala/akka/contrib/pattern/DistributedPubSubMediatorSpec.scala b/akka-contrib/src/multi-jvm/scala/akka/contrib/pattern/DistributedPubSubMediatorSpec.scala index b941ac94ac..929279d6e3 100644 --- a/akka-contrib/src/multi-jvm/scala/akka/contrib/pattern/DistributedPubSubMediatorSpec.scala +++ b/akka-contrib/src/multi-jvm/scala/akka/contrib/pattern/DistributedPubSubMediatorSpec.scala @@ -130,7 +130,7 @@ class DistributedPubSubMediatorSpec extends MultiNodeSpec(DistributedPubSubMedia def awaitCount(expected: Int): Unit = { awaitAssert { mediator ! Count - expectMsgType[Int] should be(expected) + expectMsgType[Int] should ===(expected) } } @@ -155,7 +155,7 @@ class DistributedPubSubMediatorSpec extends MultiNodeSpec(DistributedPubSubMedia // send to actor at same node u1 ! Whisper("/user/u2", "hello") expectMsg("hello") - lastSender should be(u2) + lastSender should ===(u2) } runOn(second) { @@ -185,7 +185,7 @@ class DistributedPubSubMediatorSpec extends MultiNodeSpec(DistributedPubSubMedia runOn(second) { expectMsg("hi there") - lastSender.path.name should be("u4") + lastSender.path.name should ===("u4") } enterBarrier("after-2") @@ -208,7 +208,7 @@ class DistributedPubSubMediatorSpec extends MultiNodeSpec(DistributedPubSubMedia runOn(second) { expectMsg("go") - lastSender.path.name should be("u4") + lastSender.path.name should ===("u4") } enterBarrier("after-3") @@ -253,7 +253,7 @@ class DistributedPubSubMediatorSpec extends MultiNodeSpec(DistributedPubSubMedia runOn(first, second) { expectMsg("hi") - lastSender.path.name should be("u7") + lastSender.path.name should ===("u7") } runOn(third) { expectNoMsg(2.seconds) @@ -288,11 +288,11 @@ class DistributedPubSubMediatorSpec extends MultiNodeSpec(DistributedPubSubMedia val names = receiveWhile(messages = 2) { case "hello all" ⇒ lastSender.path.name } - names.toSet should be(Set("u8", "u9")) + names.toSet should ===(Set("u8", "u9")) } runOn(second) { expectMsg("hello all") - lastSender.path.name should be("u10") + lastSender.path.name should ===("u10") } runOn(third) { expectNoMsg(2.seconds) @@ -342,7 +342,7 @@ class DistributedPubSubMediatorSpec extends MultiNodeSpec(DistributedPubSubMedia runOn(first, second) { expectMsg("hi") - lastSender.path.name should be("u11") + lastSender.path.name should ===("u11") } runOn(third) { expectNoMsg(2.seconds) // sender() node should not receive a message @@ -405,10 +405,10 @@ class DistributedPubSubMediatorSpec extends MultiNodeSpec(DistributedPubSubMedia runOn(first) { mediator ! Status(versions = Map.empty) val deltaBuckets = expectMsgType[Delta].buckets - deltaBuckets.size should be(3) - deltaBuckets.find(_.owner == firstAddress).get.content.size should be(9) - deltaBuckets.find(_.owner == secondAddress).get.content.size should be(8) - deltaBuckets.find(_.owner == thirdAddress).get.content.size should be(2) + deltaBuckets.size should ===(3) + deltaBuckets.find(_.owner == firstAddress).get.content.size should ===(9) + deltaBuckets.find(_.owner == secondAddress).get.content.size should ===(8) + deltaBuckets.find(_.owner == thirdAddress).get.content.size should ===(2) } enterBarrier("verified-initial-delta") @@ -420,16 +420,16 @@ class DistributedPubSubMediatorSpec extends MultiNodeSpec(DistributedPubSubMedia mediator ! Status(versions = Map.empty) val deltaBuckets1 = expectMsgType[Delta].buckets - deltaBuckets1.map(_.content.size).sum should be(500) + deltaBuckets1.map(_.content.size).sum should ===(500) mediator ! Status(versions = deltaBuckets1.map(b ⇒ b.owner -> b.version).toMap) val deltaBuckets2 = expectMsgType[Delta].buckets - deltaBuckets1.map(_.content.size).sum should be(500) + deltaBuckets1.map(_.content.size).sum should ===(500) mediator ! Status(versions = deltaBuckets2.map(b ⇒ b.owner -> b.version).toMap) val deltaBuckets3 = expectMsgType[Delta].buckets - deltaBuckets3.map(_.content.size).sum should be(9 + 8 + 2 + many - 500 - 500) + deltaBuckets3.map(_.content.size).sum should ===(9 + 8 + 2 + many - 500 - 500) } enterBarrier("verified-delta-with-many") diff --git a/akka-contrib/src/multi-jvm/scala/akka/contrib/pattern/ReliableProxySpec.scala b/akka-contrib/src/multi-jvm/scala/akka/contrib/pattern/ReliableProxySpec.scala index 08351a145c..1864604495 100644 --- a/akka-contrib/src/multi-jvm/scala/akka/contrib/pattern/ReliableProxySpec.scala +++ b/akka-contrib/src/multi-jvm/scala/akka/contrib/pattern/ReliableProxySpec.scala @@ -69,7 +69,7 @@ class ReliableProxySpec extends MultiNodeSpec(ReliableProxySpec) with STMultiNod def expectTransition(max: FiniteDuration, s1: State, s2: State) = expectMsg(max, FSM.Transition(proxy, s1, s2)) def sendN(n: Int) = (1 to n) foreach (proxy ! _) - def expectN(n: Int) = (1 to n) foreach { n ⇒ expectMsg(n); lastSender should be(target) } + def expectN(n: Int) = (1 to n) foreach { n ⇒ expectMsg(n); lastSender should ===(target) } // avoid too long timeout for expectNoMsg when using dilated timeouts, because // blackhole will trigger failure detection diff --git a/akka-contrib/src/test/scala/akka/contrib/jul/JavaLoggerSpec.scala b/akka-contrib/src/test/scala/akka/contrib/jul/JavaLoggerSpec.scala index 10b7ccbbde..0cddf36af9 100644 --- a/akka-contrib/src/test/scala/akka/contrib/jul/JavaLoggerSpec.scala +++ b/akka-contrib/src/test/scala/akka/contrib/jul/JavaLoggerSpec.scala @@ -53,11 +53,11 @@ class JavaLoggerSpec extends AkkaSpec(JavaLoggerSpec.config) { record should not be (null) record.getMillis should not be (0) record.getThreadID should not be (0) - record.getLevel should be(logging.Level.SEVERE) - record.getMessage should be("Simulated error") - record.getThrown.isInstanceOf[RuntimeException] should be(true) - record.getSourceClassName should be(classOf[JavaLoggerSpec.LogProducer].getName) - record.getSourceMethodName should be(null) + record.getLevel should ===(logging.Level.SEVERE) + record.getMessage should ===("Simulated error") + record.getThrown.isInstanceOf[RuntimeException] should ===(true) + record.getSourceClassName should ===(classOf[JavaLoggerSpec.LogProducer].getName) + record.getSourceMethodName should ===(null) } "log info without stackTrace" in { @@ -68,11 +68,11 @@ class JavaLoggerSpec extends AkkaSpec(JavaLoggerSpec.config) { record should not be (null) record.getMillis should not be (0) record.getThreadID should not be (0) - record.getLevel should be(logging.Level.INFO) - record.getMessage should be("3 is the magic number") - record.getThrown should be(null) - record.getSourceClassName should be(classOf[JavaLoggerSpec.LogProducer].getName) - record.getSourceMethodName should be(null) + record.getLevel should ===(logging.Level.INFO) + record.getMessage should ===("3 is the magic number") + record.getThrown should ===(null) + record.getSourceClassName should ===(classOf[JavaLoggerSpec.LogProducer].getName) + record.getSourceMethodName should ===(null) } } diff --git a/akka-contrib/src/test/scala/akka/contrib/mailbox/PeekMailboxSpec.scala b/akka-contrib/src/test/scala/akka/contrib/mailbox/PeekMailboxSpec.scala index d328ac1e86..ead27297b7 100644 --- a/akka-contrib/src/test/scala/akka/contrib/mailbox/PeekMailboxSpec.scala +++ b/akka-contrib/src/test/scala/akka/contrib/mailbox/PeekMailboxSpec.scala @@ -83,7 +83,7 @@ class PeekMailboxSpec extends AkkaSpec(""" a ! "DIE" // stays in the mailbox } expectMsg("DIE") - expectMsgType[DeadLetter].message should be("DIE") + expectMsgType[DeadLetter].message should ===("DIE") expectTerminated(a) } diff --git a/akka-contrib/src/test/scala/akka/contrib/pattern/LeastShardAllocationStrategySpec.scala b/akka-contrib/src/test/scala/akka/contrib/pattern/LeastShardAllocationStrategySpec.scala index c6282c1f31..bed1fa0ecb 100644 --- a/akka-contrib/src/test/scala/akka/contrib/pattern/LeastShardAllocationStrategySpec.scala +++ b/akka-contrib/src/test/scala/akka/contrib/pattern/LeastShardAllocationStrategySpec.scala @@ -18,30 +18,30 @@ class LeastShardAllocationStrategySpec extends AkkaSpec { "LeastShardAllocationStrategy" must { "allocate to region with least number of shards" in { val allocations = Map(regionA -> Vector("shard1"), regionB -> Vector("shard2"), regionC -> Vector.empty) - allocationStrategy.allocateShard(regionA, "shard3", allocations) should be(regionC) + allocationStrategy.allocateShard(regionA, "shard3", allocations) should ===(regionC) } "rebalance from region with most number of shards" in { val allocations = Map(regionA -> Vector("shard1"), regionB -> Vector("shard2", "shard3"), regionC -> Vector.empty) - // so far regionB has 2 shards and regionC has 0 shards, but the diff is less than rebalanceThreshold + // so far regionB has 2 shards and regionC has 0 shards, but the diff is less than rebalanceThreshold allocationStrategy.rebalance(allocations, Set.empty) should be(Set.empty) val allocations2 = allocations.updated(regionB, Vector("shard2", "shard3", "shard4")) - allocationStrategy.rebalance(allocations2, Set.empty) should be(Set("shard2")) + allocationStrategy.rebalance(allocations2, Set.empty) should ===(Set("shard2")) allocationStrategy.rebalance(allocations2, Set("shard4")) should be(Set.empty) val allocations3 = allocations2.updated(regionA, Vector("shard1", "shard5", "shard6")) - allocationStrategy.rebalance(allocations3, Set("shard1")) should be(Set("shard2")) + allocationStrategy.rebalance(allocations3, Set("shard1")) should ===(Set("shard2")) } "must limit number of simultanious rebalance" in { val allocations = Map(regionA -> Vector("shard1"), regionB -> Vector("shard2", "shard3", "shard4", "shard5", "shard6"), regionC -> Vector.empty) - allocationStrategy.rebalance(allocations, Set("shard2")) should be(Set("shard3")) + allocationStrategy.rebalance(allocations, Set("shard2")) should ===(Set("shard3")) allocationStrategy.rebalance(allocations, Set("shard2", "shard3")) should be(Set.empty) } } -} \ No newline at end of file +} diff --git a/akka-contrib/src/test/scala/akka/contrib/pattern/protobuf/DistributedPubSubMessageSerializerSpec.scala b/akka-contrib/src/test/scala/akka/contrib/pattern/protobuf/DistributedPubSubMessageSerializerSpec.scala index a690d5f7ca..7134129bb8 100644 --- a/akka-contrib/src/test/scala/akka/contrib/pattern/protobuf/DistributedPubSubMessageSerializerSpec.scala +++ b/akka-contrib/src/test/scala/akka/contrib/pattern/protobuf/DistributedPubSubMessageSerializerSpec.scala @@ -18,7 +18,7 @@ class DistributedPubSubMessageSerializerSpec extends AkkaSpec { def checkSerialization(obj: AnyRef): Unit = { val blob = serializer.toBinary(obj) val ref = serializer.fromBinary(blob, obj.getClass) - ref should be(obj) + ref should ===(obj) } " DistributedPubSubMessages" must { diff --git a/akka-persistence/src/test/scala/akka/persistence/AtLeastOnceDeliveryFailureSpec.scala b/akka-persistence/src/test/scala/akka/persistence/AtLeastOnceDeliveryFailureSpec.scala index 9322fc3e2b..b7e085e096 100644 --- a/akka-persistence/src/test/scala/akka/persistence/AtLeastOnceDeliveryFailureSpec.scala +++ b/akka-persistence/src/test/scala/akka/persistence/AtLeastOnceDeliveryFailureSpec.scala @@ -185,6 +185,6 @@ class AtLeastOnceDeliveryFailureSpec extends AkkaSpec(AtLeastOnceDeliveryFailure } def expectDone() = within(numMessages.seconds) { - expectMsgType[Done].ints.sorted should be(1 to numMessages toVector) + expectMsgType[Done].ints.sorted should ===(1 to numMessages toVector) } } diff --git a/akka-persistence/src/test/scala/akka/persistence/AtLeastOnceDeliverySpec.scala b/akka-persistence/src/test/scala/akka/persistence/AtLeastOnceDeliverySpec.scala index 29736a8fc6..b284d5ba78 100644 --- a/akka-persistence/src/test/scala/akka/persistence/AtLeastOnceDeliverySpec.scala +++ b/akka-persistence/src/test/scala/akka/persistence/AtLeastOnceDeliverySpec.scala @@ -306,7 +306,7 @@ abstract class AtLeastOnceDeliverySpec(config: Config) extends AkkaSpec(config) val unconfirmed = receiveWhile(3.seconds) { case UnconfirmedWarning(unconfirmed) ⇒ unconfirmed }.flatten - unconfirmed.map(_.destination).toSet should be(Set(probeA.ref.path, probeB.ref.path)) + unconfirmed.map(_.destination).toSet should ===(Set(probeA.ref.path, probeB.ref.path)) unconfirmed.map(_.message).toSet should be(Set(Action(1, "a-1"), Action(2, "b-1"), Action(3, "b-2"))) system.stop(snd) } @@ -334,9 +334,9 @@ abstract class AtLeastOnceDeliverySpec(config: Config) extends AkkaSpec(config) snd ! Req("c-" + n) } val deliverWithin = 20.seconds - probeA.receiveN(N, deliverWithin).map { case a: Action ⇒ a.payload }.toSet should be((1 to N).map(n ⇒ "a-" + n).toSet) - probeB.receiveN(N, deliverWithin).map { case a: Action ⇒ a.payload }.toSet should be((1 to N).map(n ⇒ "b-" + n).toSet) - probeC.receiveN(N, deliverWithin).map { case a: Action ⇒ a.payload }.toSet should be((1 to N).map(n ⇒ "c-" + n).toSet) + probeA.receiveN(N, deliverWithin).map { case a: Action ⇒ a.payload }.toSet should ===((1 to N).map(n ⇒ "a-" + n).toSet) + probeB.receiveN(N, deliverWithin).map { case a: Action ⇒ a.payload }.toSet should ===((1 to N).map(n ⇒ "b-" + n).toSet) + probeC.receiveN(N, deliverWithin).map { case a: Action ⇒ a.payload }.toSet should ===((1 to N).map(n ⇒ "c-" + n).toSet) } "limit the number of messages redelivered at once" in { @@ -363,7 +363,7 @@ abstract class AtLeastOnceDeliverySpec(config: Config) extends AkkaSpec(config) probeA.expectNoMsg(100.millis) } - toDeliver should be(Set.empty) + toDeliver should ===(Set.empty[Long]) } } } diff --git a/akka-persistence/src/test/scala/akka/persistence/PersistentActorFailureSpec.scala b/akka-persistence/src/test/scala/akka/persistence/PersistentActorFailureSpec.scala index 013fec0b45..9bb2376128 100644 --- a/akka-persistence/src/test/scala/akka/persistence/PersistentActorFailureSpec.scala +++ b/akka-persistence/src/test/scala/akka/persistence/PersistentActorFailureSpec.scala @@ -193,8 +193,8 @@ class PersistentActorFailureSpec extends AkkaSpec(PersistenceSpec.config("inmem" system.actorOf(Props(classOf[Supervisor], testActor)) ! Props(classOf[FailingRecovery], name, Some(probe.ref)) expectMsgType[ActorRef] val recoveryFailure = probe.expectMsgType[RecoveryFailure] - recoveryFailure.payload should be(Some(Evt("bad"))) - recoveryFailure.sequenceNr should be(Some(3L)) + recoveryFailure.payload should ===(Some(Evt("bad"))) + recoveryFailure.sequenceNr should ===(Some(3L)) } "continue by handling RecoveryFailure" in { prepareFailingRecovery() diff --git a/akka-persistence/src/test/scala/akka/persistence/SnapshotFailureRobustnessSpec.scala b/akka-persistence/src/test/scala/akka/persistence/SnapshotFailureRobustnessSpec.scala index 22cdb00695..f74163cf28 100644 --- a/akka-persistence/src/test/scala/akka/persistence/SnapshotFailureRobustnessSpec.scala +++ b/akka-persistence/src/test/scala/akka/persistence/SnapshotFailureRobustnessSpec.scala @@ -83,7 +83,7 @@ class SnapshotFailureRobustnessSpec extends AkkaSpec(PersistenceSpec.config("lev lPersistentActor ! Recover() expectMsgPF() { case (SnapshotMetadata(`persistenceId`, 1, timestamp), state) ⇒ - state should be("blahonga") + state should ===("blahonga") timestamp should be > (0L) } expectMsg("kablama-2") diff --git a/akka-persistence/src/test/scala/akka/persistence/SnapshotRecoveryLocalStoreSpec.scala b/akka-persistence/src/test/scala/akka/persistence/SnapshotRecoveryLocalStoreSpec.scala index 2536b3b38e..067bb9217a 100644 --- a/akka-persistence/src/test/scala/akka/persistence/SnapshotRecoveryLocalStoreSpec.scala +++ b/akka-persistence/src/test/scala/akka/persistence/SnapshotRecoveryLocalStoreSpec.scala @@ -57,7 +57,7 @@ class SnapshotRecoveryLocalStoreSpec extends AkkaSpec(PersistenceSpec.config("in expectMsgPF() { case (SnapshotMetadata(pid, seqNo, timestamp), state) ⇒ - pid should be(persistenceId) + pid should ===(persistenceId) } expectMsg(RecoveryCompleted) } diff --git a/akka-persistence/src/test/scala/akka/persistence/SnapshotSerializationSpec.scala b/akka-persistence/src/test/scala/akka/persistence/SnapshotSerializationSpec.scala index 73dfd6d891..5b2a970622 100644 --- a/akka-persistence/src/test/scala/akka/persistence/SnapshotSerializationSpec.scala +++ b/akka-persistence/src/test/scala/akka/persistence/SnapshotSerializationSpec.scala @@ -90,7 +90,7 @@ class SnapshotSerializationSpec extends AkkaSpec(PersistenceSpec.config("leveldb lPersistentActor ! Recover() expectMsgPF() { case (SnapshotMetadata(`persistenceId`, 0, timestamp), state) ⇒ - state should be(new MySnapshot("blahonga")) + state should ===(new MySnapshot("blahonga")) timestamp should be > (0L) } } diff --git a/akka-persistence/src/test/scala/akka/persistence/SnapshotSpec.scala b/akka-persistence/src/test/scala/akka/persistence/SnapshotSpec.scala index 7f6c096b98..07efd06eca 100644 --- a/akka-persistence/src/test/scala/akka/persistence/SnapshotSpec.scala +++ b/akka-persistence/src/test/scala/akka/persistence/SnapshotSpec.scala @@ -89,7 +89,7 @@ class SnapshotSpec extends AkkaSpec(PersistenceSpec.config("leveldb", "SnapshotS expectMsgPF() { case (SnapshotMetadata(`persistenceId`, 4, timestamp), state) ⇒ - state should be(List("a-1", "b-2", "c-3", "d-4").reverse) + state should ===(List("a-1", "b-2", "c-3", "d-4").reverse) timestamp should be > (0L) } expectMsg("e-5") @@ -104,7 +104,7 @@ class SnapshotSpec extends AkkaSpec(PersistenceSpec.config("leveldb", "SnapshotS expectMsgPF() { case (SnapshotMetadata(`persistenceId`, 2, timestamp), state) ⇒ - state should be(List("a-1", "b-2").reverse) + state should ===(List("a-1", "b-2").reverse) timestamp should be > (0L) } expectMsg("c-3") @@ -119,7 +119,7 @@ class SnapshotSpec extends AkkaSpec(PersistenceSpec.config("leveldb", "SnapshotS expectMsgPF() { case (SnapshotMetadata(`persistenceId`, 4, timestamp), state) ⇒ - state should be(List("a-1", "b-2", "c-3", "d-4").reverse) + state should ===(List("a-1", "b-2", "c-3", "d-4").reverse) timestamp should be > (0L) } expectMsg(RecoveryCompleted) @@ -133,7 +133,7 @@ class SnapshotSpec extends AkkaSpec(PersistenceSpec.config("leveldb", "SnapshotS expectMsgPF() { case (SnapshotMetadata(`persistenceId`, 2, timestamp), state) ⇒ - state should be(List("a-1", "b-2").reverse) + state should ===(List("a-1", "b-2").reverse) timestamp should be > (0L) } expectMsg("c-3") @@ -150,7 +150,7 @@ class SnapshotSpec extends AkkaSpec(PersistenceSpec.config("leveldb", "SnapshotS expectMsgPF() { case (SnapshotMetadata(`persistenceId`, 2, timestamp), state) ⇒ - state should be(List("a-1", "b-2").reverse) + state should ===(List("a-1", "b-2").reverse) timestamp should be > (0L) } expectMsg("c-3") @@ -180,7 +180,7 @@ class SnapshotSpec extends AkkaSpec(PersistenceSpec.config("leveldb", "SnapshotS val metadata = expectMsgPF() { case (md @ SnapshotMetadata(`persistenceId`, 4, _), state) ⇒ - state should be(List("a-1", "b-2", "c-3", "d-4").reverse) + state should ===(List("a-1", "b-2", "c-3", "d-4").reverse) md } expectMsg(RecoveryCompleted) @@ -195,7 +195,7 @@ class SnapshotSpec extends AkkaSpec(PersistenceSpec.config("leveldb", "SnapshotS persistentActor2 ! Recover(toSequenceNr = 4) expectMsgPF() { case (md @ SnapshotMetadata(`persistenceId`, 2, _), state) ⇒ - state should be(List("a-1", "b-2").reverse) + state should ===(List("a-1", "b-2").reverse) md } expectMsg("c-3") @@ -215,7 +215,7 @@ class SnapshotSpec extends AkkaSpec(PersistenceSpec.config("leveldb", "SnapshotS persistentActor1 ! DeleteN(SnapshotSelectionCriteria(maxSequenceNr = 4)) expectMsgPF() { case (md @ SnapshotMetadata(`persistenceId`, 4, _), state) ⇒ - state should be(List("a-1", "b-2", "c-3", "d-4").reverse) + state should ===(List("a-1", "b-2", "c-3", "d-4").reverse) } expectMsg(RecoveryCompleted) deleteProbe.expectMsgType[DeleteSnapshots] diff --git a/akka-persistence/src/test/scala/akka/persistence/serialization/SerializerSpec.scala b/akka-persistence/src/test/scala/akka/persistence/serialization/SerializerSpec.scala index d413bccbc6..f633af1bdc 100644 --- a/akka-persistence/src/test/scala/akka/persistence/serialization/SerializerSpec.scala +++ b/akka-persistence/src/test/scala/akka/persistence/serialization/SerializerSpec.scala @@ -68,7 +68,7 @@ class SnapshotSerializerPersistenceSpec extends AkkaSpec(customSerializers) { val bytes = serializer.toBinary(wrapped) val deserialized = serializer.fromBinary(bytes, None) - deserialized should be(Snapshot(MySnapshot(".a."))) + deserialized should ===(Snapshot(MySnapshot(".a."))) } "be able to read snapshot created with akka 2.3.6 and Scala 2.10" in { @@ -92,7 +92,7 @@ class SnapshotSerializerPersistenceSpec extends AkkaSpec(customSerializers) { val deserialized = serializer.fromBinary(bytes, None).asInstanceOf[Snapshot] val deserializedDataStr = new String(deserialized.data.asInstanceOf[Array[Byte]], "utf-8") - dataStr should be(deserializedDataStr) + dataStr should ===(deserializedDataStr) } "be able to read snapshot created with akka 2.3.6 and Scala 2.11" in { @@ -116,7 +116,7 @@ class SnapshotSerializerPersistenceSpec extends AkkaSpec(customSerializers) { val deserialized = serializer.fromBinary(bytes, None).asInstanceOf[Snapshot] val deserializedDataStr = new String(deserialized.data.asInstanceOf[Array[Byte]], "utf-8") - dataStr should be(deserializedDataStr) + dataStr should ===(deserializedDataStr) } } } @@ -133,7 +133,7 @@ class MessageSerializerPersistenceSpec extends AkkaSpec(customSerializers) { val bytes = serializer.toBinary(persistent) val deserialized = serializer.fromBinary(bytes, None) - deserialized should be(persistent.withPayload(MyPayload(".a."))) + deserialized should ===(persistent.withPayload(MyPayload(".a."))) } } "given a PersistentRepr manifest" must { @@ -144,7 +144,7 @@ class MessageSerializerPersistenceSpec extends AkkaSpec(customSerializers) { val bytes = serializer.toBinary(persistent) val deserialized = serializer.fromBinary(bytes, Some(classOf[PersistentRepr])) - deserialized should be(persistent.withPayload(MyPayload(".b."))) + deserialized should ===(persistent.withPayload(MyPayload(".b."))) } } @@ -157,7 +157,7 @@ class MessageSerializerPersistenceSpec extends AkkaSpec(customSerializers) { val bytes = serializer.toBinary(snap) val deserialized = serializer.fromBinary(bytes, Some(classOf[AtLeastOnceDeliverySnapshot])) - deserialized should be(snap) + deserialized should ===(snap) } "handle a few unconfirmed" in { @@ -171,7 +171,7 @@ class MessageSerializerPersistenceSpec extends AkkaSpec(customSerializers) { val bytes = serializer.toBinary(snap) val deserialized = serializer.fromBinary(bytes, Some(classOf[AtLeastOnceDeliverySnapshot])) - deserialized should be(snap) + deserialized should ===(snap) } } diff --git a/akka-remote-tests/src/multi-jvm/scala/akka/remote/LookupRemoteActorSpec.scala b/akka-remote-tests/src/multi-jvm/scala/akka/remote/LookupRemoteActorSpec.scala index 80c044050c..e1f2c81af8 100644 --- a/akka-remote-tests/src/multi-jvm/scala/akka/remote/LookupRemoteActorSpec.scala +++ b/akka-remote-tests/src/multi-jvm/scala/akka/remote/LookupRemoteActorSpec.scala @@ -47,9 +47,9 @@ class LookupRemoteActorSpec extends MultiNodeSpec(LookupRemoteActorMultiJvmSpec) system.actorSelection(node(master) / "user" / "service-hello") ! Identify("id1") expectMsgType[ActorIdentity].ref.get } - hello.isInstanceOf[RemoteActorRef] should be(true) + hello.isInstanceOf[RemoteActorRef] should ===(true) val masterAddress = testConductor.getAddressFor(master).await - (hello ? "identify").await.asInstanceOf[ActorRef].path.address should be(masterAddress) + (hello ? "identify").await.asInstanceOf[ActorRef].path.address should ===(masterAddress) } enterBarrier("done") } diff --git a/akka-remote-tests/src/multi-jvm/scala/akka/remote/NewRemoteActorSpec.scala b/akka-remote-tests/src/multi-jvm/scala/akka/remote/NewRemoteActorSpec.scala index 9a039763cb..d418b21703 100644 --- a/akka-remote-tests/src/multi-jvm/scala/akka/remote/NewRemoteActorSpec.scala +++ b/akka-remote-tests/src/multi-jvm/scala/akka/remote/NewRemoteActorSpec.scala @@ -60,12 +60,12 @@ class NewRemoteActorSpec extends MultiNodeSpec(NewRemoteActorMultiJvmSpec) runOn(master) { val actor = system.actorOf(Props[SomeActor], "service-hello") - actor.isInstanceOf[RemoteActorRef] should be(true) - actor.path.address should be(node(slave).address) + actor.isInstanceOf[RemoteActorRef] should ===(true) + actor.path.address should ===(node(slave).address) val slaveAddress = testConductor.getAddressFor(slave).await actor ! "identify" - expectMsgType[ActorRef].path.address should be(slaveAddress) + expectMsgType[ActorRef].path.address should ===(slaveAddress) } enterBarrier("done") @@ -75,12 +75,12 @@ class NewRemoteActorSpec extends MultiNodeSpec(NewRemoteActorMultiJvmSpec) runOn(master) { val actor = system.actorOf(Props(classOf[SomeActorWithParam], null), "service-hello-null") - actor.isInstanceOf[RemoteActorRef] should be(true) - actor.path.address should be(node(slave).address) + actor.isInstanceOf[RemoteActorRef] should ===(true) + actor.path.address should ===(node(slave).address) val slaveAddress = testConductor.getAddressFor(slave).await actor ! "identify" - expectMsgType[ActorRef].path.address should be(slaveAddress) + expectMsgType[ActorRef].path.address should ===(slaveAddress) } enterBarrier("done") @@ -90,12 +90,12 @@ class NewRemoteActorSpec extends MultiNodeSpec(NewRemoteActorMultiJvmSpec) runOn(master) { val actor = system.actorOf(Props[SomeActor], "service-hello2") - actor.isInstanceOf[RemoteActorRef] should be(true) - actor.path.address should be(node(slave).address) + actor.isInstanceOf[RemoteActorRef] should ===(true) + actor.path.address should ===(node(slave).address) val slaveAddress = testConductor.getAddressFor(slave).await actor ! "identify" - expectMsgType[ActorRef].path.address should be(slaveAddress) + expectMsgType[ActorRef].path.address should ===(slaveAddress) } enterBarrier("done") @@ -104,8 +104,8 @@ class NewRemoteActorSpec extends MultiNodeSpec(NewRemoteActorMultiJvmSpec) "be able to shutdown system when using remote deployed actor" taggedAs LongRunningTest in within(20 seconds) { runOn(master) { val actor = system.actorOf(Props[SomeActor], "service-hello3") - actor.isInstanceOf[RemoteActorRef] should be(true) - actor.path.address should be(node(slave).address) + actor.isInstanceOf[RemoteActorRef] should ===(true) + actor.path.address should ===(node(slave).address) // This watch is in race with the shutdown of the watched system. This race should remain, as the test should // handle both cases: // - remote system receives watch, replies with DeathWatchNotification diff --git a/akka-remote-tests/src/multi-jvm/scala/akka/remote/RemoteDeploymentDeathWatchSpec.scala b/akka-remote-tests/src/multi-jvm/scala/akka/remote/RemoteDeploymentDeathWatchSpec.scala index b3ce6dc60f..478ef31375 100644 --- a/akka-remote-tests/src/multi-jvm/scala/akka/remote/RemoteDeploymentDeathWatchSpec.scala +++ b/akka-remote-tests/src/multi-jvm/scala/akka/remote/RemoteDeploymentDeathWatchSpec.scala @@ -70,7 +70,7 @@ abstract class RemoteDeploymentDeathWatchSpec runOn(second) { // remote deployment to third val hello = system.actorOf(Props[Hello], "hello") - hello.path.address should be(node(third).address) + hello.path.address should ===(node(third).address) enterBarrier("hello-deployed") enterBarrier("third-crashed") diff --git a/akka-remote-tests/src/multi-jvm/scala/akka/remote/RemoteNodeDeathWatchSpec.scala b/akka-remote-tests/src/multi-jvm/scala/akka/remote/RemoteNodeDeathWatchSpec.scala index 7b0017af80..d69a69e1c8 100644 --- a/akka-remote-tests/src/multi-jvm/scala/akka/remote/RemoteNodeDeathWatchSpec.scala +++ b/akka-remote-tests/src/multi-jvm/scala/akka/remote/RemoteNodeDeathWatchSpec.scala @@ -124,7 +124,7 @@ abstract class RemoteNodeDeathWatchSpec enterBarrier("watch-established-1") sleep() - expectMsgType[WrappedTerminated].t.actor should be(subject) + expectMsgType[WrappedTerminated].t.actor should ===(subject) } runOn(second) { @@ -248,7 +248,7 @@ abstract class RemoteNodeDeathWatchSpec system.stop(s2) enterBarrier("stop-s2-4") - expectMsgType[WrappedTerminated].t.actor should be(subject2) + expectMsgType[WrappedTerminated].t.actor should ===(subject2) } runOn(third) { @@ -335,8 +335,8 @@ abstract class RemoteNodeDeathWatchSpec enterBarrier("watch-established-5") enterBarrier("stopped-5") - p1.receiveN(2, 5 seconds).collect { case WrappedTerminated(t) ⇒ t.actor }.toSet should be(Set(a1, a2)) - p3.expectMsgType[WrappedTerminated](5 seconds).t.actor should be(a3) + p1.receiveN(2, 5 seconds).collect { case WrappedTerminated(t) ⇒ t.actor }.toSet should ===(Set(a1, a2)) + p3.expectMsgType[WrappedTerminated](5 seconds).t.actor should ===(a3) p2.expectNoMsg(2 seconds) enterBarrier("terminated-verified-5") @@ -383,7 +383,7 @@ abstract class RemoteNodeDeathWatchSpec log.info("exit second") testConductor.exit(second, 0).await - expectMsgType[WrappedTerminated](15 seconds).t.actor should be(subject) + expectMsgType[WrappedTerminated](15 seconds).t.actor should ===(subject) // verify that things are cleaned up, and heartbeating is stopped assertCleanup() diff --git a/akka-remote-tests/src/multi-jvm/scala/akka/remote/routing/RemoteRandomSpec.scala b/akka-remote-tests/src/multi-jvm/scala/akka/remote/routing/RemoteRandomSpec.scala index d88f2edf41..0d36f5b8e5 100644 --- a/akka-remote-tests/src/multi-jvm/scala/akka/remote/routing/RemoteRandomSpec.scala +++ b/akka-remote-tests/src/multi-jvm/scala/akka/remote/routing/RemoteRandomSpec.scala @@ -60,7 +60,7 @@ class RemoteRandomSpec extends MultiNodeSpec(RemoteRandomMultiJvmSpec) runOn(fourth) { enterBarrier("start") val actor = system.actorOf(RandomPool(nrOfInstances = 0).props(Props[SomeActor]), "service-hello") - actor.isInstanceOf[RoutedActorRef] should be(true) + actor.isInstanceOf[RoutedActorRef] should ===(true) val connectionCount = 3 val iterationCount = 100 @@ -81,7 +81,7 @@ class RemoteRandomSpec extends MultiNodeSpec(RemoteRandomMultiJvmSpec) enterBarrier("end") // since it's random we can't be too strict in the assert replies.values count (_ > 0) should be > (connectionCount - 2) - replies.get(node(fourth).address) should be(None) + replies.get(node(fourth).address) should ===(None) // shut down the actor before we let the other node(s) shut down so we don't try to send // "Terminate" to a shut down node diff --git a/akka-remote-tests/src/multi-jvm/scala/akka/remote/routing/RemoteRoundRobinSpec.scala b/akka-remote-tests/src/multi-jvm/scala/akka/remote/routing/RemoteRoundRobinSpec.scala index 387070abbe..0416a91bae 100644 --- a/akka-remote-tests/src/multi-jvm/scala/akka/remote/routing/RemoteRoundRobinSpec.scala +++ b/akka-remote-tests/src/multi-jvm/scala/akka/remote/routing/RemoteRoundRobinSpec.scala @@ -88,7 +88,7 @@ class RemoteRoundRobinSpec extends MultiNodeSpec(RemoteRoundRobinMultiJvmSpec) runOn(fourth) { enterBarrier("start") val actor = system.actorOf(RoundRobinPool(nrOfInstances = 0).props(Props[SomeActor]), "service-hello") - actor.isInstanceOf[RoutedActorRef] should be(true) + actor.isInstanceOf[RoutedActorRef] should ===(true) val connectionCount = 3 val iterationCount = 10 @@ -107,8 +107,8 @@ class RemoteRoundRobinSpec extends MultiNodeSpec(RemoteRoundRobinMultiJvmSpec) actor ! Broadcast(PoisonPill) enterBarrier("end") - replies.values foreach { _ should be(iterationCount) } - replies.get(node(fourth).address) should be(None) + replies.values foreach { _ should ===(iterationCount) } + replies.get(node(fourth).address) should ===(None) // shut down the actor before we let the other node(s) shut down so we don't try to send // "Terminate" to a shut down node @@ -131,17 +131,17 @@ class RemoteRoundRobinSpec extends MultiNodeSpec(RemoteRoundRobinMultiJvmSpec) val actor = system.actorOf(RoundRobinPool( nrOfInstances = 1, resizer = Some(new TestResizer)).props(Props[SomeActor]), "service-hello2") - actor.isInstanceOf[RoutedActorRef] should be(true) + actor.isInstanceOf[RoutedActorRef] should ===(true) actor ! GetRoutees // initial nrOfInstances 1 + inital resize => 2 - expectMsgType[Routees].routees.size should be(2) + expectMsgType[Routees].routees.size should ===(2) val repliesFrom: Set[ActorRef] = (for (n ← 3 to 9) yield { // each message trigger a resize, incrementing number of routees with 1 actor ! "hit" - Await.result(actor ? GetRoutees, timeout.duration).asInstanceOf[Routees].routees.size should be(n) + Await.result(actor ? GetRoutees, timeout.duration).asInstanceOf[Routees].routees.size should ===(n) expectMsgType[ActorRef] }).toSet @@ -149,9 +149,9 @@ class RemoteRoundRobinSpec extends MultiNodeSpec(RemoteRoundRobinMultiJvmSpec) actor ! Broadcast(PoisonPill) enterBarrier("end") - repliesFrom.size should be(7) + repliesFrom.size should ===(7) val repliesFromAddresses = repliesFrom.map(_.path.address) - repliesFromAddresses should be(Set(node(first), node(second), node(third)).map(_.address)) + repliesFromAddresses should ===(Set(node(first), node(second), node(third)).map(_.address)) // shut down the actor before we let the other node(s) shut down so we don't try to send // "Terminate" to a shut down node @@ -173,7 +173,7 @@ class RemoteRoundRobinSpec extends MultiNodeSpec(RemoteRoundRobinMultiJvmSpec) runOn(fourth) { enterBarrier("start") val actor = system.actorOf(FromConfig.props(), "service-hello3") - actor.isInstanceOf[RoutedActorRef] should be(true) + actor.isInstanceOf[RoutedActorRef] should ===(true) val connectionCount = 3 val iterationCount = 10 @@ -189,8 +189,8 @@ class RemoteRoundRobinSpec extends MultiNodeSpec(RemoteRoundRobinMultiJvmSpec) } enterBarrier("end") - replies.values foreach { _ should be(iterationCount) } - replies.get(node(fourth).address) should be(None) + replies.values foreach { _ should ===(iterationCount) } + replies.get(node(fourth).address) should ===(None) } enterBarrier("done") diff --git a/akka-remote-tests/src/multi-jvm/scala/akka/remote/routing/RemoteScatterGatherSpec.scala b/akka-remote-tests/src/multi-jvm/scala/akka/remote/routing/RemoteScatterGatherSpec.scala index 924ec19e26..26db613f45 100644 --- a/akka-remote-tests/src/multi-jvm/scala/akka/remote/routing/RemoteScatterGatherSpec.scala +++ b/akka-remote-tests/src/multi-jvm/scala/akka/remote/routing/RemoteScatterGatherSpec.scala @@ -63,7 +63,7 @@ class RemoteScatterGatherSpec extends MultiNodeSpec(RemoteScatterGatherMultiJvmS runOn(fourth) { enterBarrier("start") val actor = system.actorOf(ScatterGatherFirstCompletedPool(nrOfInstances = 1, within = 10.seconds).props(Props[SomeActor]), "service-hello") - actor.isInstanceOf[RoutedActorRef] should be(true) + actor.isInstanceOf[RoutedActorRef] should ===(true) val connectionCount = 3 val iterationCount = 10 @@ -82,8 +82,8 @@ class RemoteScatterGatherSpec extends MultiNodeSpec(RemoteScatterGatherMultiJvmS actor ! Broadcast(PoisonPill) enterBarrier("end") - replies.values.sum should be(connectionCount * iterationCount) - replies.get(node(fourth).address) should be(None) + replies.values.sum should ===(connectionCount * iterationCount) + replies.get(node(fourth).address) should ===(None) // shut down the actor before we let the other node(s) shut down so we don't try to send // "Terminate" to a shut down node diff --git a/akka-remote-tests/src/multi-jvm/scala/akka/remote/testconductor/TestConductorSpec.scala b/akka-remote-tests/src/multi-jvm/scala/akka/remote/testconductor/TestConductorSpec.scala index 135308b05a..795ec8c518 100644 --- a/akka-remote-tests/src/multi-jvm/scala/akka/remote/testconductor/TestConductorSpec.scala +++ b/akka-remote-tests/src/multi-jvm/scala/akka/remote/testconductor/TestConductorSpec.scala @@ -74,7 +74,7 @@ class TestConductorSpec extends MultiNodeSpec(TestConductorMultiJvmSpec) with ST within(0.6 seconds, 2 seconds) { expectMsg(500 millis, 0) - receiveN(9) should be(1 to 9) + receiveN(9) should ===(1 to 9) } enterBarrier("throttled_send2") @@ -96,7 +96,7 @@ class TestConductorSpec extends MultiNodeSpec(TestConductorMultiJvmSpec) with ST within(min, max) { expectMsg(500 millis, 10) - receiveN(9) should be(11 to 19) + receiveN(9) should ===(11 to 19) } enterBarrier("throttled_recv2") diff --git a/akka-remote-tests/src/test/scala/akka/remote/SerializationChecksSpec.scala b/akka-remote-tests/src/test/scala/akka/remote/SerializationChecksSpec.scala index 16597b30ea..1dde413bef 100644 --- a/akka-remote-tests/src/test/scala/akka/remote/SerializationChecksSpec.scala +++ b/akka-remote-tests/src/test/scala/akka/remote/SerializationChecksSpec.scala @@ -10,8 +10,8 @@ class SerializationChecksSpec extends AkkaSpec { "Settings serialize-messages and serialize-creators" must { "be on for tests" in { - system.settings.SerializeAllCreators should be(true) - system.settings.SerializeAllMessages should be(true) + system.settings.SerializeAllCreators should ===(true) + system.settings.SerializeAllMessages should ===(true) } } diff --git a/akka-remote-tests/src/test/scala/akka/remote/testconductor/BarrierSpec.scala b/akka-remote-tests/src/test/scala/akka/remote/testconductor/BarrierSpec.scala index f840e725df..d6100d9d59 100644 --- a/akka-remote-tests/src/test/scala/akka/remote/testconductor/BarrierSpec.scala +++ b/akka-remote-tests/src/test/scala/akka/remote/testconductor/BarrierSpec.scala @@ -556,7 +556,7 @@ class BarrierSpec extends AkkaSpec(BarrierSpec.config) with ImplicitSender { private def noMsg(probes: TestProbe*) { expectNoMsg(1 second) - probes foreach (_.msgAvailable should be(false)) + probes foreach (_.msgAvailable should ===(false)) } private def data(clients: Set[Controller.NodeInfo], barrier: String, arrived: List[ActorRef], previous: Data): Data = { diff --git a/akka-remote-tests/src/test/scala/akka/remote/testconductor/ControllerSpec.scala b/akka-remote-tests/src/test/scala/akka/remote/testconductor/ControllerSpec.scala index 64a0f1ec32..03a7f07aad 100644 --- a/akka-remote-tests/src/test/scala/akka/remote/testconductor/ControllerSpec.scala +++ b/akka-remote-tests/src/test/scala/akka/remote/testconductor/ControllerSpec.scala @@ -33,7 +33,7 @@ class ControllerSpec extends AkkaSpec(ControllerSpec.config) with ImplicitSender c ! NodeInfo(B, AddressFromURIString("akka://sys"), testActor) expectMsg(ToClient(Done)) c ! Controller.GetNodes - expectMsgType[Iterable[RoleName]].toSet should be(Set(A, B)) + expectMsgType[Iterable[RoleName]].toSet should ===(Set(A, B)) c ! PoisonPill // clean up so network connections don't accumulate during test run } diff --git a/akka-remote/src/test/scala/akka/remote/AccrualFailureDetectorSpec.scala b/akka-remote/src/test/scala/akka/remote/AccrualFailureDetectorSpec.scala index 73d437b1b4..317a4ce0f2 100644 --- a/akka-remote/src/test/scala/akka/remote/AccrualFailureDetectorSpec.scala +++ b/akka-remote/src/test/scala/akka/remote/AccrualFailureDetectorSpec.scala @@ -41,32 +41,32 @@ class AccrualFailureDetectorSpec extends AkkaSpec("akka.loglevel = INFO") { "use good enough cumulative distribution function" in { val fd = createFailureDetector() - cdf(fd.phi(0, 0, 10)) should be(0.5 +- (0.001)) - cdf(fd.phi(6L, 0, 10)) should be(0.7257 +- (0.001)) - cdf(fd.phi(15L, 0, 10)) should be(0.9332 +- (0.001)) - cdf(fd.phi(20L, 0, 10)) should be(0.97725 +- (0.001)) - cdf(fd.phi(25L, 0, 10)) should be(0.99379 +- (0.001)) - cdf(fd.phi(35L, 0, 10)) should be(0.99977 +- (0.001)) - cdf(fd.phi(40L, 0, 10)) should be(0.99997 +- (0.0001)) + cdf(fd.phi(0, 0, 10)) should ===(0.5 +- (0.001)) + cdf(fd.phi(6L, 0, 10)) should ===(0.7257 +- (0.001)) + cdf(fd.phi(15L, 0, 10)) should ===(0.9332 +- (0.001)) + cdf(fd.phi(20L, 0, 10)) should ===(0.97725 +- (0.001)) + cdf(fd.phi(25L, 0, 10)) should ===(0.99379 +- (0.001)) + cdf(fd.phi(35L, 0, 10)) should ===(0.99977 +- (0.001)) + cdf(fd.phi(40L, 0, 10)) should ===(0.99997 +- (0.0001)) for (x :: y :: Nil ← (0 to 40).toList.sliding(2)) { fd.phi(x, 0, 10) should be < (fd.phi(y, 0, 10)) } - cdf(fd.phi(22, 20.0, 3)) should be(0.7475 +- (0.001)) + cdf(fd.phi(22, 20.0, 3)) should ===(0.7475 +- (0.001)) } "handle outliers without losing precision or hitting exceptions" in { val fd = createFailureDetector() - fd.phi(10L, 0, 1) should be(38.0 +- 1.0) - fd.phi(-25L, 0, 1) should be(0.0) + fd.phi(10L, 0, 1) should ===(38.0 +- 1.0) + fd.phi(-25L, 0, 1) should ===(0.0) } "return realistic phi values" in { val fd = createFailureDetector() val test = TreeMap(0 -> 0.0, 500 -> 0.1, 1000 -> 0.3, 1200 -> 1.6, 1400 -> 4.7, 1600 -> 10.8, 1700 -> 15.3) for ((timeDiff, expectedPhi) ← test) { - fd.phi(timeDiff = timeDiff, mean = 1000.0, stdDeviation = 100.0) should be(expectedPhi +- (0.1)) + fd.phi(timeDiff = timeDiff, mean = 1000.0, stdDeviation = 100.0) should ===(expectedPhi +- (0.1)) } // larger stdDeviation results => lower phi @@ -76,8 +76,8 @@ class AccrualFailureDetectorSpec extends AkkaSpec("akka.loglevel = INFO") { "return phi value of 0.0 on startup for each address, when no heartbeats" in { val fd = createFailureDetector() - fd.phi should be(0.0) - fd.phi should be(0.0) + fd.phi should ===(0.0) + fd.phi should ===(0.0) } "return phi based on guess when only one heartbeat" in { @@ -86,8 +86,8 @@ class AccrualFailureDetectorSpec extends AkkaSpec("akka.loglevel = INFO") { clock = fakeTimeGenerator(timeInterval)) fd.heartbeat() - fd.phi should be(0.3 +- 0.2) - fd.phi should be(4.5 +- 0.3) + fd.phi should ===(0.3 +- 0.2) + fd.phi should ===(4.5 +- 0.3) fd.phi should be > (15.0) } @@ -104,14 +104,14 @@ class AccrualFailureDetectorSpec extends AkkaSpec("akka.loglevel = INFO") { "mark node as monitored after a series of successful heartbeats" in { val timeInterval = List[Long](0, 1000, 100, 100) val fd = createFailureDetector(clock = fakeTimeGenerator(timeInterval)) - fd.isMonitoring should be(false) + fd.isMonitoring should ===(false) fd.heartbeat() fd.heartbeat() fd.heartbeat() - fd.isMonitoring should be(true) - fd.isAvailable should be(true) + fd.isMonitoring should ===(true) + fd.isAvailable should ===(true) } "mark node as dead if heartbeat are missed" in { @@ -122,8 +122,8 @@ class AccrualFailureDetectorSpec extends AkkaSpec("akka.loglevel = INFO") { fd.heartbeat() //1000 fd.heartbeat() //1100 - fd.isAvailable should be(true) //1200 - fd.isAvailable should be(false) //8200 + fd.isAvailable should ===(true) //1200 + fd.isAvailable should ===(false) //8200 } "mark node as available if it starts heartbeat again after being marked dead due to detection of failure" in { @@ -133,15 +133,15 @@ class AccrualFailureDetectorSpec extends AkkaSpec("akka.loglevel = INFO") { val fd = createFailureDetector(threshold = 8, acceptableLostDuration = 3.seconds, clock = fakeTimeGenerator(timeIntervals)) for (_ ← 0 until 1000) fd.heartbeat() - fd.isAvailable should be(false) // after the long pause + fd.isAvailable should ===(false) // after the long pause fd.heartbeat() - fd.isAvailable should be(true) + fd.isAvailable should ===(true) fd.heartbeat() - fd.isAvailable should be(false) // after the 7 seconds pause + fd.isAvailable should ===(false) // after the 7 seconds pause fd.heartbeat() - fd.isAvailable should be(true) + fd.isAvailable should ===(true) fd.heartbeat() - fd.isAvailable should be(true) + fd.isAvailable should ===(true) } "accept some configured missing heartbeats" in { @@ -152,9 +152,9 @@ class AccrualFailureDetectorSpec extends AkkaSpec("akka.loglevel = INFO") { fd.heartbeat() fd.heartbeat() fd.heartbeat() - fd.isAvailable should be(true) + fd.isAvailable should ===(true) fd.heartbeat() - fd.isAvailable should be(true) + fd.isAvailable should ===(true) } "fail after configured acceptable missing heartbeats" in { @@ -167,9 +167,9 @@ class AccrualFailureDetectorSpec extends AkkaSpec("akka.loglevel = INFO") { fd.heartbeat() fd.heartbeat() fd.heartbeat() - fd.isAvailable should be(true) + fd.isAvailable should ===(true) fd.heartbeat() - fd.isAvailable should be(false) + fd.isAvailable should ===(false) } "use maxSampleSize heartbeats" in { @@ -188,7 +188,7 @@ class AccrualFailureDetectorSpec extends AkkaSpec("akka.loglevel = INFO") { fd.heartbeat() //2000 fd.heartbeat() //2500 val phi2 = fd.phi //3000 - phi2 should be(phi1.plusOrMinus(0.001)) + phi2 should ===(phi1.plusOrMinus(0.001)) } } @@ -200,26 +200,26 @@ class AccrualFailureDetectorSpec extends AkkaSpec("akka.loglevel = INFO") { val stats = (HeartbeatHistory(maxSampleSize = 20) /: samples) { (stats, value) ⇒ stats :+ value } - stats.mean should be(179.0 +- 0.00001) - stats.variance should be(7584.0 +- 0.00001) + stats.mean should ===(179.0 +- 0.00001) + stats.variance should ===(7584.0 +- 0.00001) } "have 0.0 variance for one sample" in { - (HeartbeatHistory(600) :+ 1000L).variance should be(0.0 +- 0.00001) + (HeartbeatHistory(600) :+ 1000L).variance should ===(0.0 +- 0.00001) } "be capped by the specified maxSampleSize" in { val history3 = HeartbeatHistory(maxSampleSize = 3) :+ 100 :+ 110 :+ 90 - history3.mean should be(100.0 +- 0.00001) - history3.variance should be(66.6666667 +- 0.00001) + history3.mean should ===(100.0 +- 0.00001) + history3.variance should ===(66.6666667 +- 0.00001) val history4 = history3 :+ 140 - history4.mean should be(113.333333 +- 0.00001) - history4.variance should be(422.222222 +- 0.00001) + history4.mean should ===(113.333333 +- 0.00001) + history4.variance should ===(422.222222 +- 0.00001) val history5 = history4 :+ 80 - history5.mean should be(103.333333 +- 0.00001) - history5.variance should be(688.88888889 +- 0.00001) + history5.mean should ===(103.333333 +- 0.00001) + history5.variance should ===(688.88888889 +- 0.00001) } } diff --git a/akka-remote/src/test/scala/akka/remote/AckedDeliverySpec.scala b/akka-remote/src/test/scala/akka/remote/AckedDeliverySpec.scala index ea61a059f3..7fc1a20beb 100644 --- a/akka-remote/src/test/scala/akka/remote/AckedDeliverySpec.scala +++ b/akka-remote/src/test/scala/akka/remote/AckedDeliverySpec.scala @@ -29,16 +29,16 @@ class AckedDeliverySpec extends AkkaSpec { val s2 = SeqNo(2) val s0b = SeqNo(0) - sm1 < s0 should be(true) - sm1 > s0 should be(false) + sm1 < s0 should ===(true) + sm1 > s0 should ===(false) - s0 < s1 should be(true) - s0 > s1 should be(false) + s0 < s1 should ===(true) + s0 > s1 should ===(false) - s1 < s2 should be(true) - s1 > s2 should be(false) + s1 < s2 should ===(true) + s1 > s2 should ===(false) - s0b == s0 should be(true) + s0b == s0 should ===(true) } "correctly handle wrapping over" in { @@ -47,14 +47,14 @@ class AckedDeliverySpec extends AkkaSpec { val s3 = SeqNo(Long.MinValue) val s4 = SeqNo(Long.MinValue + 1) - s1 < s2 should be(true) - s1 > s2 should be(false) + s1 < s2 should ===(true) + s1 > s2 should ===(false) - s2 < s3 should be(true) - s2 > s3 should be(false) + s2 < s3 should ===(true) + s2 > s3 should ===(false) - s3 < s4 should be(true) - s3 > s4 should be(false) + s3 < s4 should ===(true) + s3 > s4 should ===(false) } "correctly handle large gaps" in { @@ -62,11 +62,11 @@ class AckedDeliverySpec extends AkkaSpec { val smin2 = SeqNo(Long.MinValue + 1) val s0 = SeqNo(0) - s0 < smin should be(true) - s0 > smin should be(false) + s0 < smin should ===(true) + s0 > smin should ===(false) - smin2 < s0 should be(true) - smin2 > s0 should be(false) + smin2 < s0 should ===(true) + smin2 > s0 should ===(false) } } @@ -80,13 +80,13 @@ class AckedDeliverySpec extends AkkaSpec { val msg2 = msg(2) val b1 = b0.buffer(msg0) - b1.nonAcked should be(Vector(msg0)) + b1.nonAcked should ===(Vector(msg0)) val b2 = b1.buffer(msg1) - b2.nonAcked should be(Vector(msg0, msg1)) + b2.nonAcked should ===(Vector(msg0, msg1)) val b3 = b2.buffer(msg2) - b3.nonAcked should be(Vector(msg0, msg1, msg2)) + b3.nonAcked should ===(Vector(msg0, msg1, msg2)) } @@ -107,31 +107,31 @@ class AckedDeliverySpec extends AkkaSpec { val msg4 = msg(4) val b1 = b0.buffer(msg0) - b1.nonAcked should be(Vector(msg0)) + b1.nonAcked should ===(Vector(msg0)) val b2 = b1.buffer(msg1) - b2.nonAcked should be(Vector(msg0, msg1)) + b2.nonAcked should ===(Vector(msg0, msg1)) val b3 = b2.buffer(msg2) - b3.nonAcked should be(Vector(msg0, msg1, msg2)) + b3.nonAcked should ===(Vector(msg0, msg1, msg2)) val b4 = b3.acknowledge(Ack(SeqNo(1))) - b4.nonAcked should be(Vector(msg2)) + b4.nonAcked should ===(Vector(msg2)) val b5 = b4.buffer(msg3) - b5.nonAcked should be(Vector(msg2, msg3)) + b5.nonAcked should ===(Vector(msg2, msg3)) val b6 = b5.buffer(msg4) - b6.nonAcked should be(Vector(msg2, msg3, msg4)) + b6.nonAcked should ===(Vector(msg2, msg3, msg4)) val b7 = b6.acknowledge(Ack(SeqNo(1))) - b7.nonAcked should be(Vector(msg2, msg3, msg4)) + b7.nonAcked should ===(Vector(msg2, msg3, msg4)) val b8 = b7.acknowledge(Ack(SeqNo(2))) - b8.nonAcked should be(Vector(msg3, msg4)) + b8.nonAcked should ===(Vector(msg3, msg4)) val b9 = b8.acknowledge(Ack(SeqNo(4))) - b9.nonAcked should be(Vector.empty) + b9.nonAcked should ===(Vector.empty) } @@ -144,29 +144,29 @@ class AckedDeliverySpec extends AkkaSpec { val msg4 = msg(4) val b1 = b0.buffer(msg0) - b1.nonAcked should be(Vector(msg0)) + b1.nonAcked should ===(Vector(msg0)) val b2 = b1.buffer(msg1) - b2.nonAcked should be(Vector(msg0, msg1)) + b2.nonAcked should ===(Vector(msg0, msg1)) val b3 = b2.buffer(msg2) - b3.nonAcked should be(Vector(msg0, msg1, msg2)) + b3.nonAcked should ===(Vector(msg0, msg1, msg2)) val b4 = b3.acknowledge(Ack(SeqNo(1), nacks = Set(SeqNo(0)))) - b4.nonAcked should be(Vector(msg2)) - b4.nacked should be(Vector(msg0)) + b4.nonAcked should ===(Vector(msg2)) + b4.nacked should ===(Vector(msg0)) val b5 = b4.buffer(msg3).buffer(msg4) - b5.nonAcked should be(Vector(msg2, msg3, msg4)) - b5.nacked should be(Vector(msg0)) + b5.nonAcked should ===(Vector(msg2, msg3, msg4)) + b5.nacked should ===(Vector(msg0)) val b6 = b5.acknowledge(Ack(SeqNo(4), nacks = Set(SeqNo(2), SeqNo(3)))) - b6.nonAcked should be(Vector()) - b6.nacked should be(Vector(msg2, msg3)) + b6.nonAcked should ===(Vector()) + b6.nacked should ===(Vector(msg2, msg3)) val b7 = b6.acknowledge(Ack(SeqNo(4))) - b7.nonAcked should be(Vector.empty) - b7.nacked should be(Vector.empty) + b7.nonAcked should ===(Vector.empty) + b7.nacked should ===(Vector.empty) } "throw exception if non-buffered sequence number is NACKed" in { @@ -194,28 +194,28 @@ class AckedDeliverySpec extends AkkaSpec { val msg5 = msg(5) val (b1, deliver1, ack1) = b0.receive(msg1).extractDeliverable - deliver1 should be(Vector.empty) - ack1 should be(Ack(SeqNo(1), nacks = Set(SeqNo(0)))) + deliver1 should ===(Vector.empty) + ack1 should ===(Ack(SeqNo(1), nacks = Set(SeqNo(0)))) val (b2, deliver2, ack2) = b1.receive(msg0).extractDeliverable - deliver2 should be(Vector(msg0, msg1)) - ack2 should be(Ack(SeqNo(1))) + deliver2 should ===(Vector(msg0, msg1)) + ack2 should ===(Ack(SeqNo(1))) val (b3, deliver3, ack3) = b2.receive(msg4).extractDeliverable - deliver3 should be(Vector.empty) - ack3 should be(Ack(SeqNo(4), nacks = Set(SeqNo(2), SeqNo(3)))) + deliver3 should ===(Vector.empty) + ack3 should ===(Ack(SeqNo(4), nacks = Set(SeqNo(2), SeqNo(3)))) val (b4, deliver4, ack4) = b3.receive(msg2).extractDeliverable - deliver4 should be(Vector(msg2)) - ack4 should be(Ack(SeqNo(4), nacks = Set(SeqNo(3)))) + deliver4 should ===(Vector(msg2)) + ack4 should ===(Ack(SeqNo(4), nacks = Set(SeqNo(3)))) val (b5, deliver5, ack5) = b4.receive(msg5).extractDeliverable - deliver5 should be(Vector.empty) - ack5 should be(Ack(SeqNo(5), nacks = Set(SeqNo(3)))) + deliver5 should ===(Vector.empty) + ack5 should ===(Ack(SeqNo(5), nacks = Set(SeqNo(3)))) val (_, deliver6, ack6) = b5.receive(msg3).extractDeliverable - deliver6 should be(Vector(msg3, msg4, msg5)) - ack6 should be(Ack(SeqNo(5))) + deliver6 should ===(Vector(msg3, msg4, msg5)) + ack6 should ===(Ack(SeqNo(5))) } @@ -237,8 +237,8 @@ class AckedDeliverySpec extends AkkaSpec { val (_, deliver, ack) = buf3.extractDeliverable - deliver should be(Vector.empty) - ack should be(Ack(SeqNo(2))) + deliver should ===(Vector.empty) + ack should ===(Ack(SeqNo(2))) } "be able to correctly merge with another receive buffer" in { @@ -254,8 +254,8 @@ class AckedDeliverySpec extends AkkaSpec { buf2.receive(msg1b).receive(msg3)) val (_, deliver, ack) = buf.receive(msg0).extractDeliverable - deliver should be(Vector(msg0, msg1a, msg2, msg3)) - ack should be(Ack(SeqNo(3))) + deliver should ===(Vector(msg0, msg1a, msg2, msg3)) + ack should ===(Ack(SeqNo(3))) } } diff --git a/akka-remote/src/test/scala/akka/remote/DaemonicSpec.scala b/akka-remote/src/test/scala/akka/remote/DaemonicSpec.scala index 5265102063..f8473e2fd8 100644 --- a/akka-remote/src/test/scala/akka/remote/DaemonicSpec.scala +++ b/akka-remote/src/test/scala/akka/remote/DaemonicSpec.scala @@ -48,7 +48,7 @@ class DaemonicSpec extends AkkaSpec { val newNonDaemons: Set[Thread] = Thread.getAllStackTraces().keySet().asScala.seq. filter(t ⇒ !origThreads(t) && t.isDaemon == false).to[Set] - newNonDaemons should be(Set.empty[Thread]) + newNonDaemons should ===(Set.empty[Thread]) shutdown(daemonicSystem) } } diff --git a/akka-remote/src/test/scala/akka/remote/DeadlineFailureDetectorSpec.scala b/akka-remote/src/test/scala/akka/remote/DeadlineFailureDetectorSpec.scala index d54d53c07d..9187197cbb 100644 --- a/akka-remote/src/test/scala/akka/remote/DeadlineFailureDetectorSpec.scala +++ b/akka-remote/src/test/scala/akka/remote/DeadlineFailureDetectorSpec.scala @@ -31,14 +31,14 @@ class DeadlineFailureDetectorSpec extends AkkaSpec { "mark node as monitored after a series of successful heartbeats" in { val timeInterval = List[Long](0, 1000, 100, 100) val fd = createFailureDetector(acceptableLostDuration = 5.seconds, clock = fakeTimeGenerator(timeInterval)) - fd.isMonitoring should be(false) + fd.isMonitoring should ===(false) fd.heartbeat() fd.heartbeat() fd.heartbeat() - fd.isMonitoring should be(true) - fd.isAvailable should be(true) + fd.isMonitoring should ===(true) + fd.isAvailable should ===(true) } "mark node as dead if heartbeat are missed" in { @@ -49,8 +49,8 @@ class DeadlineFailureDetectorSpec extends AkkaSpec { fd.heartbeat() //1000 fd.heartbeat() //1100 - fd.isAvailable should be(true) //1200 - fd.isAvailable should be(false) //8200 + fd.isAvailable should ===(true) //1200 + fd.isAvailable should ===(false) //8200 } "mark node as available if it starts heartbeat again after being marked dead due to detection of failure" in { @@ -60,15 +60,15 @@ class DeadlineFailureDetectorSpec extends AkkaSpec { val fd = createFailureDetector(acceptableLostDuration = 7.seconds, clock = fakeTimeGenerator(timeIntervals)) for (_ ← 0 until 1000) fd.heartbeat() - fd.isAvailable should be(false) // after the long pause + fd.isAvailable should ===(false) // after the long pause fd.heartbeat() - fd.isAvailable should be(true) + fd.isAvailable should ===(true) fd.heartbeat() - fd.isAvailable should be(false) // after the 7 seconds pause + fd.isAvailable should ===(false) // after the 7 seconds pause fd.heartbeat() - fd.isAvailable should be(true) + fd.isAvailable should ===(true) fd.heartbeat() - fd.isAvailable should be(true) + fd.isAvailable should ===(true) } "accept some configured missing heartbeats" in { @@ -79,9 +79,9 @@ class DeadlineFailureDetectorSpec extends AkkaSpec { fd.heartbeat() fd.heartbeat() fd.heartbeat() - fd.isAvailable should be(true) + fd.isAvailable should ===(true) fd.heartbeat() - fd.isAvailable should be(true) + fd.isAvailable should ===(true) } "fail after configured acceptable missing heartbeats" in { @@ -94,9 +94,9 @@ class DeadlineFailureDetectorSpec extends AkkaSpec { fd.heartbeat() fd.heartbeat() fd.heartbeat() - fd.isAvailable should be(true) + fd.isAvailable should ===(true) fd.heartbeat() - fd.isAvailable should be(false) + fd.isAvailable should ===(false) } } diff --git a/akka-remote/src/test/scala/akka/remote/EndpointRegistrySpec.scala b/akka-remote/src/test/scala/akka/remote/EndpointRegistrySpec.scala index d38fc9729c..d9306f9051 100644 --- a/akka-remote/src/test/scala/akka/remote/EndpointRegistrySpec.scala +++ b/akka-remote/src/test/scala/akka/remote/EndpointRegistrySpec.scala @@ -18,60 +18,60 @@ class EndpointRegistrySpec extends AkkaSpec { "be able to register a writable endpoint and policy" in { val reg = new EndpointRegistry - reg.writableEndpointWithPolicyFor(address1) should be(None) + reg.writableEndpointWithPolicyFor(address1) should ===(None) - reg.registerWritableEndpoint(address1, None, None, actorA) should be(actorA) + reg.registerWritableEndpoint(address1, None, None, actorA) should ===(actorA) - reg.writableEndpointWithPolicyFor(address1) should be(Some(Pass(actorA, None, None))) - reg.readOnlyEndpointFor(address1) should be(None) - reg.isWritable(actorA) should be(true) - reg.isReadOnly(actorA) should be(false) + reg.writableEndpointWithPolicyFor(address1) should ===(Some(Pass(actorA, None, None))) + reg.readOnlyEndpointFor(address1) should ===(None) + reg.isWritable(actorA) should ===(true) + reg.isReadOnly(actorA) should ===(false) - reg.isQuarantined(address1, 42) should be(false) + reg.isQuarantined(address1, 42) should ===(false) } "be able to register a read-only endpoint" in { val reg = new EndpointRegistry - reg.readOnlyEndpointFor(address1) should be(None) + reg.readOnlyEndpointFor(address1) should ===(None) - reg.registerReadOnlyEndpoint(address1, actorA) should be(actorA) + reg.registerReadOnlyEndpoint(address1, actorA) should ===(actorA) - reg.readOnlyEndpointFor(address1) should be(Some(actorA)) - reg.writableEndpointWithPolicyFor(address1) should be(None) - reg.isWritable(actorA) should be(false) - reg.isReadOnly(actorA) should be(true) - reg.isQuarantined(address1, 42) should be(false) + reg.readOnlyEndpointFor(address1) should ===(Some(actorA)) + reg.writableEndpointWithPolicyFor(address1) should ===(None) + reg.isWritable(actorA) should ===(false) + reg.isReadOnly(actorA) should ===(true) + reg.isQuarantined(address1, 42) should ===(false) } "be able to register a writable and a read-only endpoint correctly" in { val reg = new EndpointRegistry - reg.readOnlyEndpointFor(address1) should be(None) - reg.writableEndpointWithPolicyFor(address1) should be(None) + reg.readOnlyEndpointFor(address1) should ===(None) + reg.writableEndpointWithPolicyFor(address1) should ===(None) - reg.registerReadOnlyEndpoint(address1, actorA) should be(actorA) - reg.registerWritableEndpoint(address1, None, None, actorB) should be(actorB) + reg.registerReadOnlyEndpoint(address1, actorA) should ===(actorA) + reg.registerWritableEndpoint(address1, None, None, actorB) should ===(actorB) - reg.readOnlyEndpointFor(address1) should be(Some(actorA)) - reg.writableEndpointWithPolicyFor(address1) should be(Some(Pass(actorB, None, None))) + reg.readOnlyEndpointFor(address1) should ===(Some(actorA)) + reg.writableEndpointWithPolicyFor(address1) should ===(Some(Pass(actorB, None, None))) - reg.isWritable(actorA) should be(false) - reg.isWritable(actorB) should be(true) + reg.isWritable(actorA) should ===(false) + reg.isWritable(actorB) should ===(true) - reg.isReadOnly(actorA) should be(true) - reg.isReadOnly(actorB) should be(false) + reg.isReadOnly(actorA) should ===(true) + reg.isReadOnly(actorB) should ===(false) } "be able to register Gated policy for an address" in { val reg = new EndpointRegistry - reg.writableEndpointWithPolicyFor(address1) should be(None) + reg.writableEndpointWithPolicyFor(address1) should ===(None) reg.registerWritableEndpoint(address1, None, None, actorA) val deadline = Deadline.now reg.markAsFailed(actorA, deadline) - reg.writableEndpointWithPolicyFor(address1) should be(Some(Gated(deadline))) - reg.isReadOnly(actorA) should be(false) - reg.isWritable(actorA) should be(false) + reg.writableEndpointWithPolicyFor(address1) should ===(Some(Gated(deadline))) + reg.isReadOnly(actorA) should ===(false) + reg.isWritable(actorA) should ===(false) } "remove read-only endpoints if marked as failed" in { @@ -79,7 +79,7 @@ class EndpointRegistrySpec extends AkkaSpec { reg.registerReadOnlyEndpoint(address1, actorA) reg.markAsFailed(actorA, Deadline.now) - reg.readOnlyEndpointFor(address1) should be(None) + reg.readOnlyEndpointFor(address1) should ===(None) } "keep tombstones when removing an endpoint" in { @@ -94,8 +94,8 @@ class EndpointRegistrySpec extends AkkaSpec { reg.unregisterEndpoint(actorA) reg.unregisterEndpoint(actorB) - reg.writableEndpointWithPolicyFor(address1) should be(Some(Gated(deadline))) - reg.writableEndpointWithPolicyFor(address2) should be(Some(Quarantined(42, deadline))) + reg.writableEndpointWithPolicyFor(address1) should ===(Some(Gated(deadline))) + reg.writableEndpointWithPolicyFor(address2) should ===(Some(Quarantined(42, deadline))) } @@ -109,19 +109,19 @@ class EndpointRegistrySpec extends AkkaSpec { reg.markAsFailed(actorB, farInTheFuture) reg.prune() - reg.writableEndpointWithPolicyFor(address1) should be(None) - reg.writableEndpointWithPolicyFor(address2) should be(Some(Gated(farInTheFuture))) + reg.writableEndpointWithPolicyFor(address1) should ===(None) + reg.writableEndpointWithPolicyFor(address2) should ===(Some(Gated(farInTheFuture))) } "be able to register Quarantined policy for an address" in { val reg = new EndpointRegistry val deadline = Deadline.now + 30.minutes - reg.writableEndpointWithPolicyFor(address1) should be(None) + reg.writableEndpointWithPolicyFor(address1) should ===(None) reg.markAsQuarantined(address1, 42, deadline) - reg.isQuarantined(address1, 42) should be(true) - reg.isQuarantined(address1, 33) should be(false) - reg.writableEndpointWithPolicyFor(address1) should be(Some(Quarantined(42, deadline))) + reg.isQuarantined(address1, 42) should ===(true) + reg.isQuarantined(address1, 33) should ===(false) + reg.writableEndpointWithPolicyFor(address1) should ===(Some(Quarantined(42, deadline))) } } diff --git a/akka-remote/src/test/scala/akka/remote/FailureDetectorRegistrySpec.scala b/akka-remote/src/test/scala/akka/remote/FailureDetectorRegistrySpec.scala index 5ce115e8d1..a620de6726 100644 --- a/akka-remote/src/test/scala/akka/remote/FailureDetectorRegistrySpec.scala +++ b/akka-remote/src/test/scala/akka/remote/FailureDetectorRegistrySpec.scala @@ -52,7 +52,7 @@ class FailureDetectorRegistrySpec extends AkkaSpec("akka.loglevel = INFO") { fd.heartbeat("resource1") fd.heartbeat("resource1") - fd.isAvailable("resource1") should be(true) + fd.isAvailable("resource1") should ===(true) } "mark node as dead if heartbeat are missed" in { @@ -63,9 +63,9 @@ class FailureDetectorRegistrySpec extends AkkaSpec("akka.loglevel = INFO") { fd.heartbeat("resource1") //1000 fd.heartbeat("resource1") //1100 - fd.isAvailable("resource1") should be(true) //1200 + fd.isAvailable("resource1") should ===(true) //1200 fd.heartbeat("resource2") //5200, but unrelated resource - fd.isAvailable("resource1") should be(false) //8200 + fd.isAvailable("resource1") should ===(false) //8200 } "accept some configured missing heartbeats" in { @@ -76,9 +76,9 @@ class FailureDetectorRegistrySpec extends AkkaSpec("akka.loglevel = INFO") { fd.heartbeat("resource1") fd.heartbeat("resource1") fd.heartbeat("resource1") - fd.isAvailable("resource1") should be(true) + fd.isAvailable("resource1") should ===(true) fd.heartbeat("resource1") - fd.isAvailable("resource1") should be(true) + fd.isAvailable("resource1") should ===(true) } "fail after configured acceptable missing heartbeats" in { @@ -91,9 +91,9 @@ class FailureDetectorRegistrySpec extends AkkaSpec("akka.loglevel = INFO") { fd.heartbeat("resource1") fd.heartbeat("resource1") fd.heartbeat("resource1") - fd.isAvailable("resource1") should be(true) + fd.isAvailable("resource1") should ===(true) fd.heartbeat("resource1") - fd.isAvailable("resource1") should be(false) + fd.isAvailable("resource1") should ===(false) } "mark node as available after explicit removal of connection" in { @@ -103,37 +103,37 @@ class FailureDetectorRegistrySpec extends AkkaSpec("akka.loglevel = INFO") { fd.heartbeat("resource1") fd.heartbeat("resource1") fd.heartbeat("resource1") - fd.isAvailable("resource1") should be(true) + fd.isAvailable("resource1") should ===(true) fd.remove("resource1") - fd.isAvailable("resource1") should be(true) + fd.isAvailable("resource1") should ===(true) } "mark node as available after explicit removal of connection and receiving heartbeat again" in { val timeInterval = List[Long](0, 1000, 100, 1100, 1100, 1100, 1100, 1100, 100) val fd = createFailureDetectorRegistry(clock = fakeTimeGenerator(timeInterval)) - fd.isMonitoring("resource1") should be(false) + fd.isMonitoring("resource1") should ===(false) fd.heartbeat("resource1") //0 fd.heartbeat("resource1") //1000 fd.heartbeat("resource1") //1100 - fd.isAvailable("resource1") should be(true) //2200 - fd.isMonitoring("resource1") should be(true) + fd.isAvailable("resource1") should ===(true) //2200 + fd.isMonitoring("resource1") should ===(true) fd.remove("resource1") - fd.isMonitoring("resource1") should be(false) - fd.isAvailable("resource1") should be(true) //3300 + fd.isMonitoring("resource1") should ===(false) + fd.isAvailable("resource1") should ===(true) //3300 // it receives heartbeat from an explicitly removed node fd.heartbeat("resource1") //4400 fd.heartbeat("resource1") //5500 fd.heartbeat("resource1") //6600 - fd.isAvailable("resource1") should be(true) //6700 - fd.isMonitoring("resource1") should be(true) + fd.isAvailable("resource1") should ===(true) //6700 + fd.isMonitoring("resource1") should ===(true) } } diff --git a/akka-remote/src/test/scala/akka/remote/LogSourceSpec.scala b/akka-remote/src/test/scala/akka/remote/LogSourceSpec.scala index 25eb882cec..60ef20b6f2 100644 --- a/akka-remote/src/test/scala/akka/remote/LogSourceSpec.scala +++ b/akka-remote/src/test/scala/akka/remote/LogSourceSpec.scala @@ -48,7 +48,7 @@ class LogSourceSpec extends AkkaSpec( "should include host and port for local LogSource" in { reporter ! "hello" val info = logProbe.expectMsgType[Info] - info.message should be("hello") + info.message should ===("hello") val defaultAddress = system.asInstanceOf[ExtendedActorSystem].provider.getDefaultAddress info.logSource should include(defaultAddress.toString) } diff --git a/akka-remote/src/test/scala/akka/remote/RemoteConfigSpec.scala b/akka-remote/src/test/scala/akka/remote/RemoteConfigSpec.scala index 0cce4ea317..2b579e917b 100644 --- a/akka-remote/src/test/scala/akka/remote/RemoteConfigSpec.scala +++ b/akka-remote/src/test/scala/akka/remote/RemoteConfigSpec.scala @@ -25,53 +25,53 @@ class RemoteConfigSpec extends AkkaSpec( val remoteSettings = RARP(system).provider.remoteSettings import remoteSettings._ - LogReceive should be(false) - LogSend should be(false) - UntrustedMode should be(false) - TrustedSelectionPaths should be(Set.empty[String]) - ShutdownTimeout.duration should be(10 seconds) - FlushWait should be(2 seconds) - StartupTimeout.duration should be(10 seconds) - RetryGateClosedFor should be(5 seconds) - Dispatcher should be("akka.remote.default-remote-dispatcher") - UsePassiveConnections should be(true) - BackoffPeriod should be(5 millis) - LogBufferSizeExceeding should be(50000) - SysMsgAckTimeout should be(0.3 seconds) - SysResendTimeout should be(2 seconds) - SysMsgBufferSize should be(1000) - InitialSysMsgDeliveryTimeout should be(3 minutes) - QuarantineDuration should be(5 days) - CommandAckTimeout.duration should be(30 seconds) - Transports.size should be(1) - Transports.head._1 should be(classOf[akka.remote.transport.netty.NettyTransport].getName) - Transports.head._2 should be(Nil) - Adapters should be(Map( + LogReceive should ===(false) + LogSend should ===(false) + UntrustedMode should ===(false) + TrustedSelectionPaths should ===(Set.empty[String]) + ShutdownTimeout.duration should ===(10 seconds) + FlushWait should ===(2 seconds) + StartupTimeout.duration should ===(10 seconds) + RetryGateClosedFor should ===(5 seconds) + Dispatcher should ===("akka.remote.default-remote-dispatcher") + UsePassiveConnections should ===(true) + BackoffPeriod should ===(5 millis) + LogBufferSizeExceeding should ===(50000) + SysMsgAckTimeout should ===(0.3 seconds) + SysResendTimeout should ===(2 seconds) + SysMsgBufferSize should ===(1000) + InitialSysMsgDeliveryTimeout should ===(3 minutes) + QuarantineDuration should ===(5 days) + CommandAckTimeout.duration should ===(30 seconds) + Transports.size should ===(1) + Transports.head._1 should ===(classOf[akka.remote.transport.netty.NettyTransport].getName) + Transports.head._2 should ===(Nil) + Adapters should ===(Map( "gremlin" -> classOf[akka.remote.transport.FailureInjectorProvider].getName, "trttl" -> classOf[akka.remote.transport.ThrottlerProvider].getName)) - WatchFailureDetectorImplementationClass should be(classOf[PhiAccrualFailureDetector].getName) - WatchHeartBeatInterval should be(1 seconds) - WatchHeartbeatExpectedResponseAfter should be(3 seconds) - WatchUnreachableReaperInterval should be(1 second) - WatchFailureDetectorConfig.getDouble("threshold") should be(10.0 +- 0.0001) - WatchFailureDetectorConfig.getInt("max-sample-size") should be(200) - WatchFailureDetectorConfig.getMillisDuration("acceptable-heartbeat-pause") should be(10 seconds) - WatchFailureDetectorConfig.getMillisDuration("min-std-deviation") should be(100 millis) + WatchFailureDetectorImplementationClass should ===(classOf[PhiAccrualFailureDetector].getName) + WatchHeartBeatInterval should ===(1 seconds) + WatchHeartbeatExpectedResponseAfter should ===(3 seconds) + WatchUnreachableReaperInterval should ===(1 second) + WatchFailureDetectorConfig.getDouble("threshold") should ===(10.0 +- 0.0001) + WatchFailureDetectorConfig.getInt("max-sample-size") should ===(200) + WatchFailureDetectorConfig.getMillisDuration("acceptable-heartbeat-pause") should ===(10 seconds) + WatchFailureDetectorConfig.getMillisDuration("min-std-deviation") should ===(100 millis) - remoteSettings.config.getString("akka.remote.log-frame-size-exceeding") should be("off") + remoteSettings.config.getString("akka.remote.log-frame-size-exceeding") should ===("off") } "be able to parse AkkaProtocol related config elements" in { val settings = new AkkaProtocolSettings(RARP(system).provider.remoteSettings.config) import settings._ - RequireCookie should be(false) - SecureCookie should be(None) + RequireCookie should ===(false) + SecureCookie should ===(None) - TransportFailureDetectorImplementationClass should be(classOf[DeadlineFailureDetector].getName) - TransportHeartBeatInterval should be(4.seconds) - TransportFailureDetectorConfig.getMillisDuration("acceptable-heartbeat-pause") should be(20 seconds) + TransportFailureDetectorImplementationClass should ===(classOf[DeadlineFailureDetector].getName) + TransportHeartBeatInterval should ===(4.seconds) + TransportFailureDetectorConfig.getMillisDuration("acceptable-heartbeat-pause") should ===(20 seconds) } @@ -80,21 +80,21 @@ class RemoteConfigSpec extends AkkaSpec( val s = new NettyTransportSettings(c) import s._ - ConnectionTimeout should be(15.seconds) - WriteBufferHighWaterMark should be(None) - WriteBufferLowWaterMark should be(None) - SendBufferSize should be(Some(256000)) - ReceiveBufferSize should be(Some(256000)) - MaxFrameSize should be(128000) - Backlog should be(4096) - TcpNodelay should be(true) - TcpKeepalive should be(true) - TcpReuseAddr should be(!Helpers.isWindows) - c.getString("hostname") should be("") - c.getString("bind-hostname") should be("") - c.getString("bind-port") should be("") - ServerSocketWorkerPoolSize should be(2) - ClientSocketWorkerPoolSize should be(2) + ConnectionTimeout should ===(15.seconds) + WriteBufferHighWaterMark should ===(None) + WriteBufferLowWaterMark should ===(None) + SendBufferSize should ===(Some(256000)) + ReceiveBufferSize should ===(Some(256000)) + MaxFrameSize should ===(128000) + Backlog should ===(4096) + TcpNodelay should ===(true) + TcpKeepalive should ===(true) + TcpReuseAddr should ===(!Helpers.isWindows) + c.getString("hostname") should ===("") + c.getString("bind-hostname") should ===("") + c.getString("bind-port") should ===("") + ServerSocketWorkerPoolSize should ===(2) + ClientSocketWorkerPoolSize should ===(2) } "contain correct socket worker pool configuration values in reference.conf" in { @@ -103,37 +103,37 @@ class RemoteConfigSpec extends AkkaSpec( // server-socket-worker-pool { val pool = c.getConfig("server-socket-worker-pool") - pool.getInt("pool-size-min") should be(2) + pool.getInt("pool-size-min") should ===(2) - pool.getDouble("pool-size-factor") should be(1.0) - pool.getInt("pool-size-max") should be(2) + pool.getDouble("pool-size-factor") should ===(1.0) + pool.getInt("pool-size-max") should ===(2) } // client-socket-worker-pool { val pool = c.getConfig("client-socket-worker-pool") - pool.getInt("pool-size-min") should be(2) - pool.getDouble("pool-size-factor") should be(1.0) - pool.getInt("pool-size-max") should be(2) + pool.getInt("pool-size-min") should ===(2) + pool.getDouble("pool-size-factor") should ===(1.0) + pool.getInt("pool-size-max") should ===(2) } } "contain correct ssl configuration values in reference.conf" in { val sslSettings = new SSLSettings(system.settings.config.getConfig("akka.remote.netty.ssl.security")) - sslSettings.SSLKeyStore should be(Some("keystore")) - sslSettings.SSLKeyStorePassword should be(Some("changeme")) - sslSettings.SSLKeyPassword should be(Some("changeme")) - sslSettings.SSLTrustStore should be(Some("truststore")) - sslSettings.SSLTrustStorePassword should be(Some("changeme")) - sslSettings.SSLProtocol should be(Some("TLSv1")) - sslSettings.SSLEnabledAlgorithms should be(Set("TLS_RSA_WITH_AES_128_CBC_SHA")) - sslSettings.SSLRandomNumberGenerator should be(None) + sslSettings.SSLKeyStore should ===(Some("keystore")) + sslSettings.SSLKeyStorePassword should ===(Some("changeme")) + sslSettings.SSLKeyPassword should ===(Some("changeme")) + sslSettings.SSLTrustStore should ===(Some("truststore")) + sslSettings.SSLTrustStorePassword should ===(Some("changeme")) + sslSettings.SSLProtocol should ===(Some("TLSv1")) + sslSettings.SSLEnabledAlgorithms should ===(Set("TLS_RSA_WITH_AES_128_CBC_SHA")) + sslSettings.SSLRandomNumberGenerator should ===(None) } "have debug logging of the failure injector turned off in reference.conf" in { val c = RARP(system).provider.remoteSettings.config.getConfig("akka.remote.gremlin") - c.getBoolean("debug") should be(false) + c.getBoolean("debug") should ===(false) } } } diff --git a/akka-remote/src/test/scala/akka/remote/RemoteConsistentHashingRouterSpec.scala b/akka-remote/src/test/scala/akka/remote/RemoteConsistentHashingRouterSpec.scala index e1ec1450ac..6ee8f01b3e 100644 --- a/akka-remote/src/test/scala/akka/remote/RemoteConsistentHashingRouterSpec.scala +++ b/akka-remote/src/test/scala/akka/remote/RemoteConsistentHashingRouterSpec.scala @@ -29,7 +29,7 @@ class RemoteConsistentHashingRouterSpec extends AkkaSpec(""" val keys = List("A", "B", "C", "D", "E", "F", "G") val result1 = keys collect { case k ⇒ consistentHash1.nodeFor(k).routee } val result2 = keys collect { case k ⇒ consistentHash2.nodeFor(k).routee } - result1 should be(result2) + result1 should ===(result2) } } diff --git a/akka-remote/src/test/scala/akka/remote/RemoteDeployerSpec.scala b/akka-remote/src/test/scala/akka/remote/RemoteDeployerSpec.scala index ea4e6db105..d58faeafc0 100644 --- a/akka-remote/src/test/scala/akka/remote/RemoteDeployerSpec.scala +++ b/akka-remote/src/test/scala/akka/remote/RemoteDeployerSpec.scala @@ -38,7 +38,7 @@ class RemoteDeployerSpec extends AkkaSpec(RemoteDeployerSpec.deployerConf) { val service = "/service2" val deployment = system.asInstanceOf[ActorSystemImpl].provider.deployer.lookup(service.split("/").drop(1)) - deployment should be(Some( + deployment should ===(Some( Deploy( service, deployment.get.config, @@ -50,7 +50,7 @@ class RemoteDeployerSpec extends AkkaSpec(RemoteDeployerSpec.deployerConf) { "reject remote deployment when the source requires LocalScope" in { intercept[ConfigurationException] { system.actorOf(Props.empty.withDeploy(Deploy.local), "service2") - }.getMessage should be("configuration requested remote deployment for local-only Props at [akka://RemoteDeployerSpec/user/service2]") + }.getMessage should ===("configuration requested remote deployment for local-only Props at [akka://RemoteDeployerSpec/user/service2]") } } diff --git a/akka-remote/src/test/scala/akka/remote/RemoteRouterSpec.scala b/akka-remote/src/test/scala/akka/remote/RemoteRouterSpec.scala index ad58700615..ff400fd085 100644 --- a/akka-remote/src/test/scala/akka/remote/RemoteRouterSpec.scala +++ b/akka-remote/src/test/scala/akka/remote/RemoteRouterSpec.scala @@ -88,7 +88,7 @@ class RemoteRouterSpec extends AkkaSpec(""" val children = replies.toSet children should have size 2 children.map(_.parent) should have size 1 - children foreach (_.address.toString should be(s"akka.tcp://${sysName}@localhost:${port}")) + children foreach (_.address.toString should ===(s"akka.tcp://${sysName}@localhost:${port}")) masterSystem.stop(router) } @@ -103,7 +103,7 @@ class RemoteRouterSpec extends AkkaSpec(""" val children = replies.toSet children should have size 2 children.map(_.parent) should have size 1 - children foreach (_.address.toString should be(s"akka.tcp://${sysName}@localhost:${port}")) + children foreach (_.address.toString should ===(s"akka.tcp://${sysName}@localhost:${port}")) masterSystem.stop(router) } @@ -117,14 +117,14 @@ class RemoteRouterSpec extends AkkaSpec(""" val children = replies.toSet children.size should be >= 2 children.map(_.parent) should have size 1 - children foreach (_.address.toString should be(s"akka.tcp://${sysName}@localhost:${port}")) + children foreach (_.address.toString should ===(s"akka.tcp://${sysName}@localhost:${port}")) masterSystem.stop(router) } "deploy remote routers based on configuration" in { val probe = TestProbe()(masterSystem) val router = masterSystem.actorOf(FromConfig.props(Props[Echo]), "remote-blub") - router.path.address.toString should be(s"akka.tcp://${sysName}@localhost:${port}") + router.path.address.toString should ===(s"akka.tcp://${sysName}@localhost:${port}") val replies = for (i ← 1 to 5) yield { router.tell("", probe.ref) probe.expectMsgType[ActorRef].path @@ -133,8 +133,8 @@ class RemoteRouterSpec extends AkkaSpec(""" children should have size 2 val parents = children.map(_.parent) parents should have size 1 - parents.head should be(router.path) - children foreach (_.address.toString should be(s"akka.tcp://${sysName}@localhost:${port}")) + parents.head should ===(router.path) + children foreach (_.address.toString should ===(s"akka.tcp://${sysName}@localhost:${port}")) masterSystem.stop(router) } @@ -142,7 +142,7 @@ class RemoteRouterSpec extends AkkaSpec(""" val probe = TestProbe()(masterSystem) val router = masterSystem.actorOf(RoundRobinPool(2).props(Props[Echo]) .withDeploy(Deploy(scope = RemoteScope(AddressFromURIString(s"akka.tcp://${sysName}@localhost:${port}")))), "remote-blub2") - router.path.address.toString should be(s"akka.tcp://${sysName}@localhost:${port}") + router.path.address.toString should ===(s"akka.tcp://${sysName}@localhost:${port}") val replies = for (i ← 1 to 5) yield { router.tell("", probe.ref) probe.expectMsgType[ActorRef].path @@ -151,8 +151,8 @@ class RemoteRouterSpec extends AkkaSpec(""" children should have size 2 val parents = children.map(_.parent) parents should have size 1 - parents.head should be(router.path) - children foreach (_.address.toString should be(s"akka.tcp://${sysName}@localhost:${port}")) + parents.head should ===(router.path) + children foreach (_.address.toString should ===(s"akka.tcp://${sysName}@localhost:${port}")) masterSystem.stop(router) } @@ -160,7 +160,7 @@ class RemoteRouterSpec extends AkkaSpec(""" val probe = TestProbe()(masterSystem) val router = masterSystem.actorOf(RoundRobinPool(2).props(Props[Echo]) .withDeploy(Deploy(scope = RemoteScope(AddressFromURIString(s"akka.tcp://${sysName}@localhost:${port}")))), "local-blub") - router.path.address.toString should be("akka://MasterRemoteRouterSpec") + router.path.address.toString should ===("akka://MasterRemoteRouterSpec") val replies = for (i ← 1 to 5) yield { router.tell("", probe.ref) probe.expectMsgType[ActorRef].path @@ -169,8 +169,8 @@ class RemoteRouterSpec extends AkkaSpec(""" children should have size 2 val parents = children.map(_.parent) parents should have size 1 - parents.head.address should be(Address("akka.tcp", sysName, "localhost", port)) - children foreach (_.address.toString should be(s"akka.tcp://${sysName}@localhost:${port}")) + parents.head.address should ===(Address("akka.tcp", sysName, "localhost", port)) + children foreach (_.address.toString should ===(s"akka.tcp://${sysName}@localhost:${port}")) masterSystem.stop(router) } @@ -178,7 +178,7 @@ class RemoteRouterSpec extends AkkaSpec(""" val probe = TestProbe()(masterSystem) val router = masterSystem.actorOf(RoundRobinPool(2).props(Props[Echo]) .withDeploy(Deploy(scope = RemoteScope(AddressFromURIString(s"akka.tcp://${sysName}@localhost:${port}")))), "local-blub2") - router.path.address.toString should be(s"akka.tcp://${sysName}@localhost:${port}") + router.path.address.toString should ===(s"akka.tcp://${sysName}@localhost:${port}") val replies = for (i ← 1 to 5) yield { router.tell("", probe.ref) probe.expectMsgType[ActorRef].path @@ -187,8 +187,8 @@ class RemoteRouterSpec extends AkkaSpec(""" children should have size 4 val parents = children.map(_.parent) parents should have size 1 - parents.head should be(router.path) - children foreach (_.address.toString should be(s"akka.tcp://${sysName}@localhost:${port}")) + parents.head should ===(router.path) + children foreach (_.address.toString should ===(s"akka.tcp://${sysName}@localhost:${port}")) masterSystem.stop(router) } @@ -196,7 +196,7 @@ class RemoteRouterSpec extends AkkaSpec(""" val probe = TestProbe()(masterSystem) val router = masterSystem.actorOf(RoundRobinPool(2).props(Props[Echo]) .withDeploy(Deploy(scope = RemoteScope(AddressFromURIString(s"akka.tcp://${sysName}@localhost:${port}")))), "remote-override") - router.path.address.toString should be(s"akka.tcp://${sysName}@localhost:${port}") + router.path.address.toString should ===(s"akka.tcp://${sysName}@localhost:${port}") val replies = for (i ← 1 to 5) yield { router.tell("", probe.ref) probe.expectMsgType[ActorRef].path @@ -205,8 +205,8 @@ class RemoteRouterSpec extends AkkaSpec(""" children should have size 4 val parents = children.map(_.parent) parents should have size 1 - parents.head should be(router.path) - children foreach (_.address.toString should be(s"akka.tcp://${sysName}@localhost:${port}")) + parents.head should ===(router.path) + children foreach (_.address.toString should ===(s"akka.tcp://${sysName}@localhost:${port}")) masterSystem.stop(router) } diff --git a/akka-remote/src/test/scala/akka/remote/RemotingSpec.scala b/akka-remote/src/test/scala/akka/remote/RemotingSpec.scala index adb2c117ab..1d313440ba 100644 --- a/akka-remote/src/test/scala/akka/remote/RemotingSpec.scala +++ b/akka-remote/src/test/scala/akka/remote/RemotingSpec.scala @@ -249,7 +249,7 @@ class RemotingSpec extends AkkaSpec(RemotingSpec.cfg) with ImplicitSender with D } within(5.seconds) { - receiveN(n * 2) foreach { reply ⇒ reply should be(("pong", testActor)) } + receiveN(n * 2) foreach { reply ⇒ reply should ===(("pong", testActor)) } } // then we shutdown all but one system to simulate broken connections @@ -264,13 +264,13 @@ class RemotingSpec extends AkkaSpec(RemotingSpec.cfg) with ImplicitSender with D // ping messages to aliveEcho should go through even though we use many different broken connections within(5.seconds) { - receiveN(n) foreach { reply ⇒ reply should be(("pong", testActor)) } + receiveN(n) foreach { reply ⇒ reply should ===(("pong", testActor)) } } } "create and supervise children on remote node" in { val r = system.actorOf(Props[Echo1], "blub") - r.path.toString should be("akka.test://remote-sys@localhost:12346/remote/akka.test/RemotingSpec@localhost:12345/user/blub") + r.path.toString should ===("akka.test://remote-sys@localhost:12346/remote/akka.test/RemotingSpec@localhost:12345/user/blub") r ! 42 expectMsg(42) EventFilter[Exception]("crash", occurrences = 1).intercept { @@ -326,16 +326,16 @@ class RemotingSpec extends AkkaSpec(RemotingSpec.cfg) with ImplicitSender with D // grandchild is configured to be deployed on RemotingSpec (system) child ! ((Props[Echo1], "grandchild")) val grandchild = expectMsgType[ActorRef] - grandchild.asInstanceOf[ActorRefScope].isLocal should be(true) + grandchild.asInstanceOf[ActorRefScope].isLocal should ===(true) grandchild ! 43 expectMsg(43) val myref = system.actorFor(system / "looker1" / "child" / "grandchild") - myref.isInstanceOf[RemoteActorRef] should be(true) + myref.isInstanceOf[RemoteActorRef] should ===(true) myref ! 44 expectMsg(44) - lastSender should be(grandchild) + lastSender should ===(grandchild) lastSender should be theSameInstanceAs grandchild - child.asInstanceOf[RemoteActorRef].getParent should be(l) + child.asInstanceOf[RemoteActorRef].getParent should ===(l) system.actorFor("/user/looker1/child") should be theSameInstanceAs child Await.result(l ? ActorForReq("child/.."), timeout.duration).asInstanceOf[AnyRef] should be theSameInstanceAs l Await.result(system.actorFor(system / "looker1" / "child") ? ActorForReq(".."), timeout.duration).asInstanceOf[AnyRef] should be theSameInstanceAs l @@ -369,19 +369,19 @@ class RemotingSpec extends AkkaSpec(RemotingSpec.cfg) with ImplicitSender with D // grandchild is configured to be deployed on RemotingSpec (system) child ! ((Props[Echo1], "grandchild")) val grandchild = expectMsgType[ActorRef] - grandchild.asInstanceOf[ActorRefScope].isLocal should be(true) + grandchild.asInstanceOf[ActorRefScope].isLocal should ===(true) grandchild ! 53 expectMsg(53) val mysel = system.actorSelection(system / "looker2" / "child" / "grandchild") mysel ! 54 expectMsg(54) - lastSender should be(grandchild) + lastSender should ===(grandchild) lastSender should be theSameInstanceAs grandchild mysel ! Identify(mysel) val grandchild2 = expectMsgType[ActorIdentity].ref - grandchild2 should be(Some(grandchild)) + grandchild2 should ===(Some(grandchild)) system.actorSelection("/user/looker2/child") ! Identify(None) - expectMsgType[ActorIdentity].ref should be(Some(child)) + expectMsgType[ActorIdentity].ref should ===(Some(child)) l ! ActorSelReq("child/..") expectMsgType[ActorSelection] ! Identify(None) expectMsgType[ActorIdentity].ref.get should be theSameInstanceAs l @@ -430,7 +430,7 @@ class RemotingSpec extends AkkaSpec(RemotingSpec.cfg) with ImplicitSender with D watch(child) child ! PoisonPill expectMsg("postStop") - expectMsgType[Terminated].actor should be(child) + expectMsgType[Terminated].actor should ===(child) l ! ((Props[Echo1], "child")) val child2 = expectMsgType[ActorRef] child2 ! Identify("idReq15") @@ -453,7 +453,7 @@ class RemotingSpec extends AkkaSpec(RemotingSpec.cfg) with ImplicitSender with D "not fail ask across node boundaries" in within(5.seconds) { import system.dispatcher val f = for (_ ← 1 to 1000) yield here ? "ping" mapTo manifest[(String, ActorRef)] - Await.result(Future.sequence(f), timeout.duration).map(_._1).toSet should be(Set("pong")) + Await.result(Future.sequence(f), timeout.duration).map(_._1).toSet should ===(Set("pong")) } "be able to use multiple transports and use the appropriate one (TCP)" in { diff --git a/akka-remote/src/test/scala/akka/remote/SerializationChecksPlainRemotingSpec.scala b/akka-remote/src/test/scala/akka/remote/SerializationChecksPlainRemotingSpec.scala index 369ef6b9fd..6cf24a85fd 100644 --- a/akka-remote/src/test/scala/akka/remote/SerializationChecksPlainRemotingSpec.scala +++ b/akka-remote/src/test/scala/akka/remote/SerializationChecksPlainRemotingSpec.scala @@ -10,8 +10,8 @@ class SerializationChecksPlainRemotingSpec extends AkkaSpec { "Settings serialize-messages and serialize-creators" must { "be on for tests" in { - system.settings.SerializeAllCreators should be(true) - system.settings.SerializeAllMessages should be(true) + system.settings.SerializeAllCreators should ===(true) + system.settings.SerializeAllMessages should ===(true) } } diff --git a/akka-remote/src/test/scala/akka/remote/SerializeCreatorsVerificationSpec.scala b/akka-remote/src/test/scala/akka/remote/SerializeCreatorsVerificationSpec.scala index ca945434a1..4fa72b9666 100644 --- a/akka-remote/src/test/scala/akka/remote/SerializeCreatorsVerificationSpec.scala +++ b/akka-remote/src/test/scala/akka/remote/SerializeCreatorsVerificationSpec.scala @@ -9,7 +9,7 @@ import akka.testkit.AkkaSpec class SerializeCreatorsVerificationSpec extends AkkaSpec { "serialize-creators should be on" in { - system.settings.SerializeAllCreators should be(true) + system.settings.SerializeAllCreators should ===(true) } } \ No newline at end of file diff --git a/akka-remote/src/test/scala/akka/remote/Ticket1978CommunicationSpec.scala b/akka-remote/src/test/scala/akka/remote/Ticket1978CommunicationSpec.scala index 4138ee62da..91c718826c 100644 --- a/akka-remote/src/test/scala/akka/remote/Ticket1978CommunicationSpec.scala +++ b/akka-remote/src/test/scala/akka/remote/Ticket1978CommunicationSpec.scala @@ -173,7 +173,7 @@ abstract class Ticket1978CommunicationSpec(val cipherConfig: CipherConfig) exten } val f = for (i ← 1 to 1000) yield here ? (("ping", i)) mapTo classTag[((String, Int), ActorRef)] - Await.result(Future.sequence(f), remaining).map(_._1._1).toSet should be(Set("pong")) + Await.result(Future.sequence(f), remaining).map(_._1._1).toSet should ===(Set("pong")) } } else { diff --git a/akka-remote/src/test/scala/akka/remote/Ticket1978ConfigSpec.scala b/akka-remote/src/test/scala/akka/remote/Ticket1978ConfigSpec.scala index 92a44c1848..a135248839 100644 --- a/akka-remote/src/test/scala/akka/remote/Ticket1978ConfigSpec.scala +++ b/akka-remote/src/test/scala/akka/remote/Ticket1978ConfigSpec.scala @@ -18,14 +18,14 @@ class Ticket1978ConfigSpec extends AkkaSpec(""" "be able to parse these extra Netty config elements" in { val settings = new SSLSettings(system.settings.config.getConfig("akka.remote.netty.ssl.security")) - settings.SSLKeyStore should be(Some("keystore")) - settings.SSLKeyStorePassword should be(Some("changeme")) - settings.SSLKeyPassword should be(Some("changeme")) - settings.SSLTrustStore should be(Some("truststore")) - settings.SSLTrustStorePassword should be(Some("changeme")) - settings.SSLProtocol should be(Some("TLSv1")) - settings.SSLEnabledAlgorithms should be(Set("TLS_RSA_WITH_AES_128_CBC_SHA")) - settings.SSLRandomNumberGenerator should be(Some("AES128CounterSecureRNG")) + settings.SSLKeyStore should ===(Some("keystore")) + settings.SSLKeyStorePassword should ===(Some("changeme")) + settings.SSLKeyPassword should ===(Some("changeme")) + settings.SSLTrustStore should ===(Some("truststore")) + settings.SSLTrustStorePassword should ===(Some("changeme")) + settings.SSLProtocol should ===(Some("TLSv1")) + settings.SSLEnabledAlgorithms should ===(Set("TLS_RSA_WITH_AES_128_CBC_SHA")) + settings.SSLRandomNumberGenerator should ===(Some("AES128CounterSecureRNG")) } } } diff --git a/akka-remote/src/test/scala/akka/remote/TypedActorRemoteDeploySpec.scala b/akka-remote/src/test/scala/akka/remote/TypedActorRemoteDeploySpec.scala index 445b6e65ff..1a38124119 100644 --- a/akka-remote/src/test/scala/akka/remote/TypedActorRemoteDeploySpec.scala +++ b/akka-remote/src/test/scala/akka/remote/TypedActorRemoteDeploySpec.scala @@ -38,7 +38,7 @@ class TypedActorRemoteDeploySpec extends AkkaSpec(conf) { val ts = TypedActor(system) val echoService: RemoteNameService = ts.typedActorOf( TypedProps[RemoteNameServiceImpl].withDeploy(Deploy(scope = RemoteScope(remoteAddress)))) - Await.result(f(echoService), 3.seconds) should be(expected) + Await.result(f(echoService), 3.seconds) should ===(expected) val actor = ts.getActorRefFor(echoService) system.stop(actor) verifyActorTermination(actor) diff --git a/akka-remote/src/test/scala/akka/remote/serialization/DaemonMsgCreateSerializerSpec.scala b/akka-remote/src/test/scala/akka/remote/serialization/DaemonMsgCreateSerializerSpec.scala index dd221d3fed..bba19932ff 100644 --- a/akka-remote/src/test/scala/akka/remote/serialization/DaemonMsgCreateSerializerSpec.scala +++ b/akka-remote/src/test/scala/akka/remote/serialization/DaemonMsgCreateSerializerSpec.scala @@ -34,7 +34,7 @@ class DaemonMsgCreateSerializerSpec extends AkkaSpec { "Serialization" must { "resolve DaemonMsgCreateSerializer" in { - ser.serializerFor(classOf[DaemonMsgCreate]).getClass should be(classOf[DaemonMsgCreateSerializer]) + ser.serializerFor(classOf[DaemonMsgCreate]).getClass should ===(classOf[DaemonMsgCreateSerializer]) } "serialize and de-serialize DaemonMsgCreate with FromClassCreator" in { @@ -99,17 +99,17 @@ class DaemonMsgCreateSerializerSpec extends AkkaSpec { def assertDaemonMsgCreate(expected: DaemonMsgCreate, got: DaemonMsgCreate): Unit = { // can't compare props.creator when function - assert(got.props.clazz === expected.props.clazz) - assert(got.props.args.length === expected.props.args.length) + got.props.clazz should ===(expected.props.clazz) + got.props.args.length should ===(expected.props.args.length) got.props.args zip expected.props.args foreach { case (g, e) ⇒ if (e.isInstanceOf[Function0[_]]) () - else assert(g === e) + else g should ===(e) } - assert(got.props.deploy === expected.props.deploy) - assert(got.deploy === expected.deploy) - assert(got.path === expected.path) - assert(got.supervisor === expected.supervisor) + got.props.deploy should ===(expected.props.deploy) + got.deploy should ===(expected.deploy) + got.path should ===(expected.path) + got.supervisor should ===(expected.supervisor) } } diff --git a/akka-remote/src/test/scala/akka/remote/serialization/MessageContainerSerializerSpec.scala b/akka-remote/src/test/scala/akka/remote/serialization/MessageContainerSerializerSpec.scala index f3a3e0b75f..ce213fbaf9 100644 --- a/akka-remote/src/test/scala/akka/remote/serialization/MessageContainerSerializerSpec.scala +++ b/akka-remote/src/test/scala/akka/remote/serialization/MessageContainerSerializerSpec.scala @@ -21,7 +21,7 @@ class MessageContainerSerializerSpec extends AkkaSpec { "DaemonMsgCreateSerializer" must { "resolve serializer for ActorSelectionMessage" in { - ser.serializerFor(classOf[ActorSelectionMessage]).getClass should be(classOf[MessageContainerSerializer]) + ser.serializerFor(classOf[ActorSelectionMessage]).getClass should ===(classOf[MessageContainerSerializer]) } "serialize and de-serialize ActorSelectionMessage" in { @@ -31,7 +31,7 @@ class MessageContainerSerializerSpec extends AkkaSpec { } def verifySerialization(msg: AnyRef): Unit = { - ser.deserialize(ser.serialize(msg).get, msg.getClass).get should be(msg) + ser.deserialize(ser.serialize(msg).get, msg.getClass).get should ===(msg) } } diff --git a/akka-remote/src/test/scala/akka/remote/serialization/ProtobufSerializerSpec.scala b/akka-remote/src/test/scala/akka/remote/serialization/ProtobufSerializerSpec.scala index eac13dbfd8..4602be8901 100644 --- a/akka-remote/src/test/scala/akka/remote/serialization/ProtobufSerializerSpec.scala +++ b/akka-remote/src/test/scala/akka/remote/serialization/ProtobufSerializerSpec.scala @@ -17,8 +17,8 @@ class ProtobufSerializerSpec extends AkkaSpec { "Serialization" must { "resolve protobuf serializer" in { - ser.serializerFor(classOf[SerializedMessage]).getClass should be(classOf[ProtobufSerializer]) - ser.serializerFor(classOf[MyMessage]).getClass should be(classOf[ProtobufSerializer]) + ser.serializerFor(classOf[SerializedMessage]).getClass should ===(classOf[ProtobufSerializer]) + ser.serializerFor(classOf[MyMessage]).getClass should ===(classOf[ProtobufSerializer]) } } diff --git a/akka-remote/src/test/scala/akka/remote/transport/AkkaProtocolSpec.scala b/akka-remote/src/test/scala/akka/remote/transport/AkkaProtocolSpec.scala index e4ec85c2c9..e60902fd2c 100644 --- a/akka-remote/src/test/scala/akka/remote/transport/AkkaProtocolSpec.scala +++ b/akka-remote/src/test/scala/akka/remote/transport/AkkaProtocolSpec.scala @@ -152,13 +152,13 @@ class AkkaProtocolSpec extends AkkaSpec("""akka.actor.provider = "akka.remote.Re val wrappedHandle = expectMsgPF() { case InboundAssociation(h: AkkaProtocolHandle) ⇒ - h.handshakeInfo.uid should be(33) + h.handshakeInfo.uid should ===(33) h } wrappedHandle.readHandlerPromise.success(ActorHandleEventListener(testActor)) - failureDetector.called should be(true) + failureDetector.called should ===(true) // Heartbeat was sent in response to Associate awaitCond(lastActivityIsHeartbeat(registry)) @@ -166,7 +166,7 @@ class AkkaProtocolSpec extends AkkaSpec("""akka.actor.provider = "akka.remote.Re reader ! testPayload expectMsgPF() { - case InboundPayload(p) ⇒ p should be(testEnvelope) + case InboundPayload(p) ⇒ p should ===(testEnvelope) } } @@ -210,21 +210,21 @@ class AkkaProtocolSpec extends AkkaSpec("""akka.actor.provider = "akka.remote.Re refuseUid = None)) awaitCond(lastActivityIsAssociate(registry, 42, None)) - failureDetector.called should be(true) + failureDetector.called should ===(true) // keeps sending heartbeats awaitCond(lastActivityIsHeartbeat(registry)) - statusPromise.isCompleted should be(false) + statusPromise.isCompleted should ===(false) // finish connection by sending back an associate message reader ! testAssociate(33, None) Await.result(statusPromise.future, 3.seconds) match { case h: AkkaProtocolHandle ⇒ - h.remoteAddress should be(remoteAkkaAddress) - h.localAddress should be(localAkkaAddress) - h.handshakeInfo.uid should be(33) + h.remoteAddress should ===(remoteAkkaAddress) + h.localAddress should ===(localAkkaAddress) + h.handshakeInfo.uid should ===(33) case _ ⇒ fail() } @@ -266,14 +266,14 @@ class AkkaProtocolSpec extends AkkaSpec("""akka.actor.provider = "akka.remote.Re val wrappedHandle = expectMsgPF() { case InboundAssociation(h: AkkaProtocolHandle) ⇒ - h.handshakeInfo.uid should be(33) - h.handshakeInfo.cookie should be(Some("abcde")) + h.handshakeInfo.uid should ===(33) + h.handshakeInfo.cookie should ===(Some("abcde")) h } wrappedHandle.readHandlerPromise.success(ActorHandleEventListener(testActor)) - failureDetector.called should be(true) + failureDetector.called should ===(true) // Heartbeat was sent in response to Associate awaitCond(lastActivityIsHeartbeat(registry)) @@ -320,8 +320,8 @@ class AkkaProtocolSpec extends AkkaSpec("""akka.actor.provider = "akka.remote.Re val wrappedHandle = Await.result(statusPromise.future, 3.seconds) match { case h: AssociationHandle ⇒ - h.remoteAddress should be(remoteAkkaAddress) - h.localAddress should be(localAkkaAddress) + h.remoteAddress should ===(remoteAkkaAddress) + h.localAddress should ===(localAkkaAddress) h case _ ⇒ fail() @@ -356,8 +356,8 @@ class AkkaProtocolSpec extends AkkaSpec("""akka.actor.provider = "akka.remote.Re val wrappedHandle = Await.result(statusPromise.future, 3.seconds) match { case h: AssociationHandle ⇒ - h.remoteAddress should be(remoteAkkaAddress) - h.localAddress should be(localAkkaAddress) + h.remoteAddress should ===(remoteAkkaAddress) + h.localAddress should ===(localAkkaAddress) h case _ ⇒ fail() @@ -392,8 +392,8 @@ class AkkaProtocolSpec extends AkkaSpec("""akka.actor.provider = "akka.remote.Re val wrappedHandle = Await.result(statusPromise.future, 3.seconds) match { case h: AssociationHandle ⇒ - h.remoteAddress should be(remoteAkkaAddress) - h.localAddress should be(localAkkaAddress) + h.remoteAddress should ===(remoteAkkaAddress) + h.localAddress should ===(localAkkaAddress) h case _ ⇒ fail() @@ -431,8 +431,8 @@ class AkkaProtocolSpec extends AkkaSpec("""akka.actor.provider = "akka.remote.Re val wrappedHandle = Await.result(statusPromise.future, 3.seconds) match { case h: AssociationHandle ⇒ - h.remoteAddress should be(remoteAkkaAddress) - h.localAddress should be(localAkkaAddress) + h.remoteAddress should ===(remoteAkkaAddress) + h.localAddress should ===(localAkkaAddress) h case _ ⇒ fail() diff --git a/akka-remote/src/test/scala/akka/remote/transport/GenericTransportSpec.scala b/akka-remote/src/test/scala/akka/remote/transport/GenericTransportSpec.scala index e603414f12..ee16681b7e 100644 --- a/akka-remote/src/test/scala/akka/remote/transport/GenericTransportSpec.scala +++ b/akka-remote/src/test/scala/akka/remote/transport/GenericTransportSpec.scala @@ -44,13 +44,13 @@ abstract class GenericTransportSpec(withAkkaProtocol: Boolean = false) val result = Await.result(transportA.listen, timeout.duration) - result._1 should be(addressA) + result._1 should ===(addressA) result._2 should not be null registry.logSnapshot.exists { case ListenAttempt(address) ⇒ address == addressATest case _ ⇒ false - } should be(true) + } should ===(true) } "associate successfully with another transport of its kind" in { @@ -69,7 +69,7 @@ abstract class GenericTransportSpec(withAkkaProtocol: Boolean = false) case InboundAssociation(handle) if handle.remoteAddress == addressA ⇒ } - registry.logSnapshot.contains(AssociateAttempt(addressATest, addressBTest)) should be(true) + registry.logSnapshot.contains(AssociateAttempt(addressATest, addressBTest)) should ===(true) awaitCond(registry.existsAssociation(addressATest, addressBTest)) } @@ -118,7 +118,7 @@ abstract class GenericTransportSpec(withAkkaProtocol: Boolean = false) registry.logSnapshot.exists { case WriteAttempt(`addressATest`, `addressBTest`, sentPdu) ⇒ sentPdu == pdu case _ ⇒ false - } should be(true) + } should ===(true) } "successfully disassociate" in { diff --git a/akka-remote/src/test/scala/akka/remote/transport/SwitchableLoggedBehaviorSpec.scala b/akka-remote/src/test/scala/akka/remote/transport/SwitchableLoggedBehaviorSpec.scala index 0df3e78dbb..42abdaf79e 100644 --- a/akka-remote/src/test/scala/akka/remote/transport/SwitchableLoggedBehaviorSpec.scala +++ b/akka-remote/src/test/scala/akka/remote/transport/SwitchableLoggedBehaviorSpec.scala @@ -21,14 +21,14 @@ class SwitchableLoggedBehaviorSpec extends AkkaSpec with DefaultTimeout { "execute default behavior" in { val behavior = defaultBehavior - Await.result(behavior(()), timeout.duration) should be(3) + Await.result(behavior(()), timeout.duration) should ===(3) } "be able to push generic behavior" in { val behavior = defaultBehavior behavior.push((_) ⇒ Promise.successful(4).future) - Await.result(behavior(()), timeout.duration) should be(4) + Await.result(behavior(()), timeout.duration) should ===(4) behavior.push((_) ⇒ Promise.failed(TestException).future) behavior(()).value match { @@ -41,8 +41,8 @@ class SwitchableLoggedBehaviorSpec extends AkkaSpec with DefaultTimeout { val behavior = defaultBehavior behavior.pushConstant(5) - Await.result(behavior(()), timeout.duration) should be(5) - Await.result(behavior(()), timeout.duration) should be(5) + Await.result(behavior(()), timeout.duration) should ===(5) + Await.result(behavior(()), timeout.duration) should ===(5) } "be able to push failure behavior" in { @@ -59,16 +59,16 @@ class SwitchableLoggedBehaviorSpec extends AkkaSpec with DefaultTimeout { val behavior = defaultBehavior behavior.pushConstant(5) - Await.result(behavior(()), timeout.duration) should be(5) + Await.result(behavior(()), timeout.duration) should ===(5) behavior.pushConstant(7) - Await.result(behavior(()), timeout.duration) should be(7) + Await.result(behavior(()), timeout.duration) should ===(7) behavior.pop() - Await.result(behavior(()), timeout.duration) should be(5) + Await.result(behavior(()), timeout.duration) should ===(5) behavior.pop() - Await.result(behavior(()), timeout.duration) should be(3) + Await.result(behavior(()), timeout.duration) should ===(3) } @@ -78,7 +78,7 @@ class SwitchableLoggedBehaviorSpec extends AkkaSpec with DefaultTimeout { behavior.pop() behavior.pop() - Await.result(behavior(()), timeout.duration) should be(3) + Await.result(behavior(()), timeout.duration) should ===(3) } "enable delayed completition" in { @@ -86,7 +86,7 @@ class SwitchableLoggedBehaviorSpec extends AkkaSpec with DefaultTimeout { val controlPromise = behavior.pushDelayed val f = behavior(()) - f.isCompleted should be(false) + f.isCompleted should ===(false) controlPromise.success(()) awaitCond(f.isCompleted) @@ -97,7 +97,7 @@ class SwitchableLoggedBehaviorSpec extends AkkaSpec with DefaultTimeout { val behavior = new SwitchableLoggedBehavior[Int, Int]((i) ⇒ Promise.successful(3).future, (i) ⇒ logPromise.success(i)) behavior(11) - Await.result(logPromise.future, timeout.duration) should be(11) + Await.result(logPromise.future, timeout.duration) should ===(11) } } diff --git a/akka-remote/src/test/scala/akka/remote/transport/TestTransportSpec.scala b/akka-remote/src/test/scala/akka/remote/transport/TestTransportSpec.scala index 8c8f7e0269..55ce5dff2f 100644 --- a/akka-remote/src/test/scala/akka/remote/transport/TestTransportSpec.scala +++ b/akka-remote/src/test/scala/akka/remote/transport/TestTransportSpec.scala @@ -22,13 +22,13 @@ class TestTransportSpec extends AkkaSpec with DefaultTimeout with ImplicitSender val result = Await.result(transportA.listen, timeout.duration) - result._1 should be(addressA) + result._1 should ===(addressA) result._2 should not be null registry.logSnapshot.exists { case ListenAttempt(address) ⇒ address == addressA case _ ⇒ false - } should be(true) + } should ===(true) } "associate successfully with another TestTransport and log" in { @@ -47,7 +47,7 @@ class TestTransportSpec extends AkkaSpec with DefaultTimeout with ImplicitSender case InboundAssociation(handle) if handle.remoteAddress == addressA ⇒ } - registry.logSnapshot.contains(AssociateAttempt(addressA, addressB)) should be(true) + registry.logSnapshot.contains(AssociateAttempt(addressA, addressB)) should ===(true) } "fail to associate with nonexisting address" in { @@ -95,7 +95,7 @@ class TestTransportSpec extends AkkaSpec with DefaultTimeout with ImplicitSender case WriteAttempt(sender, recipient, payload) ⇒ sender == addressA && recipient == addressB && payload == akkaPDU case _ ⇒ false - } should be(true) + } should ===(true) } "emulate disassociation and log it" in { @@ -132,7 +132,7 @@ class TestTransportSpec extends AkkaSpec with DefaultTimeout with ImplicitSender registry.logSnapshot exists { case DisassociateAttempt(requester, remote) if requester == addressA && remote == addressB ⇒ true case _ ⇒ false - } should be(true) + } should ===(true) } } diff --git a/akka-remote/src/test/scala/akka/remote/transport/ThrottleModeSpec.scala b/akka-remote/src/test/scala/akka/remote/transport/ThrottleModeSpec.scala index 5be02e8a0a..c25b6f942b 100644 --- a/akka-remote/src/test/scala/akka/remote/transport/ThrottleModeSpec.scala +++ b/akka-remote/src/test/scala/akka/remote/transport/ThrottleModeSpec.scala @@ -12,85 +12,85 @@ class ThrottleModeSpec extends AkkaSpec { "allow consumption of infinite amount of tokens when untrhottled" in { val bucket = Unthrottled - bucket.tryConsumeTokens(0, 100) should be((Unthrottled, true)) - bucket.tryConsumeTokens(100000, 1000) should be((Unthrottled, true)) - bucket.tryConsumeTokens(1000000, 10000) should be((Unthrottled, true)) + bucket.tryConsumeTokens(0, 100) should ===((Unthrottled, true)) + bucket.tryConsumeTokens(100000, 1000) should ===((Unthrottled, true)) + bucket.tryConsumeTokens(1000000, 10000) should ===((Unthrottled, true)) } "in tokenbucket mode allow consuming tokens up to capacity" in { val bucket = TokenBucket(capacity = 100, tokensPerSecond = 100, nanoTimeOfLastSend = 0L, availableTokens = 100) val (bucket1, success1) = bucket.tryConsumeTokens(nanoTimeOfSend = 0L, 10) - bucket1 should be(TokenBucket(100, 100, 0, 90)) - success1 should be(true) + bucket1 should ===(TokenBucket(100, 100, 0, 90)) + success1 should ===(true) val (bucket2, success2) = bucket1.tryConsumeTokens(nanoTimeOfSend = 0L, 40) - bucket2 should be(TokenBucket(100, 100, 0, 50)) - success2 should be(true) + bucket2 should ===(TokenBucket(100, 100, 0, 50)) + success2 should ===(true) val (bucket3, success3) = bucket2.tryConsumeTokens(nanoTimeOfSend = 0L, 50) - bucket3 should be(TokenBucket(100, 100, 0, 0)) - success3 should be(true) + bucket3 should ===(TokenBucket(100, 100, 0, 0)) + success3 should ===(true) val (bucket4, success4) = bucket3.tryConsumeTokens(nanoTimeOfSend = 0, 1) - bucket4 should be(TokenBucket(100, 100, 0, 0)) - success4 should be(false) + bucket4 should ===(TokenBucket(100, 100, 0, 0)) + success4 should ===(false) } "accurately replenish tokens" in { val bucket = TokenBucket(capacity = 100, tokensPerSecond = 100, nanoTimeOfLastSend = 0L, availableTokens = 0) val (bucket1, success1) = bucket.tryConsumeTokens(nanoTimeOfSend = 0L, 0) - bucket1 should be(TokenBucket(100, 100, 0, 0)) - success1 should be(true) + bucket1 should ===(TokenBucket(100, 100, 0, 0)) + success1 should ===(true) val (bucket2, success2) = bucket1.tryConsumeTokens(nanoTimeOfSend = halfSecond, 0) - bucket2 should be(TokenBucket(100, 100, halfSecond, 50)) - success2 should be(true) + bucket2 should ===(TokenBucket(100, 100, halfSecond, 50)) + success2 should ===(true) val (bucket3, success3) = bucket2.tryConsumeTokens(nanoTimeOfSend = 2 * halfSecond, 0) - bucket3 should be(TokenBucket(100, 100, 2 * halfSecond, 100)) - success3 should be(true) + bucket3 should ===(TokenBucket(100, 100, 2 * halfSecond, 100)) + success3 should ===(true) val (bucket4, success4) = bucket3.tryConsumeTokens(nanoTimeOfSend = 3 * halfSecond, 0) - bucket4 should be(TokenBucket(100, 100, 3 * halfSecond, 100)) - success4 should be(true) + bucket4 should ===(TokenBucket(100, 100, 3 * halfSecond, 100)) + success4 should ===(true) } "accurately interleave replenish and consume" in { val bucket = TokenBucket(capacity = 100, tokensPerSecond = 100, nanoTimeOfLastSend = 0L, availableTokens = 20) val (bucket1, success1) = bucket.tryConsumeTokens(nanoTimeOfSend = 0L, 10) - bucket1 should be(TokenBucket(100, 100, 0, 10)) - success1 should be(true) + bucket1 should ===(TokenBucket(100, 100, 0, 10)) + success1 should ===(true) val (bucket2, success2) = bucket1.tryConsumeTokens(nanoTimeOfSend = halfSecond, 60) - bucket2 should be(TokenBucket(100, 100, halfSecond, 0)) - success2 should be(true) + bucket2 should ===(TokenBucket(100, 100, halfSecond, 0)) + success2 should ===(true) val (bucket3, success3) = bucket2.tryConsumeTokens(nanoTimeOfSend = 2 * halfSecond, 40) - bucket3 should be(TokenBucket(100, 100, 2 * halfSecond, 10)) - success3 should be(true) + bucket3 should ===(TokenBucket(100, 100, 2 * halfSecond, 10)) + success3 should ===(true) val (bucket4, success4) = bucket3.tryConsumeTokens(nanoTimeOfSend = 3 * halfSecond, 70) - bucket4 should be(TokenBucket(100, 100, 2 * halfSecond, 10)) - success4 should be(false) + bucket4 should ===(TokenBucket(100, 100, 2 * halfSecond, 10)) + success4 should ===(false) } "allow oversized packets through by loaning" in { val bucket = TokenBucket(capacity = 100, tokensPerSecond = 100, nanoTimeOfLastSend = 0L, availableTokens = 20) val (bucket1, success1) = bucket.tryConsumeTokens(nanoTimeOfSend = 0L, 30) - bucket1 should be(TokenBucket(100, 100, 0, 20)) - success1 should be(false) + bucket1 should ===(TokenBucket(100, 100, 0, 20)) + success1 should ===(false) val (bucket2, success2) = bucket1.tryConsumeTokens(nanoTimeOfSend = halfSecond, 110) - bucket2 should be(TokenBucket(100, 100, halfSecond, -40)) - success2 should be(true) + bucket2 should ===(TokenBucket(100, 100, halfSecond, -40)) + success2 should ===(true) val (bucket3, success3) = bucket2.tryConsumeTokens(nanoTimeOfSend = 2 * halfSecond, 20) - bucket3 should be(TokenBucket(100, 100, halfSecond, -40)) - success3 should be(false) + bucket3 should ===(TokenBucket(100, 100, halfSecond, -40)) + success3 should ===(false) val (bucket4, success4) = bucket3.tryConsumeTokens(nanoTimeOfSend = 3 * halfSecond, 20) - bucket4 should be(TokenBucket(100, 100, 3 * halfSecond, 40)) - success4 should be(true) + bucket4 should ===(TokenBucket(100, 100, 3 * halfSecond, 40)) + success4 should ===(true) } } diff --git a/akka-remote/src/test/scala/akka/remote/transport/ThrottlerTransportAdapterSpec.scala b/akka-remote/src/test/scala/akka/remote/transport/ThrottlerTransportAdapterSpec.scala index 6c1cfbe39a..a1e131f553 100644 --- a/akka-remote/src/test/scala/akka/remote/transport/ThrottlerTransportAdapterSpec.scala +++ b/akka-remote/src/test/scala/akka/remote/transport/ThrottlerTransportAdapterSpec.scala @@ -88,13 +88,13 @@ class ThrottlerTransportAdapterSpec extends AkkaSpec(configA) with ImplicitSende "ThrottlerTransportAdapter" must { "maintain average message rate" taggedAs TimingTest in { - throttle(Direction.Send, TokenBucket(200, 500, 0, 0)) should be(true) + throttle(Direction.Send, TokenBucket(200, 500, 0, 0)) should ===(true) val tester = system.actorOf(Props(classOf[ThrottlingTester], here, self)) ! "start" val time = NANOSECONDS.toSeconds(expectMsgType[Long]((TotalTime + 3).seconds)) log.warning("Total time of transmission: " + time) time should be > (TotalTime - 3) - throttle(Direction.Send, Unthrottled) should be(true) + throttle(Direction.Send, Unthrottled) should ===(true) } "survive blackholing" taggedAs TimingTest in { @@ -104,14 +104,14 @@ class ThrottlerTransportAdapterSpec extends AkkaSpec(configA) with ImplicitSende muteDeadLetters(classOf[Lost])(system) muteDeadLetters(classOf[Lost])(systemB) - throttle(Direction.Both, Blackhole) should be(true) + throttle(Direction.Both, Blackhole) should ===(true) here ! Lost("Blackhole 2") expectNoMsg(1.seconds) - disassociate() should be(true) + disassociate() should ===(true) expectNoMsg(1.seconds) - throttle(Direction.Both, Unthrottled) should be(true) + throttle(Direction.Both, Unthrottled) should ===(true) // after we remove the Blackhole we can't be certain of the state // of the connection, repeat until success diff --git a/akka-remote/src/test/scala/akka/remote/transport/netty/NettyTransportSpec.scala b/akka-remote/src/test/scala/akka/remote/transport/netty/NettyTransportSpec.scala index 49cc2f5b03..ce3665afb8 100644 --- a/akka-remote/src/test/scala/akka/remote/transport/netty/NettyTransportSpec.scala +++ b/akka-remote/src/test/scala/akka/remote/transport/netty/NettyTransportSpec.scala @@ -64,7 +64,7 @@ class NettyTransportSpec extends WordSpec with Matchers with BindBehaviour { """) implicit val sys = ActorSystem("sys", bindConfig.withFallback(commonConfig)) - getExternal should be(address.toAkkaAddress("akka.tcp")) + getExternal should ===(address.toAkkaAddress("akka.tcp")) getInternal should not contain (address.toAkkaAddress("tcp")) Await.result(sys.terminate(), Duration.Inf) @@ -81,7 +81,7 @@ class NettyTransportSpec extends WordSpec with Matchers with BindBehaviour { """) implicit val sys = ActorSystem("sys", bindConfig.withFallback(commonConfig)) - getExternal should be(address.toAkkaAddress("akka.tcp")) + getExternal should ===(address.toAkkaAddress("akka.tcp")) getInternal should contain(address.toAkkaAddress("tcp")) Await.result(sys.terminate(), Duration.Inf) @@ -98,7 +98,7 @@ class NettyTransportSpec extends WordSpec with Matchers with BindBehaviour { implicit val sys = ActorSystem("sys", bindConfig.withFallback(commonConfig)) getInternal should contain(getExternal.withProtocol("tcp")) - getInternal.size should be(2) + getInternal.size should ===(2) Await.result(sys.terminate(), Duration.Inf) } @@ -137,7 +137,7 @@ trait BindBehaviour { this: WordSpec with Matchers ⇒ """) implicit val sys = ActorSystem("sys", bindConfig.withFallback(commonConfig)) - getExternal should be(address.toAkkaAddress(s"akka.$proto")) + getExternal should ===(address.toAkkaAddress(s"akka.$proto")) getInternal should contain(address.toAkkaAddress(proto)) Await.result(sys.terminate(), Duration.Inf) @@ -161,7 +161,7 @@ trait BindBehaviour { this: WordSpec with Matchers ⇒ """) implicit val sys = ActorSystem("sys", bindConfig.withFallback(commonConfig)) - getExternal should be(address.toAkkaAddress(s"akka.$proto")) + getExternal should ===(address.toAkkaAddress(s"akka.$proto")) getInternal should contain(bindAddress.toAkkaAddress(proto)) Await.result(sys.terminate(), Duration.Inf) diff --git a/akka-testkit/src/test/scala/akka/testkit/AkkaSpec.scala b/akka-testkit/src/test/scala/akka/testkit/AkkaSpec.scala index e95a92e956..98bf10bc52 100644 --- a/akka-testkit/src/test/scala/akka/testkit/AkkaSpec.scala +++ b/akka-testkit/src/test/scala/akka/testkit/AkkaSpec.scala @@ -4,7 +4,6 @@ package akka.testkit import language.{ postfixOps, reflectiveCalls } - import org.scalatest.{ WordSpecLike, BeforeAndAfterAll } import org.scalatest.Matchers import akka.actor.ActorSystem @@ -14,6 +13,8 @@ import scala.concurrent.Future import com.typesafe.config.{ Config, ConfigFactory } import akka.dispatch.Dispatchers import akka.testkit.TestEvent._ +import org.scalautils.ConversionCheckedTripleEquals +import org.scalautils.Constraint object AkkaSpec { val testConf: Config = ConfigFactory.parseString(""" @@ -52,7 +53,8 @@ object AkkaSpec { } abstract class AkkaSpec(_system: ActorSystem) - extends TestKit(_system) with WordSpecLike with Matchers with BeforeAndAfterAll with WatchedByCoroner { + extends TestKit(_system) with WordSpecLike with Matchers with BeforeAndAfterAll with WatchedByCoroner + with ConversionCheckedTripleEquals { def this(config: Config) = this(ActorSystem(AkkaSpec.getCallerName(getClass), ConfigFactory.load(config.withFallback(AkkaSpec.testConf)))) @@ -98,4 +100,9 @@ abstract class AkkaSpec(_system: ActorSystem) else messageClasses foreach mute } + // for ScalaTest === compare of Class objects + implicit def classEqualityConstraint[A, B]: Constraint[Class[A], Class[B]] = + new Constraint[Class[A], Class[B]] { + def areEqual(a: Class[A], b: Class[B]) = a == b + } } diff --git a/akka-testkit/src/test/scala/akka/testkit/AkkaSpecSpec.scala b/akka-testkit/src/test/scala/akka/testkit/AkkaSpecSpec.scala index 12f3bd272e..edc0d1e2b0 100644 --- a/akka-testkit/src/test/scala/akka/testkit/AkkaSpecSpec.scala +++ b/akka-testkit/src/test/scala/akka/testkit/AkkaSpecSpec.scala @@ -87,7 +87,7 @@ class AkkaSpecSpec extends WordSpec with Matchers { system.registerOnTermination(latch.countDown()) TestKit.shutdownActorSystem(system) Await.ready(latch, 2 seconds) - Await.result(davyJones ? "Die!", timeout.duration) should be("finally gone") + Await.result(davyJones ? "Die!", timeout.duration) should ===("finally gone") // this will typically also contain log messages which were sent after the logger shutdown locker should contain(DeadLetter(42, davyJones, probe.ref)) diff --git a/akka-testkit/src/test/scala/akka/testkit/CoronerSpec.scala b/akka-testkit/src/test/scala/akka/testkit/CoronerSpec.scala index 23c6dca7cd..cd610e6b6e 100644 --- a/akka-testkit/src/test/scala/akka/testkit/CoronerSpec.scala +++ b/akka-testkit/src/test/scala/akka/testkit/CoronerSpec.scala @@ -40,7 +40,7 @@ class CoronerSpec extends WordSpec with Matchers { coroner.cancel() Await.ready(coroner, 1.seconds) }) - report should be("") + report should ===("") } "display thread counts if enabled" in { diff --git a/akka-testkit/src/test/scala/akka/testkit/DefaultTimeoutSpec.scala b/akka-testkit/src/test/scala/akka/testkit/DefaultTimeoutSpec.scala index d353defca6..7d43c9fad2 100644 --- a/akka-testkit/src/test/scala/akka/testkit/DefaultTimeoutSpec.scala +++ b/akka-testkit/src/test/scala/akka/testkit/DefaultTimeoutSpec.scala @@ -17,7 +17,7 @@ class DefaultTimeoutSpec "A spec with DefaultTimeout" should { "use timeout from settings" in { - timeout should be(testKitSettings.DefaultTimeout) + timeout should ===(testKitSettings.DefaultTimeout) } } } \ No newline at end of file diff --git a/akka-testkit/src/test/scala/akka/testkit/ImplicitSenderSpec.scala b/akka-testkit/src/test/scala/akka/testkit/ImplicitSenderSpec.scala index 78601b54e4..3120c08f9e 100644 --- a/akka-testkit/src/test/scala/akka/testkit/ImplicitSenderSpec.scala +++ b/akka-testkit/src/test/scala/akka/testkit/ImplicitSenderSpec.scala @@ -17,7 +17,7 @@ class ImplicitSenderSpec "An ImplicitSender" should { "have testActor as its self" in { - self should be(testActor) + self should ===(testActor) } } } \ No newline at end of file diff --git a/akka-testkit/src/test/scala/akka/testkit/JavaTestKitSpec.scala b/akka-testkit/src/test/scala/akka/testkit/JavaTestKitSpec.scala index 7810a43c68..a988c94c4d 100644 --- a/akka-testkit/src/test/scala/akka/testkit/JavaTestKitSpec.scala +++ b/akka-testkit/src/test/scala/akka/testkit/JavaTestKitSpec.scala @@ -39,10 +39,10 @@ class JavaTestKitSpec extends AkkaSpec with DefaultTimeout { watch(actor) system stop actor - expectTerminated(actor).existenceConfirmed should be(true) + expectTerminated(actor).existenceConfirmed should ===(true) watch(actor) - expectTerminated(5 seconds, actor).actor should be(actor) + expectTerminated(5 seconds, actor).actor should ===(actor) } } diff --git a/akka-testkit/src/test/scala/akka/testkit/TestActorRefSpec.scala b/akka-testkit/src/test/scala/akka/testkit/TestActorRefSpec.scala index 6ce5865e73..c565eb146a 100644 --- a/akka-testkit/src/test/scala/akka/testkit/TestActorRefSpec.scala +++ b/akka-testkit/src/test/scala/akka/testkit/TestActorRefSpec.scala @@ -152,7 +152,7 @@ class TestActorRefSpec extends AkkaSpec("disp1.type=Dispatcher") with BeforeAndA clientRef ! "simple" clientRef ! "simple" - counter should be(0) + counter should ===(0) counter = 4 @@ -161,7 +161,7 @@ class TestActorRefSpec extends AkkaSpec("disp1.type=Dispatcher") with BeforeAndA clientRef ! "simple" clientRef ! "simple" - counter should be(0) + counter should ===(0) assertThread() } @@ -180,7 +180,7 @@ class TestActorRefSpec extends AkkaSpec("disp1.type=Dispatcher") with BeforeAndA expectMsgPF(5 seconds) { case WrappedTerminated(Terminated(`a`)) ⇒ true } - a.isTerminated should be(true) + a.isTerminated should ===(true) assertThread() } } @@ -204,7 +204,7 @@ class TestActorRefSpec extends AkkaSpec("disp1.type=Dispatcher") with BeforeAndA boss ! "sendKill" - counter should be(0) + counter should ===(0) assertThread() } } @@ -214,7 +214,7 @@ class TestActorRefSpec extends AkkaSpec("disp1.type=Dispatcher") with BeforeAndA val f = a ? "work" // CallingThreadDispatcher means that there is no delay f should be('completed) - Await.result(f, timeout.duration) should be("workDone") + Await.result(f, timeout.duration) should ===("workDone") } "support receive timeout" in { @@ -236,7 +236,7 @@ class TestActorRefSpec extends AkkaSpec("disp1.type=Dispatcher") with BeforeAndA val ref = TestActorRef(new TA) ref ! "hallo" val actor = ref.underlyingActor - actor.s should be("hallo") + actor.s should ===("hallo") } "set receiveTimeout to None" in { @@ -246,24 +246,24 @@ class TestActorRefSpec extends AkkaSpec("disp1.type=Dispatcher") with BeforeAndA "set CallingThreadDispatcher" in { val a = TestActorRef[WorkerActor] - a.underlying.dispatcher.getClass should be(classOf[CallingThreadDispatcher]) + a.underlying.dispatcher.getClass should ===(classOf[CallingThreadDispatcher]) } "allow override of dispatcher" in { val a = TestActorRef(Props[WorkerActor].withDispatcher("disp1")) - a.underlying.dispatcher.getClass should be(classOf[Dispatcher]) + a.underlying.dispatcher.getClass should ===(classOf[Dispatcher]) } "proxy receive for the underlying actor without sender()" in { val ref = TestActorRef[WorkerActor] ref.receive("work") - ref.isTerminated should be(true) + ref.isTerminated should ===(true) } "proxy receive for the underlying actor with sender()" in { val ref = TestActorRef[WorkerActor] ref.receive("work", testActor) - ref.isTerminated should be(true) + ref.isTerminated should ===(true) expectMsg("workDone") } diff --git a/akka-testkit/src/test/scala/akka/testkit/TestFSMRefSpec.scala b/akka-testkit/src/test/scala/akka/testkit/TestFSMRefSpec.scala index bd02fdd45b..0b8d6fbe69 100644 --- a/akka-testkit/src/test/scala/akka/testkit/TestFSMRefSpec.scala +++ b/akka-testkit/src/test/scala/akka/testkit/TestFSMRefSpec.scala @@ -27,17 +27,17 @@ class TestFSMRefSpec extends AkkaSpec { case Event("back", _) ⇒ goto(1) using "back" } }, "test-fsm-ref-1") - fsm.stateName should be(1) - fsm.stateData should be("") + fsm.stateName should ===(1) + fsm.stateData should ===("") fsm ! "go" - fsm.stateName should be(2) - fsm.stateData should be("go") + fsm.stateName should ===(2) + fsm.stateData should ===("go") fsm.setState(stateName = 1) - fsm.stateName should be(1) - fsm.stateData should be("go") + fsm.stateName should ===(1) + fsm.stateData should ===("go") fsm.setState(stateData = "buh") - fsm.stateName should be(1) - fsm.stateData should be("buh") + fsm.stateName should ===(1) + fsm.stateData should ===("buh") fsm.setState(timeout = 100 millis) within(80 millis, 500 millis) { awaitCond(fsm.stateName == 2 && fsm.stateData == "timeout") @@ -51,11 +51,11 @@ class TestFSMRefSpec extends AkkaSpec { case x ⇒ stay } }, "test-fsm-ref-2") - fsm.isTimerActive("test") should be(false) + fsm.isTimerActive("test") should ===(false) fsm.setTimer("test", 12, 10 millis, true) - fsm.isTimerActive("test") should be(true) + fsm.isTimerActive("test") should ===(true) fsm.cancelTimer("test") - fsm.isTimerActive("test") should be(false) + fsm.isTimerActive("test") should ===(false) } } } diff --git a/akka-testkit/src/test/scala/akka/testkit/TestProbeSpec.scala b/akka-testkit/src/test/scala/akka/testkit/TestProbeSpec.scala index cd98734b10..a07b75d808 100644 --- a/akka-testkit/src/test/scala/akka/testkit/TestProbeSpec.scala +++ b/akka-testkit/src/test/scala/akka/testkit/TestProbeSpec.scala @@ -19,7 +19,7 @@ class TestProbeSpec extends AkkaSpec with DefaultTimeout { tk.expectMsg(0 millis, "hello") // TestActor runs on CallingThreadDispatcher tk.lastMessage.sender ! "world" future should be('completed) - Await.result(future, timeout.duration) should be("world") + Await.result(future, timeout.duration) should ===("world") } "reply to messages" in { @@ -100,13 +100,13 @@ class TestProbeSpec extends AkkaSpec with DefaultTimeout { "be able to expect primitive types" in { for (_ ← 1 to 7) testActor ! 42 - expectMsgType[Int] should be(42) - expectMsgAnyClassOf(classOf[Int]) should be(42) - expectMsgAllClassOf(classOf[Int]) should be(Seq(42)) - expectMsgAllConformingOf(classOf[Int]) should be(Seq(42)) - expectMsgAllConformingOf(5 seconds, classOf[Int]) should be(Seq(42)) - expectMsgAllClassOf(classOf[Int]) should be(Seq(42)) - expectMsgAllClassOf(5 seconds, classOf[Int]) should be(Seq(42)) + expectMsgType[Int] should ===(42) + expectMsgAnyClassOf(classOf[Int]) should ===(42) + expectMsgAllClassOf(classOf[Int]) should ===(Seq(42)) + expectMsgAllConformingOf(classOf[Int]) should ===(Seq(42)) + expectMsgAllConformingOf(5 seconds, classOf[Int]) should ===(Seq(42)) + expectMsgAllClassOf(classOf[Int]) should ===(Seq(42)) + expectMsgAllClassOf(5 seconds, classOf[Int]) should ===(Seq(42)) } "be able to ignore primitive types" in { diff --git a/akka-testkit/src/test/scala/akka/testkit/TestTimeSpec.scala b/akka-testkit/src/test/scala/akka/testkit/TestTimeSpec.scala index 1ad631c449..a56bcf304b 100644 --- a/akka-testkit/src/test/scala/akka/testkit/TestTimeSpec.scala +++ b/akka-testkit/src/test/scala/akka/testkit/TestTimeSpec.scala @@ -9,7 +9,7 @@ class TestTimeSpec extends AkkaSpec(Map("akka.test.timefactor" -> 2.0)) { "A TestKit" must { "correctly dilate times" taggedAs TimingTest in { - 1.second.dilated.toNanos should be(1000000000L * testKitSettings.TestTimeFactor) + 1.second.dilated.toNanos should ===(1000000000L * testKitSettings.TestTimeFactor) val probe = TestProbe() val now = System.nanoTime @@ -21,10 +21,10 @@ class TestTimeSpec extends AkkaSpec(Map("akka.test.timefactor" -> 2.0)) { } "awaitAssert must throw correctly" in { - awaitAssert("foo" should be("foo")) + awaitAssert("foo" should ===("foo")) within(300.millis, 2.seconds) { intercept[TestFailedException] { - awaitAssert("foo" should be("bar"), 500.millis, 300.millis) + awaitAssert("foo" should ===("bar"), 500.millis, 300.millis) } } } diff --git a/akka-testkit/src/test/scala/akka/testkit/metrics/reporter/PrettyDurationSpec.scala b/akka-testkit/src/test/scala/akka/testkit/metrics/reporter/PrettyDurationSpec.scala index 378ae9e8f1..f7634e3cab 100644 --- a/akka-testkit/src/test/scala/akka/testkit/metrics/reporter/PrettyDurationSpec.scala +++ b/akka-testkit/src/test/scala/akka/testkit/metrics/reporter/PrettyDurationSpec.scala @@ -30,7 +30,7 @@ class PrettyDurationSpec extends FlatSpec with Matchers { cases foreach { case (d, expectedValue) ⇒ it should s"print $d nanos as $expectedValue" in { - d.pretty should be(expectedValue) + d.pretty should ===(expectedValue) } }