=all #3837 Make akkaScalaNightly compile on scala 2.11.0-M8
This commit is contained in:
parent
85698688e4
commit
179faba453
82 changed files with 651 additions and 643 deletions
|
|
@ -56,14 +56,14 @@ class ActorLookupSpec extends AkkaSpec with DefaultTimeout {
|
||||||
"An ActorSystem" must {
|
"An ActorSystem" must {
|
||||||
|
|
||||||
"find actors by looking up their path" in {
|
"find actors by looking up their path" in {
|
||||||
system.actorFor(c1.path) should equal(c1)
|
system.actorFor(c1.path) should be(c1)
|
||||||
system.actorFor(c2.path) should equal(c2)
|
system.actorFor(c2.path) should be(c2)
|
||||||
system.actorFor(c21.path) should equal(c21)
|
system.actorFor(c21.path) should be(c21)
|
||||||
system.actorFor(system / "c1") should equal(c1)
|
system.actorFor(system / "c1") should be(c1)
|
||||||
system.actorFor(system / "c2") should equal(c2)
|
system.actorFor(system / "c2") should be(c2)
|
||||||
system.actorFor(system / "c2" / "c21") should equal(c21)
|
system.actorFor(system / "c2" / "c21") should be(c21)
|
||||||
system.actorFor(system child "c2" child "c21") should equal(c21) // test Java API
|
system.actorFor(system child "c2" child "c21") should be(c21) // test Java API
|
||||||
system.actorFor(system / Seq("c2", "c21")) should equal(c21)
|
system.actorFor(system / Seq("c2", "c21")) should be(c21)
|
||||||
|
|
||||||
import scala.collection.JavaConverters._
|
import scala.collection.JavaConverters._
|
||||||
system.actorFor(system descendant Seq("c2", "c21").asJava) // test Java API
|
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 {
|
"find actors by looking up their string representation" in {
|
||||||
// this is only true for local actor references
|
// this is only true for local actor references
|
||||||
system.actorFor(c1.path.toString) should equal(c1)
|
system.actorFor(c1.path.toString) should be(c1)
|
||||||
system.actorFor(c2.path.toString) should equal(c2)
|
system.actorFor(c2.path.toString) should be(c2)
|
||||||
system.actorFor(c21.path.toString) should equal(c21)
|
system.actorFor(c21.path.toString) should be(c21)
|
||||||
}
|
}
|
||||||
|
|
||||||
"take actor incarnation into account when comparing actor references" in {
|
"take actor incarnation into account when comparing actor references" in {
|
||||||
|
|
@ -101,45 +101,45 @@ class ActorLookupSpec extends AkkaSpec with DefaultTimeout {
|
||||||
}
|
}
|
||||||
|
|
||||||
"find actors by looking up their root-anchored relative path" in {
|
"find actors by looking up their root-anchored relative path" in {
|
||||||
system.actorFor(c1.path.toStringWithoutAddress) should equal(c1)
|
system.actorFor(c1.path.toStringWithoutAddress) should be(c1)
|
||||||
system.actorFor(c2.path.toStringWithoutAddress) should equal(c2)
|
system.actorFor(c2.path.toStringWithoutAddress) should be(c2)
|
||||||
system.actorFor(c21.path.toStringWithoutAddress) should equal(c21)
|
system.actorFor(c21.path.toStringWithoutAddress) should be(c21)
|
||||||
}
|
}
|
||||||
|
|
||||||
"find actors by looking up their relative path" in {
|
"find actors by looking up their relative path" in {
|
||||||
system.actorFor(c1.path.elements.mkString("/")) should equal(c1)
|
system.actorFor(c1.path.elements.mkString("/")) should be(c1)
|
||||||
system.actorFor(c2.path.elements.mkString("/")) should equal(c2)
|
system.actorFor(c2.path.elements.mkString("/")) should be(c2)
|
||||||
system.actorFor(c21.path.elements.mkString("/")) should equal(c21)
|
system.actorFor(c21.path.elements.mkString("/")) should be(c21)
|
||||||
}
|
}
|
||||||
|
|
||||||
"find actors by looking up their path elements" in {
|
"find actors by looking up their path elements" in {
|
||||||
system.actorFor(c1.path.elements) should equal(c1)
|
system.actorFor(c1.path.elements) should be(c1)
|
||||||
system.actorFor(c2.path.elements) should equal(c2)
|
system.actorFor(c2.path.elements) should be(c2)
|
||||||
system.actorFor(c21.path.getElements) should equal(c21) // test Java API
|
system.actorFor(c21.path.getElements) should be(c21) // test Java API
|
||||||
}
|
}
|
||||||
|
|
||||||
"find system-generated actors" in {
|
"find system-generated actors" in {
|
||||||
system.actorFor("/user") should equal(user)
|
system.actorFor("/user") should be(user)
|
||||||
system.actorFor("/deadLetters") should equal(system.deadLetters)
|
system.actorFor("/deadLetters") should be(system.deadLetters)
|
||||||
system.actorFor("/system") should equal(syst)
|
system.actorFor("/system") should be(syst)
|
||||||
system.actorFor(syst.path) should equal(syst)
|
system.actorFor(syst.path) should be(syst)
|
||||||
system.actorFor(syst.path.toString) should equal(syst)
|
system.actorFor(syst.path.toString) should be(syst)
|
||||||
system.actorFor("/") should equal(root)
|
system.actorFor("/") should be(root)
|
||||||
system.actorFor("..") should equal(root)
|
system.actorFor("..") should be(root)
|
||||||
system.actorFor(root.path) should equal(root)
|
system.actorFor(root.path) should be(root)
|
||||||
system.actorFor(root.path.toString) should equal(root)
|
system.actorFor(root.path.toString) should be(root)
|
||||||
system.actorFor("user") should equal(user)
|
system.actorFor("user") should be(user)
|
||||||
system.actorFor("deadLetters") should equal(system.deadLetters)
|
system.actorFor("deadLetters") should be(system.deadLetters)
|
||||||
system.actorFor("system") should equal(syst)
|
system.actorFor("system") should be(syst)
|
||||||
system.actorFor("user/") should equal(user)
|
system.actorFor("user/") should be(user)
|
||||||
system.actorFor("deadLetters/") should equal(system.deadLetters)
|
system.actorFor("deadLetters/") should be(system.deadLetters)
|
||||||
system.actorFor("system/") should equal(syst)
|
system.actorFor("system/") should be(syst)
|
||||||
}
|
}
|
||||||
|
|
||||||
"return deadLetters or EmptyLocalActorRef, respectively, for non-existing paths" in {
|
"return deadLetters or EmptyLocalActorRef, respectively, for non-existing paths" in {
|
||||||
def check(lookup: ActorRef, result: ActorRef) = {
|
def check(lookup: ActorRef, result: ActorRef) = {
|
||||||
lookup.getClass should equal(result.getClass)
|
lookup.getClass should be(result.getClass)
|
||||||
lookup should equal(result)
|
lookup should be(result)
|
||||||
}
|
}
|
||||||
check(system.actorFor("a/b/c"), empty("a/b/c"))
|
check(system.actorFor("a/b/c"), empty("a/b/c"))
|
||||||
check(system.actorFor(""), system.deadLetters)
|
check(system.actorFor(""), system.deadLetters)
|
||||||
|
|
@ -153,17 +153,17 @@ class ActorLookupSpec extends AkkaSpec with DefaultTimeout {
|
||||||
"find temporary actors" in {
|
"find temporary actors" in {
|
||||||
val f = c1 ? GetSender(testActor)
|
val f = c1 ? GetSender(testActor)
|
||||||
val a = expectMsgType[ActorRef]
|
val a = expectMsgType[ActorRef]
|
||||||
a.path.elements.head should equal("temp")
|
a.path.elements.head should be("temp")
|
||||||
system.actorFor(a.path) should equal(a)
|
system.actorFor(a.path) should be(a)
|
||||||
system.actorFor(a.path.toString) should equal(a)
|
system.actorFor(a.path.toString) should be(a)
|
||||||
system.actorFor(a.path.elements) should equal(a)
|
system.actorFor(a.path.elements) should be(a)
|
||||||
system.actorFor(a.path.toString + "/") should equal(a)
|
system.actorFor(a.path.toString + "/") should be(a)
|
||||||
system.actorFor(a.path.toString + "/hallo").isTerminated should equal(true)
|
system.actorFor(a.path.toString + "/hallo").isTerminated should be(true)
|
||||||
f.isCompleted should equal(false)
|
f.isCompleted should be(false)
|
||||||
a.isTerminated should equal(false)
|
a.isTerminated should be(false)
|
||||||
a ! 42
|
a ! 42
|
||||||
f.isCompleted should equal(true)
|
f.isCompleted should be(true)
|
||||||
Await.result(f, timeout.duration) should equal(42)
|
Await.result(f, timeout.duration) should be(42)
|
||||||
// clean-up is run as onComplete callback, i.e. dispatched on another thread
|
// clean-up is run as onComplete callback, i.e. dispatched on another thread
|
||||||
awaitCond(system.actorFor(a.path).isTerminated, 1 second)
|
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 {
|
"find actors by looking up their path" in {
|
||||||
def check(looker: ActorRef, pathOf: ActorRef, result: ActorRef) {
|
def check(looker: ActorRef, pathOf: ActorRef, result: ActorRef) {
|
||||||
Await.result(looker ? LookupPath(pathOf.path), timeout.duration) should equal(result)
|
Await.result(looker ? LookupPath(pathOf.path), timeout.duration) should be(result)
|
||||||
}
|
}
|
||||||
for {
|
for {
|
||||||
looker ← all
|
looker ← all
|
||||||
|
|
@ -186,11 +186,11 @@ class ActorLookupSpec extends AkkaSpec with DefaultTimeout {
|
||||||
|
|
||||||
"find actors by looking up their string representation" in {
|
"find actors by looking up their string representation" in {
|
||||||
def check(looker: ActorRef, pathOf: ActorRef, result: ActorRef) {
|
def check(looker: ActorRef, pathOf: ActorRef, result: ActorRef) {
|
||||||
Await.result(looker ? LookupString(pathOf.path.toString), timeout.duration) should equal(result)
|
Await.result(looker ? LookupString(pathOf.path.toString), timeout.duration) should be(result)
|
||||||
// with uid
|
// with uid
|
||||||
Await.result(looker ? LookupString(pathOf.path.toSerializationFormat), timeout.duration) should equal(result)
|
Await.result(looker ? LookupString(pathOf.path.toSerializationFormat), timeout.duration) should be(result)
|
||||||
// with trailing /
|
// with trailing /
|
||||||
Await.result(looker ? LookupString(pathOf.path.toString + "/"), timeout.duration) should equal(result)
|
Await.result(looker ? LookupString(pathOf.path.toString + "/"), timeout.duration) should be(result)
|
||||||
}
|
}
|
||||||
for {
|
for {
|
||||||
looker ← all
|
looker ← all
|
||||||
|
|
@ -200,8 +200,8 @@ class ActorLookupSpec extends AkkaSpec with DefaultTimeout {
|
||||||
|
|
||||||
"find actors by looking up their root-anchored relative path" in {
|
"find actors by looking up their root-anchored relative path" in {
|
||||||
def check(looker: ActorRef, pathOf: ActorRef, result: ActorRef) {
|
def check(looker: ActorRef, pathOf: ActorRef, result: ActorRef) {
|
||||||
Await.result(looker ? LookupString(pathOf.path.toStringWithoutAddress), timeout.duration) should equal(result)
|
Await.result(looker ? LookupString(pathOf.path.toStringWithoutAddress), timeout.duration) should be(result)
|
||||||
Await.result(looker ? LookupString(pathOf.path.elements.mkString("/", "/", "/")), timeout.duration) should equal(result)
|
Await.result(looker ? LookupString(pathOf.path.elements.mkString("/", "/", "/")), timeout.duration) should be(result)
|
||||||
}
|
}
|
||||||
for {
|
for {
|
||||||
looker ← all
|
looker ← all
|
||||||
|
|
@ -211,9 +211,9 @@ class ActorLookupSpec extends AkkaSpec with DefaultTimeout {
|
||||||
|
|
||||||
"find actors by looking up their relative path" in {
|
"find actors by looking up their relative path" in {
|
||||||
def check(looker: ActorRef, result: ActorRef, elems: String*) {
|
def check(looker: ActorRef, result: ActorRef, elems: String*) {
|
||||||
Await.result(looker ? LookupElems(elems), timeout.duration) should equal(result)
|
Await.result(looker ? LookupElems(elems), timeout.duration) should be(result)
|
||||||
Await.result(looker ? LookupString(elems mkString "/"), timeout.duration) should equal(result)
|
Await.result(looker ? LookupString(elems mkString "/"), timeout.duration) should be(result)
|
||||||
Await.result(looker ? LookupString(elems mkString ("", "/", "/")), timeout.duration) should equal(result)
|
Await.result(looker ? LookupString(elems mkString ("", "/", "/")), timeout.duration) should be(result)
|
||||||
}
|
}
|
||||||
check(c1, user, "..")
|
check(c1, user, "..")
|
||||||
for {
|
for {
|
||||||
|
|
@ -228,11 +228,11 @@ class ActorLookupSpec extends AkkaSpec with DefaultTimeout {
|
||||||
"find system-generated actors" in {
|
"find system-generated actors" in {
|
||||||
def check(target: ActorRef) {
|
def check(target: ActorRef) {
|
||||||
for (looker ← all) {
|
for (looker ← all) {
|
||||||
Await.result(looker ? LookupPath(target.path), timeout.duration) should equal(target)
|
Await.result(looker ? LookupPath(target.path), timeout.duration) should be(target)
|
||||||
Await.result(looker ? LookupString(target.path.toString), timeout.duration) should equal(target)
|
Await.result(looker ? LookupString(target.path.toString), timeout.duration) should be(target)
|
||||||
Await.result(looker ? LookupString(target.path.toString + "/"), timeout.duration) should equal(target)
|
Await.result(looker ? LookupString(target.path.toString + "/"), timeout.duration) should be(target)
|
||||||
Await.result(looker ? LookupString(target.path.toStringWithoutAddress), timeout.duration) should equal(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 equal(target)
|
if (target != root) Await.result(looker ? LookupString(target.path.elements.mkString("/", "/", "/")), timeout.duration) should be(target)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (target ← Seq(root, syst, user, system.deadLetters)) check(target)
|
for (target ← Seq(root, syst, user, system.deadLetters)) check(target)
|
||||||
|
|
@ -243,8 +243,8 @@ class ActorLookupSpec extends AkkaSpec with DefaultTimeout {
|
||||||
|
|
||||||
def checkOne(looker: ActorRef, query: Query, result: ActorRef) {
|
def checkOne(looker: ActorRef, query: Query, result: ActorRef) {
|
||||||
val lookup = Await.result(looker ? query, timeout.duration)
|
val lookup = Await.result(looker ? query, timeout.duration)
|
||||||
lookup.getClass should equal(result.getClass)
|
lookup.getClass should be(result.getClass)
|
||||||
lookup should equal(result)
|
lookup should be(result)
|
||||||
}
|
}
|
||||||
def check(looker: ActorRef) {
|
def check(looker: ActorRef) {
|
||||||
val lookname = looker.path.elements.mkString("", "/", "/")
|
val lookname = looker.path.elements.mkString("", "/", "/")
|
||||||
|
|
@ -266,21 +266,21 @@ class ActorLookupSpec extends AkkaSpec with DefaultTimeout {
|
||||||
"find temporary actors" in {
|
"find temporary actors" in {
|
||||||
val f = c1 ? GetSender(testActor)
|
val f = c1 ? GetSender(testActor)
|
||||||
val a = expectMsgType[ActorRef]
|
val a = expectMsgType[ActorRef]
|
||||||
a.path.elements.head should equal("temp")
|
a.path.elements.head should be("temp")
|
||||||
Await.result(c2 ? LookupPath(a.path), timeout.duration) should equal(a)
|
Await.result(c2 ? LookupPath(a.path), timeout.duration) should be(a)
|
||||||
Await.result(c2 ? LookupString(a.path.toString), timeout.duration) should equal(a)
|
Await.result(c2 ? LookupString(a.path.toString), timeout.duration) should be(a)
|
||||||
Await.result(c2 ? LookupString(a.path.toStringWithoutAddress), timeout.duration) should equal(a)
|
Await.result(c2 ? LookupString(a.path.toStringWithoutAddress), timeout.duration) should be(a)
|
||||||
Await.result(c2 ? LookupString("../../" + a.path.elements.mkString("/")), timeout.duration) should equal(a)
|
Await.result(c2 ? LookupString("../../" + a.path.elements.mkString("/")), timeout.duration) should be(a)
|
||||||
Await.result(c2 ? LookupString(a.path.toString + "/"), timeout.duration) should equal(a)
|
Await.result(c2 ? LookupString(a.path.toString + "/"), timeout.duration) should be(a)
|
||||||
Await.result(c2 ? LookupString(a.path.toStringWithoutAddress + "/"), timeout.duration) should equal(a)
|
Await.result(c2 ? LookupString(a.path.toStringWithoutAddress + "/"), timeout.duration) should be(a)
|
||||||
Await.result(c2 ? LookupString("../../" + a.path.elements.mkString("/") + "/"), timeout.duration) should equal(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 equal(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 equal(a)
|
Await.result(c2 ? LookupElems(Seq("..", "..") ++ a.path.elements :+ ""), timeout.duration) should be(a)
|
||||||
f.isCompleted should equal(false)
|
f.isCompleted should be(false)
|
||||||
a.isTerminated should equal(false)
|
a.isTerminated should be(false)
|
||||||
a ! 42
|
a ! 42
|
||||||
f.isCompleted should equal(true)
|
f.isCompleted should be(true)
|
||||||
Await.result(f, timeout.duration) should equal(42)
|
Await.result(f, timeout.duration) should be(42)
|
||||||
// clean-up is run as onComplete callback, i.e. dispatched on another thread
|
// 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)
|
awaitCond(Await.result(c2 ? LookupPath(a.path), timeout.duration).asInstanceOf[ActorRef].isTerminated, 1 second)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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 {
|
"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)
|
val q = checkMailboxQueue(Props[QueueReportingActor], "default-bounded-mailbox-with-zero-pushtimeout", BoundedMailboxTypes)
|
||||||
q.asInstanceOf[BoundedMessageQueueSemantics].pushTimeOut should equal(Duration.Zero)
|
q.asInstanceOf[BoundedMessageQueueSemantics].pushTimeOut should be(Duration.Zero)
|
||||||
}
|
}
|
||||||
|
|
||||||
"get an unbounded message queue when it's configured as mailbox overriding bounded in dispatcher" in {
|
"get an unbounded message queue when it's configured as mailbox overriding bounded in dispatcher" in {
|
||||||
|
|
|
||||||
|
|
@ -139,7 +139,7 @@ class ActorRefSpec extends AkkaSpec with DefaultTimeout {
|
||||||
new Actor { def receive = { case _ ⇒ } }
|
new Actor { def receive = { case _ ⇒ } }
|
||||||
}
|
}
|
||||||
|
|
||||||
def contextStackMustBeEmpty(): Unit = ActorCell.contextStack.get.headOption should equal(None)
|
def contextStackMustBeEmpty(): Unit = ActorCell.contextStack.get.headOption should be(None)
|
||||||
|
|
||||||
EventFilter[ActorInitializationException](occurrences = 1) intercept {
|
EventFilter[ActorInitializationException](occurrences = 1) intercept {
|
||||||
intercept[akka.actor.ActorInitializationException] {
|
intercept[akka.actor.ActorInitializationException] {
|
||||||
|
|
@ -249,7 +249,7 @@ class ActorRefSpec extends AkkaSpec with DefaultTimeout {
|
||||||
(intercept[java.lang.IllegalStateException] {
|
(intercept[java.lang.IllegalStateException] {
|
||||||
wrap(result ⇒
|
wrap(result ⇒
|
||||||
actorOf(Props(new OuterActor(actorOf(Props(promiseIntercept({ throw new IllegalStateException("Ur state be b0rked"); new InnerActor })(result)))))))
|
actorOf(Props(new OuterActor(actorOf(Props(promiseIntercept({ throw new IllegalStateException("Ur state be b0rked"); new InnerActor })(result)))))))
|
||||||
}).getMessage should equal("Ur state be b0rked")
|
}).getMessage should be("Ur state be b0rked")
|
||||||
|
|
||||||
contextStackMustBeEmpty()
|
contextStackMustBeEmpty()
|
||||||
}
|
}
|
||||||
|
|
@ -275,15 +275,15 @@ class ActorRefSpec extends AkkaSpec with DefaultTimeout {
|
||||||
val in = new ObjectInputStream(new ByteArrayInputStream(bytes))
|
val in = new ObjectInputStream(new ByteArrayInputStream(bytes))
|
||||||
val readA = in.readObject
|
val readA = in.readObject
|
||||||
|
|
||||||
a.isInstanceOf[ActorRefWithCell] should equal(true)
|
a.isInstanceOf[ActorRefWithCell] should be(true)
|
||||||
readA.isInstanceOf[ActorRefWithCell] should equal(true)
|
readA.isInstanceOf[ActorRefWithCell] should be(true)
|
||||||
(readA eq a) should equal(true)
|
(readA eq a) should be(true)
|
||||||
}
|
}
|
||||||
|
|
||||||
val ser = new JavaSerializer(esys)
|
val ser = new JavaSerializer(esys)
|
||||||
val readA = ser.fromBinary(bytes, None)
|
val readA = ser.fromBinary(bytes, None)
|
||||||
readA.isInstanceOf[ActorRefWithCell] should equal(true)
|
readA.isInstanceOf[ActorRefWithCell] should be(true)
|
||||||
(readA eq a) should equal(true)
|
(readA eq a) should be(true)
|
||||||
}
|
}
|
||||||
|
|
||||||
"throw an exception on deserialize if no system in scope" in {
|
"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] {
|
(intercept[java.lang.IllegalStateException] {
|
||||||
in.readObject
|
in.readObject
|
||||||
}).getMessage should equal("Trying to deserialize a serialized ActorRef without an ActorSystem in scope." +
|
}).getMessage should be("Trying to deserialize a serialized ActorRef without an ActorSystem in scope." +
|
||||||
" Use 'akka.serialization.Serialization.currentSystem.withValue(system) { ... }'")
|
" Use 'akka.serialization.Serialization.currentSystem.withValue(system) { ... }'")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -328,7 +328,7 @@ class ActorRefSpec extends AkkaSpec with DefaultTimeout {
|
||||||
|
|
||||||
JavaSerializer.currentSystem.withValue(sysImpl) {
|
JavaSerializer.currentSystem.withValue(sysImpl) {
|
||||||
val in = new ObjectInputStream(new ByteArrayInputStream(baos.toByteArray))
|
val in = new ObjectInputStream(new ByteArrayInputStream(baos.toByteArray))
|
||||||
in.readObject should equal(new EmptyLocalActorRef(sysImpl.provider, ref.path, system.eventStream))
|
in.readObject should be(new EmptyLocalActorRef(sysImpl.provider, ref.path, system.eventStream))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -341,7 +341,7 @@ class ActorRefSpec extends AkkaSpec with DefaultTimeout {
|
||||||
val nested = Await.result((a ? "any").mapTo[ActorRef], timeout.duration)
|
val nested = Await.result((a ? "any").mapTo[ActorRef], timeout.duration)
|
||||||
a should not be null
|
a should not be null
|
||||||
nested should not be null
|
nested should not be null
|
||||||
(a ne nested) should equal(true)
|
(a ne nested) should be(true)
|
||||||
}
|
}
|
||||||
|
|
||||||
"support advanced nested actorOfs" in {
|
"support advanced nested actorOfs" in {
|
||||||
|
|
@ -352,7 +352,7 @@ class ActorRefSpec extends AkkaSpec with DefaultTimeout {
|
||||||
Await.result(a ? "self", timeout.duration) should be(a)
|
Await.result(a ? "self", timeout.duration) should be(a)
|
||||||
inner should not be a
|
inner should not be a
|
||||||
|
|
||||||
Await.result(a ? "msg", timeout.duration) should equal("msg")
|
Await.result(a ? "msg", timeout.duration) should be("msg")
|
||||||
}
|
}
|
||||||
|
|
||||||
"support reply via sender" in {
|
"support reply via sender" in {
|
||||||
|
|
|
||||||
|
|
@ -86,27 +86,27 @@ class ActorSelectionSpec extends AkkaSpec("akka.loglevel=DEBUG") with DefaultTim
|
||||||
"An ActorSystem" must {
|
"An ActorSystem" must {
|
||||||
|
|
||||||
"select actors by their path" in {
|
"select actors by their path" in {
|
||||||
identify(c1.path) should equal(Some(c1))
|
identify(c1.path) should be(Some(c1))
|
||||||
identify(c2.path) should equal(Some(c2))
|
identify(c2.path) should be(Some(c2))
|
||||||
identify(c21.path) should equal(Some(c21))
|
identify(c21.path) should be(Some(c21))
|
||||||
identify(system / "c1") should equal(Some(c1))
|
identify(system / "c1") should be(Some(c1))
|
||||||
identify(system / "c2") should equal(Some(c2))
|
identify(system / "c2") should be(Some(c2))
|
||||||
identify(system / "c2" / "c21") should equal(Some(c21))
|
identify(system / "c2" / "c21") should be(Some(c21))
|
||||||
identify(system child "c2" child "c21") should equal(Some(c21)) // test Java API
|
identify(system child "c2" child "c21") should be(Some(c21)) // test Java API
|
||||||
identify(system / Seq("c2", "c21")) should equal(Some(c21))
|
identify(system / Seq("c2", "c21")) should be(Some(c21))
|
||||||
|
|
||||||
import scala.collection.JavaConverters._
|
import scala.collection.JavaConverters._
|
||||||
identify(system descendant Seq("c2", "c21").asJava) // test Java API
|
identify(system descendant Seq("c2", "c21").asJava) // test Java API
|
||||||
}
|
}
|
||||||
|
|
||||||
"select actors by their string path representation" in {
|
"select actors by their string path representation" in {
|
||||||
identify(c1.path.toString) should equal(Some(c1))
|
identify(c1.path.toString) should be(Some(c1))
|
||||||
identify(c2.path.toString) should equal(Some(c2))
|
identify(c2.path.toString) should be(Some(c2))
|
||||||
identify(c21.path.toString) should equal(Some(c21))
|
identify(c21.path.toString) should be(Some(c21))
|
||||||
|
|
||||||
identify(c1.path.toStringWithoutAddress) should equal(Some(c1))
|
identify(c1.path.toStringWithoutAddress) should be(Some(c1))
|
||||||
identify(c2.path.toStringWithoutAddress) should equal(Some(c2))
|
identify(c2.path.toStringWithoutAddress) should be(Some(c2))
|
||||||
identify(c21.path.toStringWithoutAddress) should equal(Some(c21))
|
identify(c21.path.toStringWithoutAddress) should be(Some(c21))
|
||||||
}
|
}
|
||||||
|
|
||||||
"take actor incarnation into account when comparing actor references" in {
|
"take actor incarnation into account when comparing actor references" in {
|
||||||
|
|
@ -114,10 +114,10 @@ class ActorSelectionSpec extends AkkaSpec("akka.loglevel=DEBUG") with DefaultTim
|
||||||
val a1 = system.actorOf(p, name)
|
val a1 = system.actorOf(p, name)
|
||||||
watch(a1)
|
watch(a1)
|
||||||
a1 ! PoisonPill
|
a1 ! PoisonPill
|
||||||
expectMsgType[Terminated].actor should equal(a1)
|
expectMsgType[Terminated].actor should be(a1)
|
||||||
|
|
||||||
// not equal because it's terminated
|
// not equal because it's terminated
|
||||||
identify(a1.path) should equal(None)
|
identify(a1.path) should be(None)
|
||||||
|
|
||||||
val a2 = system.actorOf(p, name)
|
val a2 = system.actorOf(p, name)
|
||||||
a2.path should be(a1.path)
|
a2.path should be(a1.path)
|
||||||
|
|
@ -127,47 +127,47 @@ class ActorSelectionSpec extends AkkaSpec("akka.loglevel=DEBUG") with DefaultTim
|
||||||
|
|
||||||
watch(a2)
|
watch(a2)
|
||||||
a2 ! PoisonPill
|
a2 ! PoisonPill
|
||||||
expectMsgType[Terminated].actor should equal(a2)
|
expectMsgType[Terminated].actor should be(a2)
|
||||||
}
|
}
|
||||||
|
|
||||||
"select actors by their root-anchored relative path" in {
|
"select actors by their root-anchored relative path" in {
|
||||||
identify(c1.path.toStringWithoutAddress) should equal(Some(c1))
|
identify(c1.path.toStringWithoutAddress) should be(Some(c1))
|
||||||
identify(c2.path.toStringWithoutAddress) should equal(Some(c2))
|
identify(c2.path.toStringWithoutAddress) should be(Some(c2))
|
||||||
identify(c21.path.toStringWithoutAddress) should equal(Some(c21))
|
identify(c21.path.toStringWithoutAddress) should be(Some(c21))
|
||||||
}
|
}
|
||||||
|
|
||||||
"select actors by their relative path" in {
|
"select actors by their relative path" in {
|
||||||
identify(c1.path.elements.mkString("/")) should equal(Some(c1))
|
identify(c1.path.elements.mkString("/")) should be(Some(c1))
|
||||||
identify(c2.path.elements.mkString("/")) should equal(Some(c2))
|
identify(c2.path.elements.mkString("/")) should be(Some(c2))
|
||||||
identify(c21.path.elements.mkString("/")) should equal(Some(c21))
|
identify(c21.path.elements.mkString("/")) should be(Some(c21))
|
||||||
}
|
}
|
||||||
|
|
||||||
"select system-generated actors" in {
|
"select system-generated actors" in {
|
||||||
identify("/user") should equal(Some(user))
|
identify("/user") should be(Some(user))
|
||||||
identify("/deadLetters") should equal(Some(system.deadLetters))
|
identify("/deadLetters") should be(Some(system.deadLetters))
|
||||||
identify("/system") should equal(Some(syst))
|
identify("/system") should be(Some(syst))
|
||||||
identify(syst.path) should equal(Some(syst))
|
identify(syst.path) should be(Some(syst))
|
||||||
identify(syst.path.toStringWithoutAddress) should equal(Some(syst))
|
identify(syst.path.toStringWithoutAddress) should be(Some(syst))
|
||||||
identify("/") should equal(Some(root))
|
identify("/") should be(Some(root))
|
||||||
identify("") should equal(Some(root))
|
identify("") should be(Some(root))
|
||||||
identify(RootActorPath(root.path.address)) should equal(Some(root))
|
identify(RootActorPath(root.path.address)) should be(Some(root))
|
||||||
identify("..") should equal(Some(root))
|
identify("..") should be(Some(root))
|
||||||
identify(root.path) should equal(Some(root))
|
identify(root.path) should be(Some(root))
|
||||||
identify(root.path.toStringWithoutAddress) should equal(Some(root))
|
identify(root.path.toStringWithoutAddress) should be(Some(root))
|
||||||
identify("user") should equal(Some(user))
|
identify("user") should be(Some(user))
|
||||||
identify("deadLetters") should equal(Some(system.deadLetters))
|
identify("deadLetters") should be(Some(system.deadLetters))
|
||||||
identify("system") should equal(Some(syst))
|
identify("system") should be(Some(syst))
|
||||||
identify("user/") should equal(Some(user))
|
identify("user/") should be(Some(user))
|
||||||
identify("deadLetters/") should equal(Some(system.deadLetters))
|
identify("deadLetters/") should be(Some(system.deadLetters))
|
||||||
identify("system/") should equal(Some(syst))
|
identify("system/") should be(Some(syst))
|
||||||
}
|
}
|
||||||
|
|
||||||
"return deadLetters or ActorIdentity(None), respectively, for non-existing paths" in {
|
"return deadLetters or ActorIdentity(None), respectively, for non-existing paths" in {
|
||||||
identify("a/b/c") should equal(None)
|
identify("a/b/c") should be(None)
|
||||||
identify("a/b/c") should equal(None)
|
identify("a/b/c") should be(None)
|
||||||
identify("akka://all-systems/Nobody") should equal(None)
|
identify("akka://all-systems/Nobody") should be(None)
|
||||||
identify("akka://all-systems/user") should equal(None)
|
identify("akka://all-systems/user") should be(None)
|
||||||
identify(system / "hallo") should equal(None)
|
identify(system / "hallo") should be(None)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -178,7 +178,7 @@ class ActorSelectionSpec extends AkkaSpec("akka.loglevel=DEBUG") with DefaultTim
|
||||||
|
|
||||||
"select actors by their path" in {
|
"select actors by their path" in {
|
||||||
def check(looker: ActorRef, pathOf: ActorRef, result: ActorRef) {
|
def check(looker: ActorRef, pathOf: ActorRef, result: ActorRef) {
|
||||||
askNode(looker, SelectPath(pathOf.path)) should equal(Some(result))
|
askNode(looker, SelectPath(pathOf.path)) should be(Some(result))
|
||||||
}
|
}
|
||||||
for {
|
for {
|
||||||
looker ← all
|
looker ← all
|
||||||
|
|
@ -188,9 +188,9 @@ class ActorSelectionSpec extends AkkaSpec("akka.loglevel=DEBUG") with DefaultTim
|
||||||
|
|
||||||
"select actors by their string path representation" in {
|
"select actors by their string path representation" in {
|
||||||
def check(looker: ActorRef, pathOf: ActorRef, result: ActorRef) {
|
def check(looker: ActorRef, pathOf: ActorRef, result: ActorRef) {
|
||||||
askNode(looker, SelectString(pathOf.path.toStringWithoutAddress)) should equal(Some(result))
|
askNode(looker, SelectString(pathOf.path.toStringWithoutAddress)) should be(Some(result))
|
||||||
// with trailing /
|
// with trailing /
|
||||||
askNode(looker, SelectString(pathOf.path.toStringWithoutAddress + "/")) should equal(Some(result))
|
askNode(looker, SelectString(pathOf.path.toStringWithoutAddress + "/")) should be(Some(result))
|
||||||
}
|
}
|
||||||
for {
|
for {
|
||||||
looker ← all
|
looker ← all
|
||||||
|
|
@ -200,8 +200,8 @@ class ActorSelectionSpec extends AkkaSpec("akka.loglevel=DEBUG") with DefaultTim
|
||||||
|
|
||||||
"select actors by their root-anchored relative path" in {
|
"select actors by their root-anchored relative path" in {
|
||||||
def check(looker: ActorRef, pathOf: ActorRef, result: ActorRef) {
|
def check(looker: ActorRef, pathOf: ActorRef, result: ActorRef) {
|
||||||
askNode(looker, SelectString(pathOf.path.toStringWithoutAddress)) should equal(Some(result))
|
askNode(looker, SelectString(pathOf.path.toStringWithoutAddress)) should be(Some(result))
|
||||||
askNode(looker, SelectString(pathOf.path.elements.mkString("/", "/", "/"))) should equal(Some(result))
|
askNode(looker, SelectString(pathOf.path.elements.mkString("/", "/", "/"))) should be(Some(result))
|
||||||
}
|
}
|
||||||
for {
|
for {
|
||||||
looker ← all
|
looker ← all
|
||||||
|
|
@ -211,8 +211,8 @@ class ActorSelectionSpec extends AkkaSpec("akka.loglevel=DEBUG") with DefaultTim
|
||||||
|
|
||||||
"select actors by their relative path" in {
|
"select actors by their relative path" in {
|
||||||
def check(looker: ActorRef, result: ActorRef, elems: String*) {
|
def check(looker: ActorRef, result: ActorRef, elems: String*) {
|
||||||
askNode(looker, SelectString(elems mkString "/")) should equal(Some(result))
|
askNode(looker, SelectString(elems mkString "/")) should be(Some(result))
|
||||||
askNode(looker, SelectString(elems mkString ("", "/", "/"))) should equal(Some(result))
|
askNode(looker, SelectString(elems mkString ("", "/", "/"))) should be(Some(result))
|
||||||
}
|
}
|
||||||
check(c1, user, "..")
|
check(c1, user, "..")
|
||||||
for {
|
for {
|
||||||
|
|
@ -227,12 +227,12 @@ class ActorSelectionSpec extends AkkaSpec("akka.loglevel=DEBUG") with DefaultTim
|
||||||
"find system-generated actors" in {
|
"find system-generated actors" in {
|
||||||
def check(target: ActorRef) {
|
def check(target: ActorRef) {
|
||||||
for (looker ← all) {
|
for (looker ← all) {
|
||||||
askNode(looker, SelectPath(target.path)) should equal(Some(target))
|
askNode(looker, SelectPath(target.path)) should be(Some(target))
|
||||||
askNode(looker, SelectString(target.path.toString)) should equal(Some(target))
|
askNode(looker, SelectString(target.path.toString)) should be(Some(target))
|
||||||
askNode(looker, SelectString(target.path.toString + "/")) should equal(Some(target))
|
askNode(looker, SelectString(target.path.toString + "/")) should be(Some(target))
|
||||||
}
|
}
|
||||||
if (target != root)
|
if (target != root)
|
||||||
askNode(c1, SelectString("../.." + target.path.elements.mkString("/", "/", "/"))) should equal(Some(target))
|
askNode(c1, SelectString("../.." + target.path.elements.mkString("/", "/", "/"))) should be(Some(target))
|
||||||
}
|
}
|
||||||
for (target ← Seq(root, syst, user)) check(target)
|
for (target ← Seq(root, syst, user)) check(target)
|
||||||
}
|
}
|
||||||
|
|
@ -242,7 +242,7 @@ class ActorSelectionSpec extends AkkaSpec("akka.loglevel=DEBUG") with DefaultTim
|
||||||
|
|
||||||
def checkOne(looker: ActorRef, query: Query, result: Option[ActorRef]) {
|
def checkOne(looker: ActorRef, query: Query, result: Option[ActorRef]) {
|
||||||
val lookup = askNode(looker, query)
|
val lookup = askNode(looker, query)
|
||||||
lookup should equal(result)
|
lookup should be(result)
|
||||||
}
|
}
|
||||||
def check(looker: ActorRef) {
|
def check(looker: ActorRef) {
|
||||||
val lookname = looker.path.elements.mkString("", "/", "/")
|
val lookname = looker.path.elements.mkString("", "/", "/")
|
||||||
|
|
@ -265,19 +265,19 @@ class ActorSelectionSpec extends AkkaSpec("akka.loglevel=DEBUG") with DefaultTim
|
||||||
"send messages directly" in {
|
"send messages directly" in {
|
||||||
ActorSelection(c1, "") ! GetSender(testActor)
|
ActorSelection(c1, "") ! GetSender(testActor)
|
||||||
expectMsg(system.deadLetters)
|
expectMsg(system.deadLetters)
|
||||||
lastSender should equal(c1)
|
lastSender should be(c1)
|
||||||
}
|
}
|
||||||
|
|
||||||
"send messages to string path" in {
|
"send messages to string path" in {
|
||||||
system.actorSelection("/user/c2/c21") ! GetSender(testActor)
|
system.actorSelection("/user/c2/c21") ! GetSender(testActor)
|
||||||
expectMsg(system.deadLetters)
|
expectMsg(system.deadLetters)
|
||||||
lastSender should equal(c21)
|
lastSender should be(c21)
|
||||||
}
|
}
|
||||||
|
|
||||||
"send messages to actor path" in {
|
"send messages to actor path" in {
|
||||||
system.actorSelection(system / "c2" / "c21") ! GetSender(testActor)
|
system.actorSelection(system / "c2" / "c21") ! GetSender(testActor)
|
||||||
expectMsg(system.deadLetters)
|
expectMsg(system.deadLetters)
|
||||||
lastSender should equal(c21)
|
lastSender should be(c21)
|
||||||
}
|
}
|
||||||
|
|
||||||
"send messages with correct sender" in {
|
"send messages with correct sender" in {
|
||||||
|
|
@ -286,7 +286,7 @@ class ActorSelectionSpec extends AkkaSpec("akka.loglevel=DEBUG") with DefaultTim
|
||||||
val actors = Set() ++ receiveWhile(messages = 2) {
|
val actors = Set() ++ receiveWhile(messages = 2) {
|
||||||
case `c1` ⇒ lastSender
|
case `c1` ⇒ lastSender
|
||||||
}
|
}
|
||||||
actors should equal(Set(c1, c2))
|
actors should be(Set(c1, c2))
|
||||||
expectNoMsg(1 second)
|
expectNoMsg(1 second)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -296,20 +296,20 @@ class ActorSelectionSpec extends AkkaSpec("akka.loglevel=DEBUG") with DefaultTim
|
||||||
val actors = receiveWhile(messages = 2) {
|
val actors = receiveWhile(messages = 2) {
|
||||||
case `c2` ⇒ lastSender
|
case `c2` ⇒ lastSender
|
||||||
}
|
}
|
||||||
actors should equal(Seq(c21))
|
actors should be(Seq(c21))
|
||||||
expectNoMsg(1 second)
|
expectNoMsg(1 second)
|
||||||
}
|
}
|
||||||
|
|
||||||
"resolve one actor with explicit timeout" in {
|
"resolve one actor with explicit timeout" in {
|
||||||
val s = system.actorSelection(system / "c2")
|
val s = system.actorSelection(system / "c2")
|
||||||
// Java and Scala API
|
// Java and Scala API
|
||||||
Await.result(s.resolveOne(1.second.dilated), timeout.duration) should equal(c2)
|
Await.result(s.resolveOne(1.second.dilated), timeout.duration) should be(c2)
|
||||||
}
|
}
|
||||||
|
|
||||||
"resolve one actor with implicit timeout" in {
|
"resolve one actor with implicit timeout" in {
|
||||||
val s = system.actorSelection(system / "c2")
|
val s = system.actorSelection(system / "c2")
|
||||||
// Scala API; implicit timeout from DefaultTimeout trait
|
// Scala API; implicit timeout from DefaultTimeout trait
|
||||||
Await.result(s.resolveOne(), timeout.duration) should equal(c2)
|
Await.result(s.resolveOne(), timeout.duration) should be(c2)
|
||||||
}
|
}
|
||||||
|
|
||||||
"resolve non-existing with Failure" in {
|
"resolve non-existing with Failure" in {
|
||||||
|
|
@ -319,8 +319,8 @@ class ActorSelectionSpec extends AkkaSpec("akka.loglevel=DEBUG") with DefaultTim
|
||||||
}
|
}
|
||||||
|
|
||||||
"compare equally" in {
|
"compare equally" in {
|
||||||
ActorSelection(c21, "../*/hello") should equal(ActorSelection(c21, "../*/hello"))
|
ActorSelection(c21, "../*/hello") should be(ActorSelection(c21, "../*/hello"))
|
||||||
ActorSelection(c21, "../*/hello").## should equal(ActorSelection(c21, "../*/hello").##)
|
ActorSelection(c21, "../*/hello").## should be(ActorSelection(c21, "../*/hello").##)
|
||||||
ActorSelection(c2, "../*/hello") should not be ActorSelection(c21, "../*/hello")
|
ActorSelection(c2, "../*/hello") should not be 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")
|
ActorSelection(c21, "../*/hell") should not be ActorSelection(c21, "../*/hello")
|
||||||
|
|
|
||||||
|
|
@ -138,7 +138,7 @@ class ActorSystemSpec extends AkkaSpec(ActorSystemSpec.config) with ImplicitSend
|
||||||
"An ActorSystem" must {
|
"An ActorSystem" must {
|
||||||
|
|
||||||
"use scala.concurrent.Future's InternalCallbackEC" in {
|
"use scala.concurrent.Future's InternalCallbackEC" in {
|
||||||
system.asInstanceOf[ActorSystemImpl].internalCallingThreadExecutionContext.getClass.getName should equal("scala.concurrent.Future$InternalCallbackExecutor$")
|
system.asInstanceOf[ActorSystemImpl].internalCallingThreadExecutionContext.getClass.getName should be("scala.concurrent.Future$InternalCallbackExecutor$")
|
||||||
}
|
}
|
||||||
|
|
||||||
"reject invalid names" in {
|
"reject invalid names" in {
|
||||||
|
|
@ -164,8 +164,8 @@ class ActorSystemSpec extends AkkaSpec(ActorSystemSpec.config) with ImplicitSend
|
||||||
"support extensions" in {
|
"support extensions" in {
|
||||||
// TestExtension is configured and should be loaded at startup
|
// TestExtension is configured and should be loaded at startup
|
||||||
system.hasExtension(TestExtension) should be(true)
|
system.hasExtension(TestExtension) should be(true)
|
||||||
TestExtension(system).system should equal(system)
|
TestExtension(system).system should be(system)
|
||||||
system.extension(TestExtension).system should equal(system)
|
system.extension(TestExtension).system should be(system)
|
||||||
}
|
}
|
||||||
|
|
||||||
"log dead letters" in {
|
"log dead letters" in {
|
||||||
|
|
@ -241,7 +241,7 @@ class ActorSystemSpec extends AkkaSpec(ActorSystemSpec.config) with ImplicitSend
|
||||||
import system.dispatcher
|
import system.dispatcher
|
||||||
implicit val timeout = Timeout((20 seconds).dilated)
|
implicit val timeout = Timeout((20 seconds).dilated)
|
||||||
val waves = for (i ← 1 to 3) yield system.actorOf(Props[ActorSystemSpec.Waves]) ? 50000
|
val waves = for (i ← 1 to 3) yield system.actorOf(Props[ActorSystemSpec.Waves]) ? 50000
|
||||||
Await.result(Future.sequence(waves), timeout.duration + 5.seconds) should equal(Seq("done", "done", "done"))
|
Await.result(Future.sequence(waves), timeout.duration + 5.seconds) should be(Seq("done", "done", "done"))
|
||||||
}
|
}
|
||||||
|
|
||||||
"find actors that just have been created" in {
|
"find actors that just have been created" in {
|
||||||
|
|
|
||||||
|
|
@ -120,11 +120,11 @@ trait DeathWatchSpec { this: AkkaSpec with ImplicitSender with DefaultTimeout
|
||||||
|
|
||||||
terminal ! Kill
|
terminal ! Kill
|
||||||
terminal ! Kill
|
terminal ! Kill
|
||||||
Await.result(terminal ? "foo", timeout.duration) should equal("foo")
|
Await.result(terminal ? "foo", timeout.duration) should be("foo")
|
||||||
terminal ! Kill
|
terminal ! Kill
|
||||||
|
|
||||||
expectTerminationOf(terminal)
|
expectTerminationOf(terminal)
|
||||||
terminal.isTerminated should equal(true)
|
terminal.isTerminated should be(true)
|
||||||
|
|
||||||
system.stop(supervisor)
|
system.stop(supervisor)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -123,7 +123,7 @@ class FSMActorSpec extends AkkaSpec(Map("akka.actor.debug.fsm" -> true)) with Im
|
||||||
val transitionTester = system.actorOf(Props(new Actor {
|
val transitionTester = system.actorOf(Props(new Actor {
|
||||||
def receive = {
|
def receive = {
|
||||||
case Transition(_, _, _) ⇒ transitionCallBackLatch.open
|
case Transition(_, _, _) ⇒ transitionCallBackLatch.open
|
||||||
case CurrentState(_, Locked) ⇒ initialStateLatch.open
|
case CurrentState(_, s: LockState) if s eq Locked ⇒ initialStateLatch.open // SI-5900 workaround
|
||||||
}
|
}
|
||||||
}))
|
}))
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ class FSMTimingSpec extends AkkaSpec with ImplicitSender {
|
||||||
expectMsg(1 second, CurrentState(fsm, Initial))
|
expectMsg(1 second, CurrentState(fsm, Initial))
|
||||||
|
|
||||||
ignoreMsg {
|
ignoreMsg {
|
||||||
case Transition(_, Initial, _) ⇒ true
|
case Transition(_, bs: FSMTimingSpec.State, _) if bs eq Initial ⇒ true // SI-5900 workaround
|
||||||
}
|
}
|
||||||
|
|
||||||
"A Finite State Machine" must {
|
"A Finite State Machine" must {
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,7 @@ class LocalActorRefProviderSpec extends AkkaSpec(LocalActorRefProviderSpec.confi
|
||||||
"find actor refs using actorFor" in {
|
"find actor refs using actorFor" in {
|
||||||
val a = system.actorOf(Props(new Actor { def receive = { case _ ⇒ } }))
|
val a = system.actorOf(Props(new Actor { def receive = { case _ ⇒ } }))
|
||||||
val b = system.actorFor(a.path)
|
val b = system.actorFor(a.path)
|
||||||
a should equal(b)
|
a should be(b)
|
||||||
}
|
}
|
||||||
|
|
||||||
"find child actor with URL encoded name using actorFor" in {
|
"find child actor with URL encoded name using actorFor" in {
|
||||||
|
|
@ -97,7 +97,7 @@ class LocalActorRefProviderSpec extends AkkaSpec(LocalActorRefProviderSpec.confi
|
||||||
case Some(Failure(ex: InvalidActorNameException)) ⇒ 2
|
case Some(Failure(ex: InvalidActorNameException)) ⇒ 2
|
||||||
case x ⇒ x
|
case x ⇒ x
|
||||||
})
|
})
|
||||||
set should equal(Set(1, 2))
|
set should be(Set(1, 2))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -482,7 +482,7 @@ class LightArrayRevolverSchedulerSpec extends AkkaSpec(SchedulerSpec.testConfRev
|
||||||
val s = success.size
|
val s = success.size
|
||||||
s should be < cap
|
s should be < cap
|
||||||
awaitCond(s == counter.get, message = s"$s was not ${counter.get}")
|
awaitCond(s == counter.get, message = s"$s was not ${counter.get}")
|
||||||
failure.size should equal(headroom)
|
failure.size should be(headroom)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -860,9 +860,9 @@ class SupervisorHierarchySpec extends AkkaSpec(SupervisorHierarchySpec.config) w
|
||||||
failResumer ! "blahonga"
|
failResumer ! "blahonga"
|
||||||
expectMsg("blahonga")
|
expectMsg("blahonga")
|
||||||
}
|
}
|
||||||
createAttempt.get should equal(6)
|
createAttempt.get should be(6)
|
||||||
preStartCalled.get should equal(1)
|
preStartCalled.get should be(1)
|
||||||
postRestartCalled.get should equal(0)
|
postRestartCalled.get should be(0)
|
||||||
}
|
}
|
||||||
|
|
||||||
"survive being stressed" in {
|
"survive being stressed" in {
|
||||||
|
|
|
||||||
|
|
@ -63,7 +63,7 @@ class SupervisorMiscSpec extends AkkaSpec(SupervisorMiscSpec.config) with Defaul
|
||||||
Seq("actor1" -> actor1, "actor2" -> actor2, "actor3" -> actor3, "actor4" -> actor4) map {
|
Seq("actor1" -> actor1, "actor2" -> actor2, "actor3" -> actor3, "actor4" -> actor4) map {
|
||||||
case (id, ref) ⇒ (id, ref ? "status")
|
case (id, ref) ⇒ (id, ref ? "status")
|
||||||
} foreach {
|
} foreach {
|
||||||
case (id, f) ⇒ (id, Await.result(f, timeout.duration)) should equal((id, "OK"))
|
case (id, f) ⇒ (id, Await.result(f, timeout.duration)) should be((id, "OK"))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -156,8 +156,8 @@ class SupervisorMiscSpec extends AkkaSpec(SupervisorMiscSpec.config) with Defaul
|
||||||
parent ! "doit"
|
parent ! "doit"
|
||||||
}
|
}
|
||||||
val p = expectMsgType[ActorRef].path
|
val p = expectMsgType[ActorRef].path
|
||||||
p.parent should equal(parent.path)
|
p.parent should be(parent.path)
|
||||||
p.name should equal("child")
|
p.name should be("child")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -139,7 +139,7 @@ class SupervisorSpec extends AkkaSpec("akka.actor.serialize-messages = off") wit
|
||||||
}
|
}
|
||||||
|
|
||||||
def ping(pingPongActor: ActorRef) = {
|
def ping(pingPongActor: ActorRef) = {
|
||||||
Await.result(pingPongActor.?(Ping)(DilatedTimeout), DilatedTimeout) should equal(PongMessage)
|
Await.result(pingPongActor.?(Ping)(DilatedTimeout), DilatedTimeout) should be(PongMessage)
|
||||||
expectMsg(Timeout, PingMessage)
|
expectMsg(Timeout, PingMessage)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -247,7 +247,7 @@ class TypedActorSpec extends AkkaSpec(TypedActorSpec.config)
|
||||||
filterEvents(EventFilter[IllegalStateException]("Calling")) {
|
filterEvents(EventFilter[IllegalStateException]("Calling")) {
|
||||||
(intercept[IllegalStateException] {
|
(intercept[IllegalStateException] {
|
||||||
TypedActor.self[Foo]
|
TypedActor.self[Foo]
|
||||||
}).getMessage should equal("Calling TypedActor.self outside of a TypedActor implementation method!")
|
}).getMessage should be("Calling TypedActor.self outside of a TypedActor implementation method!")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -265,7 +265,7 @@ class TypedActorSpec extends AkkaSpec(TypedActorSpec.config)
|
||||||
|
|
||||||
"be able to call equals" in {
|
"be able to call equals" in {
|
||||||
val t = newFooBar
|
val t = newFooBar
|
||||||
t should equal(t)
|
t should be(t)
|
||||||
t should not equal (null)
|
t should not equal (null)
|
||||||
mustStop(t)
|
mustStop(t)
|
||||||
}
|
}
|
||||||
|
|
@ -294,8 +294,8 @@ class TypedActorSpec extends AkkaSpec(TypedActorSpec.config)
|
||||||
|
|
||||||
"be able to call null returning methods" in {
|
"be able to call null returning methods" in {
|
||||||
val t = newFooBar
|
val t = newFooBar
|
||||||
t.nullJOption() should equal(JOption.none)
|
t.nullJOption() should be(JOption.none)
|
||||||
t.nullOption() should equal(None)
|
t.nullOption() should be(None)
|
||||||
t.nullReturn() should ===(null)
|
t.nullReturn() should ===(null)
|
||||||
Await.result(t.nullFuture(), timeout.duration) should ===(null)
|
Await.result(t.nullFuture(), timeout.duration) should ===(null)
|
||||||
}
|
}
|
||||||
|
|
@ -341,7 +341,7 @@ class TypedActorSpec extends AkkaSpec(TypedActorSpec.config)
|
||||||
val t, t2 = newFooBar(remaining)
|
val t, t2 = newFooBar(remaining)
|
||||||
val f = t.futureComposePigdogFrom(t2)
|
val f = t.futureComposePigdogFrom(t2)
|
||||||
f.isCompleted should be(false)
|
f.isCompleted should be(false)
|
||||||
Await.result(f, remaining) should equal("PIGDOG")
|
Await.result(f, remaining) should be("PIGDOG")
|
||||||
mustStop(t)
|
mustStop(t)
|
||||||
mustStop(t2)
|
mustStop(t2)
|
||||||
}
|
}
|
||||||
|
|
@ -379,13 +379,13 @@ class TypedActorSpec extends AkkaSpec(TypedActorSpec.config)
|
||||||
"be restarted on failure" in {
|
"be restarted on failure" in {
|
||||||
filterEvents(EventFilter[IllegalStateException]("expected")) {
|
filterEvents(EventFilter[IllegalStateException]("expected")) {
|
||||||
val t = newFooBar(Duration(2, "s"))
|
val t = newFooBar(Duration(2, "s"))
|
||||||
intercept[IllegalStateException] { t.failingOptionPigdog() }.getMessage should equal("expected")
|
intercept[IllegalStateException] { t.failingOptionPigdog() }.getMessage should be("expected")
|
||||||
t.optionPigdog() should equal(Some("Pigdog"))
|
t.optionPigdog() should be(Some("Pigdog"))
|
||||||
mustStop(t)
|
mustStop(t)
|
||||||
|
|
||||||
val ta: F = TypedActor(system).typedActorOf(TypedProps[FI]())
|
val ta: F = TypedActor(system).typedActorOf(TypedProps[FI]())
|
||||||
intercept[IllegalStateException] { ta.f(true) }.getMessage should equal("expected")
|
intercept[IllegalStateException] { ta.f(true) }.getMessage should be("expected")
|
||||||
ta.f(false) should equal(1)
|
ta.f(false) should be(1)
|
||||||
|
|
||||||
mustStop(ta)
|
mustStop(ta)
|
||||||
}
|
}
|
||||||
|
|
@ -404,7 +404,7 @@ class TypedActorSpec extends AkkaSpec(TypedActorSpec.config)
|
||||||
val f2 = t.futurePigdog(Duration.Zero)
|
val f2 = t.futurePigdog(Duration.Zero)
|
||||||
f2.isCompleted should be(false)
|
f2.isCompleted should be(false)
|
||||||
f.isCompleted should be(false)
|
f.isCompleted should be(false)
|
||||||
Await.result(f, remaining) should equal(Await.result(f2, remaining))
|
Await.result(f, remaining) should be(Await.result(f2, remaining))
|
||||||
mustStop(t)
|
mustStop(t)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -462,10 +462,10 @@ class TypedActorSpec extends AkkaSpec(TypedActorSpec.config)
|
||||||
mNew.method should be(m.method)
|
mNew.method should be(m.method)
|
||||||
mNew.parameters should have size 3
|
mNew.parameters should have size 3
|
||||||
mNew.parameters(0) should not be null
|
mNew.parameters(0) should not be null
|
||||||
mNew.parameters(0).getClass should equal(classOf[Bar])
|
mNew.parameters(0).getClass should be(classOf[Bar])
|
||||||
mNew.parameters(1) should be(null)
|
mNew.parameters(1) should be(null)
|
||||||
mNew.parameters(2) should not be null
|
mNew.parameters(2) should not be null
|
||||||
mNew.parameters(2).asInstanceOf[Int] should equal(1)
|
mNew.parameters(2).asInstanceOf[Int] should be(1)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -474,7 +474,7 @@ class TypedActorSpec extends AkkaSpec(TypedActorSpec.config)
|
||||||
JavaSerializer.currentSystem.withValue(system.asInstanceOf[ExtendedActorSystem]) {
|
JavaSerializer.currentSystem.withValue(system.asInstanceOf[ExtendedActorSystem]) {
|
||||||
val t = newFooBar(Duration(2, "s"))
|
val t = newFooBar(Duration(2, "s"))
|
||||||
|
|
||||||
t.optionPigdog() should equal(Some("Pigdog"))
|
t.optionPigdog() should be(Some("Pigdog"))
|
||||||
|
|
||||||
val baos = new ByteArrayOutputStream(8192 * 4)
|
val baos = new ByteArrayOutputStream(8192 * 4)
|
||||||
val out = new ObjectOutputStream(baos)
|
val out = new ObjectOutputStream(baos)
|
||||||
|
|
@ -486,9 +486,9 @@ class TypedActorSpec extends AkkaSpec(TypedActorSpec.config)
|
||||||
|
|
||||||
val tNew = in.readObject().asInstanceOf[Foo]
|
val tNew = in.readObject().asInstanceOf[Foo]
|
||||||
|
|
||||||
tNew should equal(t)
|
tNew should be(t)
|
||||||
|
|
||||||
tNew.optionPigdog() should equal(Some("Pigdog"))
|
tNew.optionPigdog() should be(Some("Pigdog"))
|
||||||
|
|
||||||
mustStop(t)
|
mustStop(t)
|
||||||
}
|
}
|
||||||
|
|
@ -512,7 +512,7 @@ class TypedActorSpec extends AkkaSpec(TypedActorSpec.config)
|
||||||
//Done with that now
|
//Done with that now
|
||||||
|
|
||||||
ta.poisonPill(t)
|
ta.poisonPill(t)
|
||||||
latch.await(10, TimeUnit.SECONDS) should equal(true)
|
latch.await(10, TimeUnit.SECONDS) should be(true)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -114,8 +114,8 @@ class DispatchersSpec extends AkkaSpec(DispatchersSpec.config) with ImplicitSend
|
||||||
|
|
||||||
"have only one default dispatcher" in {
|
"have only one default dispatcher" in {
|
||||||
val dispatcher = lookup(Dispatchers.DefaultDispatcherId)
|
val dispatcher = lookup(Dispatchers.DefaultDispatcherId)
|
||||||
dispatcher should equal(defaultGlobalDispatcher)
|
dispatcher should be(defaultGlobalDispatcher)
|
||||||
dispatcher should equal(system.dispatcher)
|
dispatcher should be(system.dispatcher)
|
||||||
}
|
}
|
||||||
|
|
||||||
"throw ConfigurationException if type does not exist" in {
|
"throw ConfigurationException if type does not exist" in {
|
||||||
|
|
@ -133,7 +133,7 @@ class DispatchersSpec extends AkkaSpec(DispatchersSpec.config) with ImplicitSend
|
||||||
"provide lookup of dispatchers by id" in {
|
"provide lookup of dispatchers by id" in {
|
||||||
val d1 = lookup("myapp.mydispatcher")
|
val d1 = lookup("myapp.mydispatcher")
|
||||||
val d2 = lookup("myapp.mydispatcher")
|
val d2 = lookup("myapp.mydispatcher")
|
||||||
d1 should equal(d2)
|
d1 should be(d2)
|
||||||
}
|
}
|
||||||
|
|
||||||
"include system name and dispatcher id in thread names for fork-join-executor" in {
|
"include system name and dispatcher id in thread names for fork-join-executor" in {
|
||||||
|
|
|
||||||
|
|
@ -25,19 +25,19 @@ class ConfigSpec extends AkkaSpec(ConfigFactory.defaultReference(ActorSystem.fin
|
||||||
{
|
{
|
||||||
import config._
|
import config._
|
||||||
|
|
||||||
getString("akka.version") should equal("2.3-SNAPSHOT")
|
getString("akka.version") should be("2.3-SNAPSHOT")
|
||||||
settings.ConfigVersion should equal("2.3-SNAPSHOT")
|
settings.ConfigVersion should be("2.3-SNAPSHOT")
|
||||||
|
|
||||||
getBoolean("akka.daemonic") should equal(false)
|
getBoolean("akka.daemonic") should be(false)
|
||||||
|
|
||||||
// WARNING: This setting should be off in the default reference.conf, but should be on when running
|
// WARNING: This setting should be off in the default reference.conf, but should be on when running
|
||||||
// the test suite.
|
// the test suite.
|
||||||
getBoolean("akka.actor.serialize-messages") should equal(true)
|
getBoolean("akka.actor.serialize-messages") should be(true)
|
||||||
settings.SerializeAllMessages should equal(true)
|
settings.SerializeAllMessages should be(true)
|
||||||
|
|
||||||
getInt("akka.scheduler.ticks-per-wheel") should equal(512)
|
getInt("akka.scheduler.ticks-per-wheel") should be(512)
|
||||||
getDuration("akka.scheduler.tick-duration", TimeUnit.MILLISECONDS) should equal(10)
|
getDuration("akka.scheduler.tick-duration", TimeUnit.MILLISECONDS) should be(10)
|
||||||
getString("akka.scheduler.implementation") should equal("akka.actor.LightArrayRevolverScheduler")
|
getString("akka.scheduler.implementation") should be("akka.actor.LightArrayRevolverScheduler")
|
||||||
|
|
||||||
getBoolean("akka.daemonic") should be(false)
|
getBoolean("akka.daemonic") should be(false)
|
||||||
settings.Daemonicity should be(false)
|
settings.Daemonicity should be(false)
|
||||||
|
|
@ -71,27 +71,27 @@ class ConfigSpec extends AkkaSpec(ConfigFactory.defaultReference(ActorSystem.fin
|
||||||
//General dispatcher config
|
//General dispatcher config
|
||||||
|
|
||||||
{
|
{
|
||||||
c.getString("type") should equal("Dispatcher")
|
c.getString("type") should be("Dispatcher")
|
||||||
c.getString("executor") should equal("default-executor")
|
c.getString("executor") should be("default-executor")
|
||||||
c.getDuration("shutdown-timeout", TimeUnit.MILLISECONDS) should equal(1 * 1000)
|
c.getDuration("shutdown-timeout", TimeUnit.MILLISECONDS) should be(1 * 1000)
|
||||||
c.getInt("throughput") should equal(5)
|
c.getInt("throughput") should be(5)
|
||||||
c.getDuration("throughput-deadline-time", TimeUnit.MILLISECONDS) should equal(0)
|
c.getDuration("throughput-deadline-time", TimeUnit.MILLISECONDS) should be(0)
|
||||||
c.getBoolean("attempt-teamwork") should equal(true)
|
c.getBoolean("attempt-teamwork") should be(true)
|
||||||
}
|
}
|
||||||
|
|
||||||
//Default executor config
|
//Default executor config
|
||||||
{
|
{
|
||||||
val pool = c.getConfig("default-executor")
|
val pool = c.getConfig("default-executor")
|
||||||
pool.getString("fallback") should equal("fork-join-executor")
|
pool.getString("fallback") should be("fork-join-executor")
|
||||||
}
|
}
|
||||||
|
|
||||||
//Fork join executor config
|
//Fork join executor config
|
||||||
|
|
||||||
{
|
{
|
||||||
val pool = c.getConfig("fork-join-executor")
|
val pool = c.getConfig("fork-join-executor")
|
||||||
pool.getInt("parallelism-min") should equal(8)
|
pool.getInt("parallelism-min") should be(8)
|
||||||
pool.getDouble("parallelism-factor") should equal(3.0)
|
pool.getDouble("parallelism-factor") should be(3.0)
|
||||||
pool.getInt("parallelism-max") should equal(64)
|
pool.getInt("parallelism-max") should be(64)
|
||||||
}
|
}
|
||||||
|
|
||||||
//Thread pool executor config
|
//Thread pool executor config
|
||||||
|
|
@ -99,12 +99,12 @@ class ConfigSpec extends AkkaSpec(ConfigFactory.defaultReference(ActorSystem.fin
|
||||||
{
|
{
|
||||||
val pool = c.getConfig("thread-pool-executor")
|
val pool = c.getConfig("thread-pool-executor")
|
||||||
import pool._
|
import pool._
|
||||||
getDuration("keep-alive-time", TimeUnit.MILLISECONDS) should equal(60 * 1000)
|
getDuration("keep-alive-time", TimeUnit.MILLISECONDS) should be(60 * 1000)
|
||||||
getDouble("core-pool-size-factor") should equal(3.0)
|
getDouble("core-pool-size-factor") should be(3.0)
|
||||||
getDouble("max-pool-size-factor") should equal(3.0)
|
getDouble("max-pool-size-factor") should be(3.0)
|
||||||
getInt("task-queue-size") should equal(-1)
|
getInt("task-queue-size") should be(-1)
|
||||||
getString("task-queue-type") should equal("linked")
|
getString("task-queue-type") should be("linked")
|
||||||
getBoolean("allow-core-timeout") should equal(true)
|
getBoolean("allow-core-timeout") should be(true)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Debug config
|
// Debug config
|
||||||
|
|
@ -141,8 +141,8 @@ class ConfigSpec extends AkkaSpec(ConfigFactory.defaultReference(ActorSystem.fin
|
||||||
// general mailbox config
|
// general mailbox config
|
||||||
|
|
||||||
{
|
{
|
||||||
c.getInt("mailbox-capacity") should equal(1000)
|
c.getInt("mailbox-capacity") should be(1000)
|
||||||
c.getDuration("mailbox-push-timeout-time", TimeUnit.MILLISECONDS) should equal(10 * 1000)
|
c.getDuration("mailbox-push-timeout-time", TimeUnit.MILLISECONDS) should be(10 * 1000)
|
||||||
c.getString("mailbox-type") should be("akka.dispatch.UnboundedMailbox")
|
c.getString("mailbox-type") should be("akka.dispatch.UnboundedMailbox")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -55,7 +55,7 @@ class ExecutionContextSpec extends AkkaSpec with DefaultTimeout {
|
||||||
}
|
}
|
||||||
callingThreadLock.compareAndSet(1, 0) // Disable the lock
|
callingThreadLock.compareAndSet(1, 0) // Disable the lock
|
||||||
}
|
}
|
||||||
Await.result(p.future, timeout.duration) should equal(())
|
Await.result(p.future, timeout.duration) should be(())
|
||||||
}
|
}
|
||||||
|
|
||||||
"be able to avoid starvation when Batching is used and Await/blocking is called" in {
|
"be able to avoid starvation when Batching is used and Await/blocking is called" in {
|
||||||
|
|
@ -93,15 +93,15 @@ class ExecutionContextSpec extends AkkaSpec with DefaultTimeout {
|
||||||
awaitCond(counter.get == 2)
|
awaitCond(counter.get == 2)
|
||||||
perform(_ + 4)
|
perform(_ + 4)
|
||||||
perform(_ * 2)
|
perform(_ * 2)
|
||||||
sec.size should equal(2)
|
sec.size should be(2)
|
||||||
Thread.sleep(500)
|
Thread.sleep(500)
|
||||||
sec.size should equal(2)
|
sec.size should be(2)
|
||||||
counter.get should equal(2)
|
counter.get should be(2)
|
||||||
sec.resume()
|
sec.resume()
|
||||||
awaitCond(counter.get == 12)
|
awaitCond(counter.get == 12)
|
||||||
perform(_ * 2)
|
perform(_ * 2)
|
||||||
awaitCond(counter.get == 24)
|
awaitCond(counter.get == 24)
|
||||||
sec.isEmpty should equal(true)
|
sec.isEmpty should be(true)
|
||||||
}
|
}
|
||||||
|
|
||||||
"execute 'throughput' number of tasks per sweep" in {
|
"execute 'throughput' number of tasks per sweep" in {
|
||||||
|
|
@ -118,11 +118,11 @@ class ExecutionContextSpec extends AkkaSpec with DefaultTimeout {
|
||||||
|
|
||||||
val total = 1000
|
val total = 1000
|
||||||
1 to total foreach { _ ⇒ perform(_ + 1) }
|
1 to total foreach { _ ⇒ perform(_ + 1) }
|
||||||
sec.size() should equal(total)
|
sec.size() should be(total)
|
||||||
sec.resume()
|
sec.resume()
|
||||||
awaitCond(counter.get == total)
|
awaitCond(counter.get == total)
|
||||||
submissions.get should equal(total / throughput)
|
submissions.get should be(total / throughput)
|
||||||
sec.isEmpty should equal(true)
|
sec.isEmpty should be(true)
|
||||||
}
|
}
|
||||||
|
|
||||||
"execute tasks in serial" in {
|
"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) }
|
1 to total foreach { i ⇒ perform(c ⇒ if (c == (i - 1)) c + 1 else c) }
|
||||||
awaitCond(counter.get == total)
|
awaitCond(counter.get == total)
|
||||||
sec.isEmpty should equal(true)
|
sec.isEmpty should be(true)
|
||||||
}
|
}
|
||||||
|
|
||||||
"relinquish thread when suspended" in {
|
"relinquish thread when suspended" in {
|
||||||
|
|
@ -151,13 +151,13 @@ class ExecutionContextSpec extends AkkaSpec with DefaultTimeout {
|
||||||
1 to 10 foreach { _ ⇒ perform(identity) }
|
1 to 10 foreach { _ ⇒ perform(identity) }
|
||||||
perform(x ⇒ { sec.suspend(); x * 2 })
|
perform(x ⇒ { sec.suspend(); x * 2 })
|
||||||
perform(_ + 8)
|
perform(_ + 8)
|
||||||
sec.size should equal(13)
|
sec.size should be(13)
|
||||||
sec.resume()
|
sec.resume()
|
||||||
awaitCond(counter.get == 2)
|
awaitCond(counter.get == 2)
|
||||||
sec.resume()
|
sec.resume()
|
||||||
awaitCond(counter.get == 10)
|
awaitCond(counter.get == 10)
|
||||||
sec.isEmpty should equal(true)
|
sec.isEmpty should be(true)
|
||||||
submissions.get should equal(2)
|
submissions.get should be(2)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -71,9 +71,10 @@ class FutureSpec extends AkkaSpec with Checkers with BeforeAndAfterAll with Defa
|
||||||
Await.result(failure fallbackTo timedOut, timeout.duration) should be("Timedout")
|
Await.result(failure fallbackTo timedOut, timeout.duration) should be("Timedout")
|
||||||
Await.result(timedOut fallbackTo empty, 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 failure fallbackTo timedOut, timeout.duration) should be("Timedout")
|
||||||
|
val expected = if (scala.util.Properties.versionNumberString.startsWith("2.10.")) "last" else "br0ken"
|
||||||
intercept[RuntimeException] {
|
intercept[RuntimeException] {
|
||||||
Await.result(failure fallbackTo otherFailure, timeout.duration)
|
Await.result(failure fallbackTo otherFailure, timeout.duration)
|
||||||
}.getMessage should be("last")
|
}.getMessage should be(expected)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
"completed with a result" must {
|
"completed with a result" must {
|
||||||
|
|
@ -117,7 +118,7 @@ class FutureSpec extends AkkaSpec with Checkers with BeforeAndAfterAll with Defa
|
||||||
|
|
||||||
p.completeWith(Future { "Hi " }(B))
|
p.completeWith(Future { "Hi " }(B))
|
||||||
try {
|
try {
|
||||||
Await.result(result, timeout.duration) should equal("Hi A")
|
Await.result(result, timeout.duration) should be("Hi A")
|
||||||
} finally {
|
} finally {
|
||||||
A.shutdown()
|
A.shutdown()
|
||||||
B.shutdown()
|
B.shutdown()
|
||||||
|
|
@ -351,7 +352,7 @@ class FutureSpec extends AkkaSpec with Checkers with BeforeAndAfterAll with Defa
|
||||||
Await.result(Promise.failed[String](o).future recoverWith { case _ if false == true ⇒ yay }, timeout.duration)
|
Await.result(Promise.failed[String](o).future recoverWith { case _ if false == true ⇒ yay }, timeout.duration)
|
||||||
} should be(o)
|
} should be(o)
|
||||||
|
|
||||||
Await.result(Promise.failed[String](o).future recoverWith { case _ ⇒ yay }, timeout.duration) should equal("yay!")
|
Await.result(Promise.failed[String](o).future recoverWith { case _ ⇒ yay }, timeout.duration) should be("yay!")
|
||||||
|
|
||||||
intercept[IllegalStateException] {
|
intercept[IllegalStateException] {
|
||||||
Await.result(Promise.failed[String](o).future recoverWith { case _ ⇒ Promise.failed[String](r).future }, timeout.duration)
|
Await.result(Promise.failed[String](o).future recoverWith { case _ ⇒ Promise.failed[String](r).future }, timeout.duration)
|
||||||
|
|
@ -451,7 +452,7 @@ class FutureSpec extends AkkaSpec with Checkers with BeforeAndAfterAll with Defa
|
||||||
case 6 ⇒ Future(throw new IllegalArgumentException("shouldReduceResultsWithException: expected"))
|
case 6 ⇒ Future(throw new IllegalArgumentException("shouldReduceResultsWithException: expected"))
|
||||||
case i ⇒ Future(i)
|
case i ⇒ Future(i)
|
||||||
}
|
}
|
||||||
intercept[Throwable] { Await.result(Future.reduce(futures)(_ + _), remaining) }.getMessage should equal("shouldReduceResultsWithException: expected")
|
intercept[Throwable] { Await.result(Future.reduce(futures)(_ + _), remaining) }.getMessage should be("shouldReduceResultsWithException: expected")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -49,17 +49,17 @@ abstract class MailboxSpec extends AkkaSpec with BeforeAndAfterAll with BeforeAn
|
||||||
|
|
||||||
for (i ← 1 to config.capacity) q.enqueue(testActor, exampleMessage)
|
for (i ← 1 to config.capacity) q.enqueue(testActor, exampleMessage)
|
||||||
|
|
||||||
q.numberOfMessages should equal(config.capacity)
|
q.numberOfMessages should be(config.capacity)
|
||||||
q.hasMessages should equal(true)
|
q.hasMessages should be(true)
|
||||||
|
|
||||||
system.eventStream.subscribe(testActor, classOf[DeadLetter])
|
system.eventStream.subscribe(testActor, classOf[DeadLetter])
|
||||||
q.enqueue(testActor, exampleMessage)
|
q.enqueue(testActor, exampleMessage)
|
||||||
expectMsg(DeadLetter(exampleMessage.message, system.deadLetters, testActor))
|
expectMsg(DeadLetter(exampleMessage.message, system.deadLetters, testActor))
|
||||||
system.eventStream.unsubscribe(testActor, classOf[DeadLetter])
|
system.eventStream.unsubscribe(testActor, classOf[DeadLetter])
|
||||||
|
|
||||||
q.dequeue should equal(exampleMessage)
|
q.dequeue should be(exampleMessage)
|
||||||
q.numberOfMessages should be(config.capacity - 1)
|
q.numberOfMessages should be(config.capacity - 1)
|
||||||
q.hasMessages should equal(true)
|
q.hasMessages should be(true)
|
||||||
}
|
}
|
||||||
|
|
||||||
"dequeue what was enqueued properly for unbounded mailboxes" in {
|
"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 {
|
def ensureMailboxSize(q: MessageQueue, expected: Int): Unit = q.numberOfMessages match {
|
||||||
case -1 | `expected` ⇒
|
case -1 | `expected` ⇒
|
||||||
q.hasMessages should equal(expected != 0)
|
q.hasMessages should be(expected != 0)
|
||||||
case other ⇒
|
case other ⇒
|
||||||
other should equal(expected)
|
other should be(expected)
|
||||||
q.hasMessages should equal(expected != 0)
|
q.hasMessages should be(expected != 0)
|
||||||
}
|
}
|
||||||
|
|
||||||
def ensureSingleConsumerEnqueueDequeue(config: MailboxType) {
|
def ensureSingleConsumerEnqueueDequeue(config: MailboxType) {
|
||||||
val q = factory(config)
|
val q = factory(config)
|
||||||
ensureMailboxSize(q, 0)
|
ensureMailboxSize(q, 0)
|
||||||
q.dequeue should equal(null)
|
q.dequeue should be(null)
|
||||||
for (i ← 1 to 100) {
|
for (i ← 1 to 100) {
|
||||||
q.enqueue(testActor, exampleMessage)
|
q.enqueue(testActor, exampleMessage)
|
||||||
ensureMailboxSize(q, i)
|
ensureMailboxSize(q, i)
|
||||||
|
|
@ -104,11 +104,11 @@ abstract class MailboxSpec extends AkkaSpec with BeforeAndAfterAll with BeforeAn
|
||||||
ensureMailboxSize(q, 100)
|
ensureMailboxSize(q, 100)
|
||||||
|
|
||||||
for (i ← 99 to 0 by -1) {
|
for (i ← 99 to 0 by -1) {
|
||||||
q.dequeue() should equal(exampleMessage)
|
q.dequeue() should be(exampleMessage)
|
||||||
ensureMailboxSize(q, i)
|
ensureMailboxSize(q, i)
|
||||||
}
|
}
|
||||||
|
|
||||||
q.dequeue should equal(null)
|
q.dequeue should be(null)
|
||||||
ensureMailboxSize(q, 0)
|
ensureMailboxSize(q, 0)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -117,13 +117,13 @@ abstract class MailboxSpec extends AkkaSpec with BeforeAndAfterAll with BeforeAn
|
||||||
q match {
|
q match {
|
||||||
case aQueue: BlockingQueue[_] ⇒
|
case aQueue: BlockingQueue[_] ⇒
|
||||||
config match {
|
config match {
|
||||||
case BoundedMailbox(capacity, _) ⇒ aQueue.remainingCapacity should equal(capacity)
|
case BoundedMailbox(capacity, _) ⇒ aQueue.remainingCapacity should be(capacity)
|
||||||
case UnboundedMailbox() ⇒ aQueue.remainingCapacity should equal(Int.MaxValue)
|
case UnboundedMailbox() ⇒ aQueue.remainingCapacity should be(Int.MaxValue)
|
||||||
}
|
}
|
||||||
case _ ⇒
|
case _ ⇒
|
||||||
}
|
}
|
||||||
q.numberOfMessages should equal(0)
|
q.numberOfMessages should be(0)
|
||||||
q.hasMessages should equal(false)
|
q.hasMessages should be(false)
|
||||||
}
|
}
|
||||||
|
|
||||||
def testEnqueueDequeue(config: MailboxType,
|
def testEnqueueDequeue(config: MailboxType,
|
||||||
|
|
@ -166,14 +166,14 @@ abstract class MailboxSpec extends AkkaSpec with BeforeAndAfterAll with BeforeAn
|
||||||
val ps = producers.map(Await.result(_, remaining))
|
val ps = producers.map(Await.result(_, remaining))
|
||||||
val cs = consumers.map(Await.result(_, remaining))
|
val cs = consumers.map(Await.result(_, remaining))
|
||||||
|
|
||||||
ps.map(_.size).sum should equal(enqueueN) //Must have produced 1000 messages
|
ps.map(_.size).sum should be(enqueueN) //Must have produced 1000 messages
|
||||||
cs.map(_.size).sum should equal(dequeueN) //Must have consumed all produced messages
|
cs.map(_.size).sum should be(dequeueN) //Must have consumed all produced messages
|
||||||
//No message is allowed to be consumed by more than one consumer
|
//No message is allowed to be consumed by more than one consumer
|
||||||
cs.flatten.distinct.size should equal(dequeueN)
|
cs.flatten.distinct.size should be(dequeueN)
|
||||||
//All consumed messages should have been produced
|
//All consumed messages should have been produced
|
||||||
(cs.flatten diff ps.flatten).size should equal(0)
|
(cs.flatten diff ps.flatten).size should be(0)
|
||||||
//The ones that were produced and not consumed
|
//The ones that were produced and not consumed
|
||||||
(ps.flatten diff cs.flatten).size should equal(enqueueN - dequeueN)
|
(ps.flatten diff cs.flatten).size should be(enqueueN - dequeueN)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -74,7 +74,7 @@ class PriorityDispatcherSpec extends AkkaSpec(PriorityDispatcherSpec.config) wit
|
||||||
|
|
||||||
}))
|
}))
|
||||||
|
|
||||||
expectMsgType[List[_]] should equal(msgs)
|
expectMsgType[List[_]] should be(msgs)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ class SystemMessageListSpec extends AkkaSpec {
|
||||||
"The SystemMessageList value class" must {
|
"The SystemMessageList value class" must {
|
||||||
|
|
||||||
"handle empty lists correctly" in {
|
"handle empty lists correctly" in {
|
||||||
LNil.head should equal(null)
|
LNil.head should be(null)
|
||||||
LNil.isEmpty should be(true)
|
LNil.isEmpty should be(true)
|
||||||
(LNil.reverse == ENil) should be(true)
|
(LNil.reverse == ENil) should be(true)
|
||||||
}
|
}
|
||||||
|
|
@ -48,16 +48,16 @@ class SystemMessageListSpec extends AkkaSpec {
|
||||||
val create2 = Failed(null, null, 2)
|
val create2 = Failed(null, null, 2)
|
||||||
val list = create2 :: create1 :: create0 :: LNil
|
val list = create2 :: create1 :: create0 :: LNil
|
||||||
|
|
||||||
list.size should equal(3)
|
list.size should be(3)
|
||||||
list.isEmpty should be(false)
|
list.isEmpty should be(false)
|
||||||
|
|
||||||
list.tail.size should equal(2)
|
list.tail.size should be(2)
|
||||||
list.tail.isEmpty should be(false)
|
list.tail.isEmpty should be(false)
|
||||||
|
|
||||||
list.tail.tail.size should equal(1)
|
list.tail.tail.size should be(1)
|
||||||
list.tail.tail.isEmpty should be(false)
|
list.tail.tail.isEmpty should be(false)
|
||||||
|
|
||||||
list.tail.tail.tail.size should equal(0)
|
list.tail.tail.tail.size should be(0)
|
||||||
list.tail.tail.tail.isEmpty should be(true)
|
list.tail.tail.tail.isEmpty should be(true)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -70,7 +70,7 @@ class SystemMessageListSpec extends AkkaSpec {
|
||||||
val listRev: EarliestFirstSystemMessageList = list.reverse
|
val listRev: EarliestFirstSystemMessageList = list.reverse
|
||||||
|
|
||||||
listRev.isEmpty should be(false)
|
listRev.isEmpty should be(false)
|
||||||
listRev.size should equal(3)
|
listRev.size should be(3)
|
||||||
|
|
||||||
(listRev.head eq create0) should be(true)
|
(listRev.head eq create0) should be(true)
|
||||||
(listRev.tail.head eq create1) should be(true)
|
(listRev.tail.head eq create1) should be(true)
|
||||||
|
|
|
||||||
|
|
@ -50,37 +50,37 @@ abstract class EventBusSpec(busName: String) extends AkkaSpec with BeforeAndAfte
|
||||||
val subscriber = createNewSubscriber()
|
val subscriber = createNewSubscriber()
|
||||||
|
|
||||||
"allow subscribers" in {
|
"allow subscribers" in {
|
||||||
bus.subscribe(subscriber, classifier) should equal(true)
|
bus.subscribe(subscriber, classifier) should be(true)
|
||||||
}
|
}
|
||||||
|
|
||||||
"allow to unsubscribe already existing subscriber" in {
|
"allow to unsubscribe already existing subscriber" in {
|
||||||
bus.unsubscribe(subscriber, classifier) should equal(true)
|
bus.unsubscribe(subscriber, classifier) should be(true)
|
||||||
}
|
}
|
||||||
|
|
||||||
"not allow to unsubscribe non-existing subscriber" in {
|
"not allow to unsubscribe non-existing subscriber" in {
|
||||||
val sub = createNewSubscriber()
|
val sub = createNewSubscriber()
|
||||||
bus.unsubscribe(sub, classifier) should equal(false)
|
bus.unsubscribe(sub, classifier) should be(false)
|
||||||
disposeSubscriber(system, sub)
|
disposeSubscriber(system, sub)
|
||||||
}
|
}
|
||||||
|
|
||||||
"not allow for the same subscriber to subscribe to the same channel twice" in {
|
"not allow for the same subscriber to subscribe to the same channel twice" in {
|
||||||
bus.subscribe(subscriber, classifier) should equal(true)
|
bus.subscribe(subscriber, classifier) should be(true)
|
||||||
bus.subscribe(subscriber, classifier) should equal(false)
|
bus.subscribe(subscriber, classifier) should be(false)
|
||||||
bus.unsubscribe(subscriber, classifier) should equal(true)
|
bus.unsubscribe(subscriber, classifier) should be(true)
|
||||||
}
|
}
|
||||||
|
|
||||||
"not allow for the same subscriber to unsubscribe to the same channel twice" in {
|
"not allow for the same subscriber to unsubscribe to the same channel twice" in {
|
||||||
bus.subscribe(subscriber, classifier) should equal(true)
|
bus.subscribe(subscriber, classifier) should be(true)
|
||||||
bus.unsubscribe(subscriber, classifier) should equal(true)
|
bus.unsubscribe(subscriber, classifier) should be(true)
|
||||||
bus.unsubscribe(subscriber, classifier) should equal(false)
|
bus.unsubscribe(subscriber, classifier) should be(false)
|
||||||
}
|
}
|
||||||
|
|
||||||
"allow to add multiple subscribers" in {
|
"allow to add multiple subscribers" in {
|
||||||
val subscribers = (1 to 10) map { _ ⇒ createNewSubscriber() }
|
val subscribers = (1 to 10) map { _ ⇒ createNewSubscriber() }
|
||||||
val events = createEvents(10)
|
val events = createEvents(10)
|
||||||
val classifiers = events map getClassifierFor
|
val classifiers = events map getClassifierFor
|
||||||
subscribers.zip(classifiers) forall { case (s, c) ⇒ bus.subscribe(s, c) } should equal(true)
|
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 equal(true)
|
subscribers.zip(classifiers) forall { case (s, c) ⇒ bus.unsubscribe(s, c) } should be(true)
|
||||||
|
|
||||||
subscribers foreach (disposeSubscriber(system, _))
|
subscribers foreach (disposeSubscriber(system, _))
|
||||||
}
|
}
|
||||||
|
|
@ -112,10 +112,10 @@ abstract class EventBusSpec(busName: String) extends AkkaSpec with BeforeAndAfte
|
||||||
"publish the given event to all intended subscribers" in {
|
"publish the given event to all intended subscribers" in {
|
||||||
val range = 0 until 10
|
val range = 0 until 10
|
||||||
val subscribers = range map (_ ⇒ createNewSubscriber())
|
val subscribers = range map (_ ⇒ createNewSubscriber())
|
||||||
subscribers foreach { s ⇒ bus.subscribe(s, classifier) should equal(true) }
|
subscribers foreach { s ⇒ bus.subscribe(s, classifier) should be(true) }
|
||||||
bus.publish(event)
|
bus.publish(event)
|
||||||
range foreach { _ ⇒ expectMsg(event) }
|
range foreach { _ ⇒ expectMsg(event) }
|
||||||
subscribers foreach { s ⇒ bus.unsubscribe(s, classifier) should equal(true); disposeSubscriber(system, s) }
|
subscribers foreach { s ⇒ bus.unsubscribe(s, classifier) should be(true); disposeSubscriber(system, s) }
|
||||||
}
|
}
|
||||||
|
|
||||||
"not publish the given event to any other subscribers than the intended ones" in {
|
"not publish the given event to any other subscribers than the intended ones" in {
|
||||||
|
|
|
||||||
|
|
@ -134,16 +134,16 @@ class EventStreamSpec extends AkkaSpec(EventStreamSpec.config) {
|
||||||
val c = new C
|
val c = new C
|
||||||
val bus = new EventStream(false)
|
val bus = new EventStream(false)
|
||||||
within(2 seconds) {
|
within(2 seconds) {
|
||||||
bus.subscribe(testActor, classOf[B2]) should equal(true)
|
bus.subscribe(testActor, classOf[B2]) should be(true)
|
||||||
bus.publish(c)
|
bus.publish(c)
|
||||||
bus.publish(b2)
|
bus.publish(b2)
|
||||||
expectMsg(b2)
|
expectMsg(b2)
|
||||||
bus.subscribe(testActor, classOf[A]) should equal(true)
|
bus.subscribe(testActor, classOf[A]) should be(true)
|
||||||
bus.publish(c)
|
bus.publish(c)
|
||||||
expectMsg(c)
|
expectMsg(c)
|
||||||
bus.publish(b1)
|
bus.publish(b1)
|
||||||
expectMsg(b1)
|
expectMsg(b1)
|
||||||
bus.unsubscribe(testActor, classOf[B1]) should equal(true)
|
bus.unsubscribe(testActor, classOf[B1]) should be(true)
|
||||||
bus.publish(c)
|
bus.publish(c)
|
||||||
bus.publish(b2)
|
bus.publish(b2)
|
||||||
bus.publish(a)
|
bus.publish(a)
|
||||||
|
|
@ -159,21 +159,21 @@ class EventStreamSpec extends AkkaSpec(EventStreamSpec.config) {
|
||||||
val tm2 = new CCATBT
|
val tm2 = new CCATBT
|
||||||
val a1, a2, a3, a4 = TestProbe()
|
val a1, a2, a3, a4 = TestProbe()
|
||||||
|
|
||||||
es.subscribe(a1.ref, classOf[AT]) should equal(true)
|
es.subscribe(a1.ref, classOf[AT]) should be(true)
|
||||||
es.subscribe(a2.ref, classOf[BT]) should equal(true)
|
es.subscribe(a2.ref, classOf[BT]) should be(true)
|
||||||
es.subscribe(a3.ref, classOf[CC]) should equal(true)
|
es.subscribe(a3.ref, classOf[CC]) should be(true)
|
||||||
es.subscribe(a4.ref, classOf[CCATBT]) should equal(true)
|
es.subscribe(a4.ref, classOf[CCATBT]) should be(true)
|
||||||
es.publish(tm1)
|
es.publish(tm1)
|
||||||
es.publish(tm2)
|
es.publish(tm2)
|
||||||
a1.expectMsgType[AT] should equal(tm2)
|
a1.expectMsgType[AT] should be(tm2)
|
||||||
a2.expectMsgType[BT] should equal(tm2)
|
a2.expectMsgType[BT] should be(tm2)
|
||||||
a3.expectMsgType[CC] should equal(tm1)
|
a3.expectMsgType[CC] should be(tm1)
|
||||||
a3.expectMsgType[CC] should equal(tm2)
|
a3.expectMsgType[CC] should be(tm2)
|
||||||
a4.expectMsgType[CCATBT] should equal(tm2)
|
a4.expectMsgType[CCATBT] should be(tm2)
|
||||||
es.unsubscribe(a1.ref, classOf[AT]) should equal(true)
|
es.unsubscribe(a1.ref, classOf[AT]) should be(true)
|
||||||
es.unsubscribe(a2.ref, classOf[BT]) should equal(true)
|
es.unsubscribe(a2.ref, classOf[BT]) should be(true)
|
||||||
es.unsubscribe(a3.ref, classOf[CC]) should equal(true)
|
es.unsubscribe(a3.ref, classOf[CC]) should be(true)
|
||||||
es.unsubscribe(a4.ref, classOf[CCATBT]) should equal(true)
|
es.unsubscribe(a4.ref, classOf[CCATBT]) should be(true)
|
||||||
}
|
}
|
||||||
|
|
||||||
"manage sub-channels using classes and traits (update on unsubscribe)" in {
|
"manage sub-channels using classes and traits (update on unsubscribe)" in {
|
||||||
|
|
@ -182,20 +182,20 @@ class EventStreamSpec extends AkkaSpec(EventStreamSpec.config) {
|
||||||
val tm2 = new CCATBT
|
val tm2 = new CCATBT
|
||||||
val a1, a2, a3, a4 = TestProbe()
|
val a1, a2, a3, a4 = TestProbe()
|
||||||
|
|
||||||
es.subscribe(a1.ref, classOf[AT]) should equal(true)
|
es.subscribe(a1.ref, classOf[AT]) should be(true)
|
||||||
es.subscribe(a2.ref, classOf[BT]) should equal(true)
|
es.subscribe(a2.ref, classOf[BT]) should be(true)
|
||||||
es.subscribe(a3.ref, classOf[CC]) should equal(true)
|
es.subscribe(a3.ref, classOf[CC]) should be(true)
|
||||||
es.subscribe(a4.ref, classOf[CCATBT]) should equal(true)
|
es.subscribe(a4.ref, classOf[CCATBT]) should be(true)
|
||||||
es.unsubscribe(a3.ref, classOf[CC]) should equal(true)
|
es.unsubscribe(a3.ref, classOf[CC]) should be(true)
|
||||||
es.publish(tm1)
|
es.publish(tm1)
|
||||||
es.publish(tm2)
|
es.publish(tm2)
|
||||||
a1.expectMsgType[AT] should equal(tm2)
|
a1.expectMsgType[AT] should be(tm2)
|
||||||
a2.expectMsgType[BT] should equal(tm2)
|
a2.expectMsgType[BT] should be(tm2)
|
||||||
a3.expectNoMsg(1 second)
|
a3.expectNoMsg(1 second)
|
||||||
a4.expectMsgType[CCATBT] should equal(tm2)
|
a4.expectMsgType[CCATBT] should be(tm2)
|
||||||
es.unsubscribe(a1.ref, classOf[AT]) should equal(true)
|
es.unsubscribe(a1.ref, classOf[AT]) should be(true)
|
||||||
es.unsubscribe(a2.ref, classOf[BT]) should equal(true)
|
es.unsubscribe(a2.ref, classOf[BT]) should be(true)
|
||||||
es.unsubscribe(a4.ref, classOf[CCATBT]) should equal(true)
|
es.unsubscribe(a4.ref, classOf[CCATBT]) should be(true)
|
||||||
}
|
}
|
||||||
|
|
||||||
"manage sub-channels using classes and traits (update on unsubscribe all)" in {
|
"manage sub-channels using classes and traits (update on unsubscribe all)" in {
|
||||||
|
|
@ -204,20 +204,20 @@ class EventStreamSpec extends AkkaSpec(EventStreamSpec.config) {
|
||||||
val tm2 = new CCATBT
|
val tm2 = new CCATBT
|
||||||
val a1, a2, a3, a4 = TestProbe()
|
val a1, a2, a3, a4 = TestProbe()
|
||||||
|
|
||||||
es.subscribe(a1.ref, classOf[AT]) should equal(true)
|
es.subscribe(a1.ref, classOf[AT]) should be(true)
|
||||||
es.subscribe(a2.ref, classOf[BT]) should equal(true)
|
es.subscribe(a2.ref, classOf[BT]) should be(true)
|
||||||
es.subscribe(a3.ref, classOf[CC]) should equal(true)
|
es.subscribe(a3.ref, classOf[CC]) should be(true)
|
||||||
es.subscribe(a4.ref, classOf[CCATBT]) should equal(true)
|
es.subscribe(a4.ref, classOf[CCATBT]) should be(true)
|
||||||
es.unsubscribe(a3.ref)
|
es.unsubscribe(a3.ref)
|
||||||
es.publish(tm1)
|
es.publish(tm1)
|
||||||
es.publish(tm2)
|
es.publish(tm2)
|
||||||
a1.expectMsgType[AT] should equal(tm2)
|
a1.expectMsgType[AT] should be(tm2)
|
||||||
a2.expectMsgType[BT] should equal(tm2)
|
a2.expectMsgType[BT] should be(tm2)
|
||||||
a3.expectNoMsg(1 second)
|
a3.expectNoMsg(1 second)
|
||||||
a4.expectMsgType[CCATBT] should equal(tm2)
|
a4.expectMsgType[CCATBT] should be(tm2)
|
||||||
es.unsubscribe(a1.ref, classOf[AT]) should equal(true)
|
es.unsubscribe(a1.ref, classOf[AT]) should be(true)
|
||||||
es.unsubscribe(a2.ref, classOf[BT]) should equal(true)
|
es.unsubscribe(a2.ref, classOf[BT]) should be(true)
|
||||||
es.unsubscribe(a4.ref, classOf[CCATBT]) should equal(true)
|
es.unsubscribe(a4.ref, classOf[CCATBT]) should be(true)
|
||||||
}
|
}
|
||||||
|
|
||||||
"manage sub-channels using classes and traits (update on publish)" in {
|
"manage sub-channels using classes and traits (update on publish)" in {
|
||||||
|
|
@ -226,14 +226,14 @@ class EventStreamSpec extends AkkaSpec(EventStreamSpec.config) {
|
||||||
val tm2 = new CCATBT
|
val tm2 = new CCATBT
|
||||||
val a1, a2 = TestProbe()
|
val a1, a2 = TestProbe()
|
||||||
|
|
||||||
es.subscribe(a1.ref, classOf[AT]) should equal(true)
|
es.subscribe(a1.ref, classOf[AT]) should be(true)
|
||||||
es.subscribe(a2.ref, classOf[BT]) should equal(true)
|
es.subscribe(a2.ref, classOf[BT]) should be(true)
|
||||||
es.publish(tm1)
|
es.publish(tm1)
|
||||||
es.publish(tm2)
|
es.publish(tm2)
|
||||||
a1.expectMsgType[AT] should equal(tm2)
|
a1.expectMsgType[AT] should be(tm2)
|
||||||
a2.expectMsgType[BT] should equal(tm2)
|
a2.expectMsgType[BT] should be(tm2)
|
||||||
es.unsubscribe(a1.ref, classOf[AT]) should equal(true)
|
es.unsubscribe(a1.ref, classOf[AT]) should be(true)
|
||||||
es.unsubscribe(a2.ref, classOf[BT]) should equal(true)
|
es.unsubscribe(a2.ref, classOf[BT]) should be(true)
|
||||||
}
|
}
|
||||||
|
|
||||||
"manage sub-channels using classes and traits (unsubscribe classes used with trait)" in {
|
"manage sub-channels using classes and traits (unsubscribe classes used with trait)" in {
|
||||||
|
|
@ -242,20 +242,20 @@ class EventStreamSpec extends AkkaSpec(EventStreamSpec.config) {
|
||||||
val tm2 = new CCATBT
|
val tm2 = new CCATBT
|
||||||
val a1, a2, a3 = TestProbe()
|
val a1, a2, a3 = TestProbe()
|
||||||
|
|
||||||
es.subscribe(a1.ref, classOf[AT]) should equal(true)
|
es.subscribe(a1.ref, classOf[AT]) should be(true)
|
||||||
es.subscribe(a2.ref, classOf[BT]) should equal(true)
|
es.subscribe(a2.ref, classOf[BT]) should be(true)
|
||||||
es.subscribe(a2.ref, classOf[CC]) should equal(true)
|
es.subscribe(a2.ref, classOf[CC]) should be(true)
|
||||||
es.subscribe(a3.ref, classOf[CC]) should equal(true)
|
es.subscribe(a3.ref, classOf[CC]) should be(true)
|
||||||
es.unsubscribe(a2.ref, classOf[CC]) should equal(true)
|
es.unsubscribe(a2.ref, classOf[CC]) should be(true)
|
||||||
es.unsubscribe(a3.ref, classOf[CCATBT]) should equal(true)
|
es.unsubscribe(a3.ref, classOf[CCATBT]) should be(true)
|
||||||
es.publish(tm1)
|
es.publish(tm1)
|
||||||
es.publish(tm2)
|
es.publish(tm2)
|
||||||
a1.expectMsgType[AT] should equal(tm2)
|
a1.expectMsgType[AT] should be(tm2)
|
||||||
a2.expectMsgType[BT] should equal(tm2)
|
a2.expectMsgType[BT] should be(tm2)
|
||||||
a3.expectMsgType[CC] should equal(tm1)
|
a3.expectMsgType[CC] should be(tm1)
|
||||||
es.unsubscribe(a1.ref, classOf[AT]) should equal(true)
|
es.unsubscribe(a1.ref, classOf[AT]) should be(true)
|
||||||
es.unsubscribe(a2.ref, classOf[BT]) should equal(true)
|
es.unsubscribe(a2.ref, classOf[BT]) should be(true)
|
||||||
es.unsubscribe(a3.ref, classOf[CC]) should equal(true)
|
es.unsubscribe(a3.ref, classOf[CC]) should be(true)
|
||||||
}
|
}
|
||||||
|
|
||||||
"manage sub-channels using classes and traits (subscribe after publish)" in {
|
"manage sub-channels using classes and traits (subscribe after publish)" in {
|
||||||
|
|
@ -263,16 +263,16 @@ class EventStreamSpec extends AkkaSpec(EventStreamSpec.config) {
|
||||||
val tm1 = new CCATBT
|
val tm1 = new CCATBT
|
||||||
val a1, a2 = TestProbe()
|
val a1, a2 = TestProbe()
|
||||||
|
|
||||||
es.subscribe(a1.ref, classOf[AT]) should equal(true)
|
es.subscribe(a1.ref, classOf[AT]) should be(true)
|
||||||
es.publish(tm1)
|
es.publish(tm1)
|
||||||
a1.expectMsgType[AT] should equal(tm1)
|
a1.expectMsgType[AT] should be(tm1)
|
||||||
a2.expectNoMsg(1 second)
|
a2.expectNoMsg(1 second)
|
||||||
es.subscribe(a2.ref, classOf[BTT]) should equal(true)
|
es.subscribe(a2.ref, classOf[BTT]) should be(true)
|
||||||
es.publish(tm1)
|
es.publish(tm1)
|
||||||
a1.expectMsgType[AT] should equal(tm1)
|
a1.expectMsgType[AT] should be(tm1)
|
||||||
a2.expectMsgType[BTT] should equal(tm1)
|
a2.expectMsgType[BTT] should be(tm1)
|
||||||
es.unsubscribe(a1.ref, classOf[AT]) should equal(true)
|
es.unsubscribe(a1.ref, classOf[AT]) should be(true)
|
||||||
es.unsubscribe(a2.ref, classOf[BTT]) should equal(true)
|
es.unsubscribe(a2.ref, classOf[BTT]) should be(true)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -160,7 +160,7 @@ class TcpListenerSpec extends AkkaSpec("""
|
||||||
selectorRouter.expectMsgPF() {
|
selectorRouter.expectMsgPF() {
|
||||||
case WorkerForCommand(RegisterIncoming(chan), commander, _) ⇒
|
case WorkerForCommand(RegisterIncoming(chan), commander, _) ⇒
|
||||||
chan.isOpen should be(true)
|
chan.isOpen should be(true)
|
||||||
commander should equal(listener)
|
commander should be(listener)
|
||||||
chan
|
chan
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -41,13 +41,13 @@ class UdpConnectedIntegrationSpec extends AkkaSpec("""
|
||||||
|
|
||||||
val clientAddress = expectMsgPF() {
|
val clientAddress = expectMsgPF() {
|
||||||
case Udp.Received(d, a) ⇒
|
case Udp.Received(d, a) ⇒
|
||||||
d should equal(data1)
|
d should be(data1)
|
||||||
a
|
a
|
||||||
}
|
}
|
||||||
|
|
||||||
server ! Udp.Send(data2, clientAddress)
|
server ! Udp.Send(data2, clientAddress)
|
||||||
|
|
||||||
expectMsgType[UdpConnected.Received].data should equal(data2)
|
expectMsgType[UdpConnected.Received].data should be(data2)
|
||||||
}
|
}
|
||||||
|
|
||||||
"be able to send and receive with binding" in {
|
"be able to send and receive with binding" in {
|
||||||
|
|
@ -60,13 +60,13 @@ class UdpConnectedIntegrationSpec extends AkkaSpec("""
|
||||||
|
|
||||||
expectMsgPF() {
|
expectMsgPF() {
|
||||||
case Udp.Received(d, a) ⇒
|
case Udp.Received(d, a) ⇒
|
||||||
d should equal(data1)
|
d should be(data1)
|
||||||
a should equal(clientAddress)
|
a should be(clientAddress)
|
||||||
}
|
}
|
||||||
|
|
||||||
server ! Udp.Send(data2, clientAddress)
|
server ! Udp.Send(data2, clientAddress)
|
||||||
|
|
||||||
expectMsgType[UdpConnected.Received].data should equal(data2)
|
expectMsgType[UdpConnected.Received].data should be(data2)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,7 @@ class UdpIntegrationSpec extends AkkaSpec("""
|
||||||
val data = ByteString("To infinity and beyond!")
|
val data = ByteString("To infinity and beyond!")
|
||||||
simpleSender ! Send(data, serverAddress)
|
simpleSender ! Send(data, serverAddress)
|
||||||
|
|
||||||
expectMsgType[Received].data should equal(data)
|
expectMsgType[Received].data should be(data)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -53,16 +53,16 @@ class UdpIntegrationSpec extends AkkaSpec("""
|
||||||
server ! Send(data, clientAddress)
|
server ! Send(data, clientAddress)
|
||||||
expectMsgPF() {
|
expectMsgPF() {
|
||||||
case Received(d, a) ⇒
|
case Received(d, a) ⇒
|
||||||
d should equal(data)
|
d should be(data)
|
||||||
a should equal(serverAddress)
|
a should be(serverAddress)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
def checkSendingToServer(): Unit = {
|
def checkSendingToServer(): Unit = {
|
||||||
client ! Send(data, serverAddress)
|
client ! Send(data, serverAddress)
|
||||||
expectMsgPF() {
|
expectMsgPF() {
|
||||||
case Received(d, a) ⇒
|
case Received(d, a) ⇒
|
||||||
d should equal(data)
|
d should be(data)
|
||||||
a should equal(clientAddress)
|
a should be(clientAddress)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -65,7 +65,7 @@ class ConfiguredLocalRoutingSpec extends AkkaSpec(ConfiguredLocalRoutingSpec.con
|
||||||
case "get" ⇒ sender() ! context.props
|
case "get" ⇒ sender() ! context.props
|
||||||
}
|
}
|
||||||
}).withRouter(RoundRobinRouter(12)), "someOther")
|
}).withRouter(RoundRobinRouter(12)), "someOther")
|
||||||
routerConfig(actor) should equal(RoundRobinRouter(12))
|
routerConfig(actor) should be(RoundRobinRouter(12))
|
||||||
Await.result(gracefulStop(actor, 3 seconds), 3 seconds)
|
Await.result(gracefulStop(actor, 3 seconds), 3 seconds)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -75,7 +75,7 @@ class ConfiguredLocalRoutingSpec extends AkkaSpec(ConfiguredLocalRoutingSpec.con
|
||||||
case "get" ⇒ sender() ! context.props
|
case "get" ⇒ sender() ! context.props
|
||||||
}
|
}
|
||||||
}).withRouter(RoundRobinRouter(12)), "config")
|
}).withRouter(RoundRobinRouter(12)), "config")
|
||||||
routerConfig(actor) should equal(RandomPool(4))
|
routerConfig(actor) should be(RandomPool(4))
|
||||||
Await.result(gracefulStop(actor, 3 seconds), 3 seconds)
|
Await.result(gracefulStop(actor, 3 seconds), 3 seconds)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -85,7 +85,7 @@ class ConfiguredLocalRoutingSpec extends AkkaSpec(ConfiguredLocalRoutingSpec.con
|
||||||
case "get" ⇒ sender() ! context.props
|
case "get" ⇒ sender() ! context.props
|
||||||
}
|
}
|
||||||
}).withRouter(FromConfig).withDeploy(Deploy(routerConfig = RoundRobinRouter(12))), "someOther")
|
}).withRouter(FromConfig).withDeploy(Deploy(routerConfig = RoundRobinRouter(12))), "someOther")
|
||||||
routerConfig(actor) should equal(RoundRobinRouter(12))
|
routerConfig(actor) should be(RoundRobinRouter(12))
|
||||||
Await.result(gracefulStop(actor, 3 seconds), 3 seconds)
|
Await.result(gracefulStop(actor, 3 seconds), 3 seconds)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -95,7 +95,7 @@ class ConfiguredLocalRoutingSpec extends AkkaSpec(ConfiguredLocalRoutingSpec.con
|
||||||
case "get" ⇒ sender() ! context.props
|
case "get" ⇒ sender() ! context.props
|
||||||
}
|
}
|
||||||
}).withRouter(FromConfig).withDeploy(Deploy(routerConfig = RoundRobinRouter(12))), "config")
|
}).withRouter(FromConfig).withDeploy(Deploy(routerConfig = RoundRobinRouter(12))), "config")
|
||||||
routerConfig(actor) should equal(RandomPool(4))
|
routerConfig(actor) should be(RandomPool(4))
|
||||||
Await.result(gracefulStop(actor, 3 seconds), 3 seconds)
|
Await.result(gracefulStop(actor, 3 seconds), 3 seconds)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -262,7 +262,7 @@ class ConfiguredLocalRoutingSpec extends AkkaSpec(ConfiguredLocalRoutingSpec.con
|
||||||
Await.ready(doneLatch, 5 seconds)
|
Await.ready(doneLatch, 5 seconds)
|
||||||
|
|
||||||
replies.values foreach { _ should be > (0) }
|
replies.values foreach { _ should be > (0) }
|
||||||
replies.values.sum should equal(iterationCount * connectionCount)
|
replies.values.sum should be(iterationCount * connectionCount)
|
||||||
}
|
}
|
||||||
|
|
||||||
"deliver a broadcast message using the !" in {
|
"deliver a broadcast message using the !" in {
|
||||||
|
|
|
||||||
|
|
@ -70,7 +70,7 @@ class RoutingSpec extends AkkaSpec(RoutingSpec.config) with DefaultTimeout with
|
||||||
watch(router)
|
watch(router)
|
||||||
watch(c2)
|
watch(c2)
|
||||||
system.stop(c2)
|
system.stop(c2)
|
||||||
expectTerminated(c2).existenceConfirmed should equal(true)
|
expectTerminated(c2).existenceConfirmed should be(true)
|
||||||
// it might take a while until the Router has actually processed the Terminated message
|
// it might take a while until the Router has actually processed the Terminated message
|
||||||
awaitCond {
|
awaitCond {
|
||||||
router ! ""
|
router ! ""
|
||||||
|
|
@ -81,7 +81,7 @@ class RoutingSpec extends AkkaSpec(RoutingSpec.config) with DefaultTimeout with
|
||||||
res == Seq(c1, c1)
|
res == Seq(c1, c1)
|
||||||
}
|
}
|
||||||
system.stop(c1)
|
system.stop(c1)
|
||||||
expectTerminated(router).existenceConfirmed should equal(true)
|
expectTerminated(router).existenceConfirmed should be(true)
|
||||||
}
|
}
|
||||||
|
|
||||||
"not terminate when resizer is used" in {
|
"not terminate when resizer is used" in {
|
||||||
|
|
@ -125,7 +125,7 @@ class RoutingSpec extends AkkaSpec(RoutingSpec.config) with DefaultTimeout with
|
||||||
|
|
||||||
1 to actors foreach { _ ⇒
|
1 to actors foreach { _ ⇒
|
||||||
val routees = expectMsgType[RouterRoutees].routees
|
val routees = expectMsgType[RouterRoutees].routees
|
||||||
routees.map(_.path.name).toSet should equal(names)
|
routees.map(_.path.name).toSet should be(names)
|
||||||
}
|
}
|
||||||
expectNoMsg(500.millis)
|
expectNoMsg(500.millis)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -44,7 +44,7 @@ class AskSpec extends AkkaSpec {
|
||||||
f.isCompleted should be(true)
|
f.isCompleted should be(true)
|
||||||
intercept[IllegalArgumentException] {
|
intercept[IllegalArgumentException] {
|
||||||
Await.result(f, remaining)
|
Await.result(f, remaining)
|
||||||
}.getMessage should equal("Unsupported recipient ActorRef type, question not sent to [null]")
|
}.getMessage should be("Unsupported recipient ActorRef type, question not sent to [null]")
|
||||||
}
|
}
|
||||||
|
|
||||||
"return broken promises on 0 timeout" in {
|
"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]" format echo
|
val expectedMsg = "Timeout length must not be negative, question not sent to [%s]" format echo
|
||||||
intercept[IllegalArgumentException] {
|
intercept[IllegalArgumentException] {
|
||||||
Await.result(f, remaining)
|
Await.result(f, remaining)
|
||||||
}.getMessage should equal(expectedMsg)
|
}.getMessage should be(expectedMsg)
|
||||||
}
|
}
|
||||||
|
|
||||||
"return broken promises on < 0 timeout" in {
|
"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]" format echo
|
val expectedMsg = "Timeout length must not be negative, question not sent to [%s]" format echo
|
||||||
intercept[IllegalArgumentException] {
|
intercept[IllegalArgumentException] {
|
||||||
Await.result(f, remaining)
|
Await.result(f, remaining)
|
||||||
}.getMessage should equal(expectedMsg)
|
}.getMessage should be(expectedMsg)
|
||||||
}
|
}
|
||||||
|
|
||||||
"include target information in AskTimeout" in {
|
"include target information in AskTimeout" in {
|
||||||
|
|
@ -91,7 +91,7 @@ class AskSpec extends AkkaSpec {
|
||||||
val identityFuture = (system.actorSelection("/user/select-echo") ? Identify(None))
|
val identityFuture = (system.actorSelection("/user/select-echo") ? Identify(None))
|
||||||
.mapTo[ActorIdentity].map(_.ref.get)
|
.mapTo[ActorIdentity].map(_.ref.get)
|
||||||
|
|
||||||
Await.result(identityFuture, 5 seconds) should equal(echo)
|
Await.result(identityFuture, 5 seconds) should be(echo)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -49,7 +49,7 @@ class CircuitBreakerMTSpec extends AkkaSpec {
|
||||||
val futures = testCallsWithBreaker()
|
val futures = testCallsWithBreaker()
|
||||||
val result = Await.result(Future.sequence(futures), 5.second.dilated)
|
val result = Await.result(Future.sequence(futures), 5.second.dilated)
|
||||||
result.size should be(numberOfTestCalls)
|
result.size should be(numberOfTestCalls)
|
||||||
result.toSet should equal(Set("succeed"))
|
result.toSet should be(Set("succeed"))
|
||||||
}
|
}
|
||||||
|
|
||||||
"transition to open state upon reaching failure limit and fail-fast" in {
|
"transition to open state upon reaching failure limit and fail-fast" in {
|
||||||
|
|
@ -57,7 +57,7 @@ class CircuitBreakerMTSpec extends AkkaSpec {
|
||||||
val futures = testCallsWithBreaker()
|
val futures = testCallsWithBreaker()
|
||||||
val result = Await.result(Future.sequence(futures), 5.second.dilated)
|
val result = Await.result(Future.sequence(futures), 5.second.dilated)
|
||||||
result.size should be(numberOfTestCalls)
|
result.size should be(numberOfTestCalls)
|
||||||
result.toSet should equal(Set("CBO"))
|
result.toSet should be(Set("CBO"))
|
||||||
}
|
}
|
||||||
|
|
||||||
"allow a single call through in half-open state" in {
|
"allow a single call through in half-open state" in {
|
||||||
|
|
@ -72,7 +72,7 @@ class CircuitBreakerMTSpec extends AkkaSpec {
|
||||||
val futures = testCallsWithBreaker()
|
val futures = testCallsWithBreaker()
|
||||||
val result = Await.result(Future.sequence(futures), 5.second.dilated)
|
val result = Await.result(Future.sequence(futures), 5.second.dilated)
|
||||||
result.size should be(numberOfTestCalls)
|
result.size should be(numberOfTestCalls)
|
||||||
result.toSet should equal(Set("succeed", "CBO"))
|
result.toSet should be(Set("succeed", "CBO"))
|
||||||
}
|
}
|
||||||
|
|
||||||
"recover and reset the breaker after the reset timeout" in {
|
"recover and reset the breaker after the reset timeout" in {
|
||||||
|
|
@ -92,7 +92,7 @@ class CircuitBreakerMTSpec extends AkkaSpec {
|
||||||
val futures = testCallsWithBreaker()
|
val futures = testCallsWithBreaker()
|
||||||
val result = Await.result(Future.sequence(futures), 5.second.dilated)
|
val result = Await.result(Future.sequence(futures), 5.second.dilated)
|
||||||
result.size should be(numberOfTestCalls)
|
result.size should be(numberOfTestCalls)
|
||||||
result.toSet should equal(Set("succeed"))
|
result.toSet should be(Set("succeed"))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -64,8 +64,8 @@ class CircuitBreakerSpec extends AkkaSpec with BeforeAndAfter {
|
||||||
checkLatch(breaker.openLatch)
|
checkLatch(breaker.openLatch)
|
||||||
|
|
||||||
val e = intercept[CircuitBreakerOpenException] { breaker().withSyncCircuitBreaker(sayHi) }
|
val e = intercept[CircuitBreakerOpenException] { breaker().withSyncCircuitBreaker(sayHi) }
|
||||||
e.remainingDuration should be > (Duration.Zero)
|
(e.remainingDuration > Duration.Zero) should be(true)
|
||||||
e.remainingDuration should be <= (CircuitBreakerSpec.longResetTimeout)
|
(e.remainingDuration <= CircuitBreakerSpec.longResetTimeout) should be(true)
|
||||||
}
|
}
|
||||||
|
|
||||||
"transition to half-open on reset timeout" in {
|
"transition to half-open on reset timeout" in {
|
||||||
|
|
@ -114,9 +114,9 @@ class CircuitBreakerSpec extends AkkaSpec with BeforeAndAfter {
|
||||||
val ct = Thread.currentThread() // Ensure that the thunk is executed in the tests thread
|
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().withSyncCircuitBreaker({ if (Thread.currentThread() eq ct) throwException else "fail" })
|
||||||
}
|
}
|
||||||
breaker().currentFailureCount should equal(1)
|
breaker().currentFailureCount should be(1)
|
||||||
breaker().withSyncCircuitBreaker(sayHi)
|
breaker().withSyncCircuitBreaker(sayHi)
|
||||||
breaker().currentFailureCount should equal(0)
|
breaker().currentFailureCount should be(0)
|
||||||
}
|
}
|
||||||
|
|
||||||
"increment failure count on callTimeout" in {
|
"increment failure count on callTimeout" in {
|
||||||
|
|
|
||||||
|
|
@ -98,33 +98,33 @@ class ConfiguredLocalRoutingSpec extends AkkaSpec(ConfiguredLocalRoutingSpec.con
|
||||||
|
|
||||||
"be picked up from Props" in {
|
"be picked up from Props" in {
|
||||||
val actor = system.actorOf(RoundRobinPool(12).props(routeeProps = Props[EchoProps]), "someOther")
|
val actor = system.actorOf(RoundRobinPool(12).props(routeeProps = Props[EchoProps]), "someOther")
|
||||||
routerConfig(actor) should equal(RoundRobinPool(12))
|
routerConfig(actor) should be(RoundRobinPool(12))
|
||||||
Await.result(gracefulStop(actor, 3 seconds), 3 seconds)
|
Await.result(gracefulStop(actor, 3 seconds), 3 seconds)
|
||||||
}
|
}
|
||||||
|
|
||||||
"be overridable in config" in {
|
"be overridable in config" in {
|
||||||
val actor = system.actorOf(RoundRobinPool(12).props(routeeProps = Props[EchoProps]), "config")
|
val actor = system.actorOf(RoundRobinPool(12).props(routeeProps = Props[EchoProps]), "config")
|
||||||
routerConfig(actor) should equal(RandomPool(nrOfInstances = 4, usePoolDispatcher = true))
|
routerConfig(actor) should be(RandomPool(nrOfInstances = 4, usePoolDispatcher = true))
|
||||||
Await.result(gracefulStop(actor, 3 seconds), 3 seconds)
|
Await.result(gracefulStop(actor, 3 seconds), 3 seconds)
|
||||||
}
|
}
|
||||||
|
|
||||||
"use routees.paths from config" in {
|
"use routees.paths from config" in {
|
||||||
val actor = system.actorOf(RandomPool(12).props(routeeProps = Props[EchoProps]), "paths")
|
val actor = system.actorOf(RandomPool(12).props(routeeProps = Props[EchoProps]), "paths")
|
||||||
routerConfig(actor) should equal(RandomGroup(List("/user/service1", "/user/service2")))
|
routerConfig(actor) should be(RandomGroup(List("/user/service1", "/user/service2")))
|
||||||
Await.result(gracefulStop(actor, 3 seconds), 3 seconds)
|
Await.result(gracefulStop(actor, 3 seconds), 3 seconds)
|
||||||
}
|
}
|
||||||
|
|
||||||
"be overridable in explicit deployment" in {
|
"be overridable in explicit deployment" in {
|
||||||
val actor = system.actorOf(FromConfig.props(routeeProps = Props[EchoProps]).
|
val actor = system.actorOf(FromConfig.props(routeeProps = Props[EchoProps]).
|
||||||
withDeploy(Deploy(routerConfig = RoundRobinPool(12))), "someOther")
|
withDeploy(Deploy(routerConfig = RoundRobinPool(12))), "someOther")
|
||||||
routerConfig(actor) should equal(RoundRobinPool(12))
|
routerConfig(actor) should be(RoundRobinPool(12))
|
||||||
Await.result(gracefulStop(actor, 3 seconds), 3 seconds)
|
Await.result(gracefulStop(actor, 3 seconds), 3 seconds)
|
||||||
}
|
}
|
||||||
|
|
||||||
"be overridable in config even with explicit deployment" in {
|
"be overridable in config even with explicit deployment" in {
|
||||||
val actor = system.actorOf(FromConfig.props(routeeProps = Props[EchoProps]).
|
val actor = system.actorOf(FromConfig.props(routeeProps = Props[EchoProps]).
|
||||||
withDeploy(Deploy(routerConfig = RoundRobinPool(12))), "config")
|
withDeploy(Deploy(routerConfig = RoundRobinPool(12))), "config")
|
||||||
routerConfig(actor) should equal(RandomPool(nrOfInstances = 4, usePoolDispatcher = true))
|
routerConfig(actor) should be(RandomPool(nrOfInstances = 4, usePoolDispatcher = true))
|
||||||
Await.result(gracefulStop(actor, 3 seconds), 3 seconds)
|
Await.result(gracefulStop(actor, 3 seconds), 3 seconds)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -76,7 +76,7 @@ class RandomSpec extends AkkaSpec with DefaultTimeout with ImplicitSender {
|
||||||
Await.ready(doneLatch, 5 seconds)
|
Await.ready(doneLatch, 5 seconds)
|
||||||
|
|
||||||
replies.values foreach { _ should be > (0) }
|
replies.values foreach { _ should be > (0) }
|
||||||
replies.values.sum should equal(iterationCount * connectionCount)
|
replies.values.sum should be(iterationCount * connectionCount)
|
||||||
}
|
}
|
||||||
|
|
||||||
"deliver a broadcast message using the !" in {
|
"deliver a broadcast message using the !" in {
|
||||||
|
|
|
||||||
|
|
@ -70,7 +70,7 @@ class RoutingSpec extends AkkaSpec(RoutingSpec.config) with DefaultTimeout with
|
||||||
watch(router)
|
watch(router)
|
||||||
watch(c2)
|
watch(c2)
|
||||||
system.stop(c2)
|
system.stop(c2)
|
||||||
expectTerminated(c2).existenceConfirmed should equal(true)
|
expectTerminated(c2).existenceConfirmed should be(true)
|
||||||
// it might take a while until the Router has actually processed the Terminated message
|
// it might take a while until the Router has actually processed the Terminated message
|
||||||
awaitCond {
|
awaitCond {
|
||||||
router ! ""
|
router ! ""
|
||||||
|
|
@ -81,7 +81,7 @@ class RoutingSpec extends AkkaSpec(RoutingSpec.config) with DefaultTimeout with
|
||||||
res == Seq(c1, c1)
|
res == Seq(c1, c1)
|
||||||
}
|
}
|
||||||
system.stop(c1)
|
system.stop(c1)
|
||||||
expectTerminated(router).existenceConfirmed should equal(true)
|
expectTerminated(router).existenceConfirmed should be(true)
|
||||||
}
|
}
|
||||||
|
|
||||||
"not terminate when resizer is used" in {
|
"not terminate when resizer is used" in {
|
||||||
|
|
|
||||||
|
|
@ -13,12 +13,10 @@ import java.io._
|
||||||
import scala.concurrent.Await
|
import scala.concurrent.Await
|
||||||
import akka.util.Timeout
|
import akka.util.Timeout
|
||||||
import scala.concurrent.duration._
|
import scala.concurrent.duration._
|
||||||
import scala.reflect.BeanInfo
|
import scala.beans.BeanInfo
|
||||||
import com.google.protobuf.Message
|
|
||||||
import com.typesafe.config._
|
import com.typesafe.config._
|
||||||
import akka.pattern.ask
|
import akka.pattern.ask
|
||||||
import org.apache.commons.codec.binary.Hex.{ encodeHex, decodeHex }
|
import org.apache.commons.codec.binary.Hex.encodeHex
|
||||||
import akka.OnlyCauseStackTrace
|
|
||||||
|
|
||||||
object SerializationTests {
|
object SerializationTests {
|
||||||
|
|
||||||
|
|
@ -250,7 +248,7 @@ class SerializeSpec extends AkkaSpec(SerializationTests.serializeConf) {
|
||||||
|
|
||||||
intercept[IllegalArgumentException] {
|
intercept[IllegalArgumentException] {
|
||||||
byteSerializer.toBinary("pigdog")
|
byteSerializer.toBinary("pigdog")
|
||||||
}.getMessage should equal("ByteArraySerializer only serializes byte arrays, not [pigdog]")
|
}.getMessage should be("ByteArraySerializer only serializes byte arrays, not [pigdog]")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -326,7 +324,7 @@ class SerializationCompatibilitySpec extends AkkaSpec(SerializationTests.mostlyR
|
||||||
|
|
||||||
"Cross-version serialization compatibility" must {
|
"Cross-version serialization compatibility" must {
|
||||||
def verify(obj: SystemMessage, asExpected: String): Unit =
|
def verify(obj: SystemMessage, asExpected: String): Unit =
|
||||||
String.valueOf(ser.serialize(obj).map(encodeHex).get) should equal(asExpected)
|
String.valueOf(ser.serialize(obj).map(encodeHex).get) should be(asExpected)
|
||||||
|
|
||||||
"be preserved for the Create SystemMessage" in {
|
"be preserved for the Create SystemMessage" in {
|
||||||
// Using null as the cause to avoid a large serialized message and JDK differences
|
// Using null as the cause to avoid a large serialized message and JDK differences
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,15 @@
|
||||||
|
/**
|
||||||
|
* Copyright (C) 2009-2014 Typesafe Inc. <http://www.typesafe.com>
|
||||||
|
*/
|
||||||
|
|
||||||
package akka.util
|
package akka.util
|
||||||
|
|
||||||
import org.scalatest.WordSpec
|
import org.scalatest.WordSpec
|
||||||
import org.scalatest.Matchers
|
import org.scalatest.Matchers
|
||||||
import org.scalatest.BeforeAndAfterAll
|
|
||||||
import org.scalatest.prop.Checkers
|
import org.scalatest.prop.Checkers
|
||||||
import org.scalacheck._
|
import org.scalacheck.Arbitrary
|
||||||
import org.scalacheck.Arbitrary._
|
import org.scalacheck.Arbitrary.arbitrary
|
||||||
import org.scalacheck.Prop._
|
import org.scalacheck.Gen
|
||||||
import org.scalacheck.Gen._
|
|
||||||
|
|
||||||
import scala.collection.mutable.Builder
|
import scala.collection.mutable.Builder
|
||||||
|
|
||||||
|
|
@ -19,17 +21,17 @@ import java.lang.Double.doubleToRawLongBits
|
||||||
class ByteStringSpec extends WordSpec with Matchers with Checkers {
|
class ByteStringSpec extends WordSpec with Matchers with Checkers {
|
||||||
|
|
||||||
def genSimpleByteString(min: Int, max: Int) = for {
|
def genSimpleByteString(min: Int, max: Int) = for {
|
||||||
n ← choose(min, max)
|
n ← Gen.choose(min, max)
|
||||||
b ← Gen.containerOfN[Array, Byte](n, arbitrary[Byte])
|
b ← Gen.containerOfN[Array, Byte](n, arbitrary[Byte])
|
||||||
from ← choose(0, b.length)
|
from ← Gen.choose(0, b.length)
|
||||||
until ← choose(from, b.length)
|
until ← Gen.choose(from, b.length)
|
||||||
} yield ByteString(b).slice(from, until)
|
} yield ByteString(b).slice(from, until)
|
||||||
|
|
||||||
implicit val arbitraryByteString: Arbitrary[ByteString] = Arbitrary {
|
implicit val arbitraryByteString: Arbitrary[ByteString] = Arbitrary {
|
||||||
Gen.sized { s ⇒
|
Gen.sized { s ⇒
|
||||||
for {
|
for {
|
||||||
chunks ← choose(0, s)
|
chunks ← Gen.choose(0, s)
|
||||||
bytes ← listOfN(chunks, genSimpleByteString(1, s / (chunks max 1)))
|
bytes ← Gen.listOfN(chunks, genSimpleByteString(1, s / (chunks max 1)))
|
||||||
} yield (ByteString.empty /: bytes)(_ ++ _)
|
} yield (ByteString.empty /: bytes)(_ ++ _)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -39,8 +41,8 @@ class ByteStringSpec extends WordSpec with Matchers with Checkers {
|
||||||
implicit val arbitraryByteStringSlice: Arbitrary[ByteStringSlice] = Arbitrary {
|
implicit val arbitraryByteStringSlice: Arbitrary[ByteStringSlice] = Arbitrary {
|
||||||
for {
|
for {
|
||||||
xs ← arbitraryByteString.arbitrary
|
xs ← arbitraryByteString.arbitrary
|
||||||
from ← choose(0, xs.length - 1)
|
from ← Gen.choose(0, xs.length - 1)
|
||||||
until ← choose(from, xs.length)
|
until ← Gen.choose(from, xs.length)
|
||||||
} yield (xs, from, until)
|
} yield (xs, from, until)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -49,8 +51,8 @@ class ByteStringSpec extends WordSpec with Matchers with Checkers {
|
||||||
def arbSlice[A](arbArray: Arbitrary[Array[A]]): Arbitrary[ArraySlice[A]] = Arbitrary {
|
def arbSlice[A](arbArray: Arbitrary[Array[A]]): Arbitrary[ArraySlice[A]] = Arbitrary {
|
||||||
for {
|
for {
|
||||||
xs ← arbArray.arbitrary
|
xs ← arbArray.arbitrary
|
||||||
from ← choose(0, xs.length)
|
from ← Gen.choose(0, xs.length)
|
||||||
until ← choose(from, xs.length)
|
until ← Gen.choose(from, xs.length)
|
||||||
} yield (xs, from, until)
|
} yield (xs, from, until)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -72,9 +74,9 @@ class ByteStringSpec extends WordSpec with Matchers with Checkers {
|
||||||
implicit val arbitraryLongArrayNumBytes: Arbitrary[ArrayNumBytes[Long]] = Arbitrary {
|
implicit val arbitraryLongArrayNumBytes: Arbitrary[ArrayNumBytes[Long]] = Arbitrary {
|
||||||
for {
|
for {
|
||||||
xs ← arbitraryLongArray.arbitrary
|
xs ← arbitraryLongArray.arbitrary
|
||||||
from ← choose(0, xs.length)
|
from ← Gen.choose(0, xs.length)
|
||||||
until ← choose(from, xs.length)
|
until ← Gen.choose(from, xs.length)
|
||||||
bytes ← choose(0, 8)
|
bytes ← Gen.choose(0, 8)
|
||||||
} yield (xs.slice(from, until), bytes)
|
} yield (xs.slice(from, until), bytes)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -31,17 +31,17 @@ class IndexSpec extends AkkaSpec with Matchers with DefaultTimeout {
|
||||||
"take and return a value" in {
|
"take and return a value" in {
|
||||||
val index = emptyIndex
|
val index = emptyIndex
|
||||||
index.put("s1", 1)
|
index.put("s1", 1)
|
||||||
index.valueIterator("s1").toSet should equal(Set(1))
|
index.valueIterator("s1").toSet should be(Set(1))
|
||||||
}
|
}
|
||||||
"take and return several values" in {
|
"take and return several values" in {
|
||||||
val index = emptyIndex
|
val index = emptyIndex
|
||||||
index.put("s1", 1) should equal(true)
|
index.put("s1", 1) should be(true)
|
||||||
index.put("s1", 1) should equal(false)
|
index.put("s1", 1) should be(false)
|
||||||
index.put("s1", 2)
|
index.put("s1", 2)
|
||||||
index.put("s1", 3)
|
index.put("s1", 3)
|
||||||
index.put("s2", 4)
|
index.put("s2", 4)
|
||||||
index.valueIterator("s1").toSet should equal(Set(1, 2, 3))
|
index.valueIterator("s1").toSet should be(Set(1, 2, 3))
|
||||||
index.valueIterator("s2").toSet should equal(Set(4))
|
index.valueIterator("s2").toSet should be(Set(4))
|
||||||
}
|
}
|
||||||
"remove values" in {
|
"remove values" in {
|
||||||
val index = emptyIndex
|
val index = emptyIndex
|
||||||
|
|
@ -50,16 +50,16 @@ class IndexSpec extends AkkaSpec with Matchers with DefaultTimeout {
|
||||||
index.put("s2", 1)
|
index.put("s2", 1)
|
||||||
index.put("s2", 2)
|
index.put("s2", 2)
|
||||||
//Remove value
|
//Remove value
|
||||||
index.remove("s1", 1) should equal(true)
|
index.remove("s1", 1) should be(true)
|
||||||
index.remove("s1", 1) should equal(false)
|
index.remove("s1", 1) should be(false)
|
||||||
index.valueIterator("s1").toSet should equal(Set(2))
|
index.valueIterator("s1").toSet should be(Set(2))
|
||||||
//Remove key
|
//Remove key
|
||||||
index.remove("s2") match {
|
index.remove("s2") match {
|
||||||
case Some(iter) ⇒ iter.toSet should equal(Set(1, 2))
|
case Some(iter) ⇒ iter.toSet should be(Set(1, 2))
|
||||||
case None ⇒ fail()
|
case None ⇒ fail()
|
||||||
}
|
}
|
||||||
index.remove("s2") should equal(None)
|
index.remove("s2") should be(None)
|
||||||
index.valueIterator("s2").toSet should equal(Set())
|
index.valueIterator("s2").toSet should be(Set())
|
||||||
}
|
}
|
||||||
"remove the specified value" in {
|
"remove the specified value" in {
|
||||||
val index = emptyIndex
|
val index = emptyIndex
|
||||||
|
|
@ -71,9 +71,9 @@ class IndexSpec extends AkkaSpec with Matchers with DefaultTimeout {
|
||||||
index.put("s3", 2)
|
index.put("s3", 2)
|
||||||
|
|
||||||
index.removeValue(1)
|
index.removeValue(1)
|
||||||
index.valueIterator("s1").toSet should equal(Set(2, 3))
|
index.valueIterator("s1").toSet should be(Set(2, 3))
|
||||||
index.valueIterator("s2").toSet should equal(Set(2))
|
index.valueIterator("s2").toSet should be(Set(2))
|
||||||
index.valueIterator("s3").toSet should equal(Set(2))
|
index.valueIterator("s3").toSet should be(Set(2))
|
||||||
}
|
}
|
||||||
"apply a function for all key-value pairs and find every value" in {
|
"apply a function for all key-value pairs and find every value" in {
|
||||||
val index = indexWithValues
|
val index = indexWithValues
|
||||||
|
|
@ -81,15 +81,15 @@ class IndexSpec extends AkkaSpec with Matchers with DefaultTimeout {
|
||||||
var valueCount = 0
|
var valueCount = 0
|
||||||
index.foreach((key, value) ⇒ {
|
index.foreach((key, value) ⇒ {
|
||||||
valueCount = valueCount + 1
|
valueCount = valueCount + 1
|
||||||
index.findValue(key)(_ == value) should equal(Some(value))
|
index.findValue(key)(_ == value) should be(Some(value))
|
||||||
})
|
})
|
||||||
valueCount should equal(6)
|
valueCount should be(6)
|
||||||
}
|
}
|
||||||
"be cleared" in {
|
"be cleared" in {
|
||||||
val index = indexWithValues
|
val index = indexWithValues
|
||||||
index.isEmpty should equal(false)
|
index.isEmpty should be(false)
|
||||||
index.clear()
|
index.clear()
|
||||||
index.isEmpty should equal(true)
|
index.isEmpty should be(true)
|
||||||
}
|
}
|
||||||
"be able to be accessed in parallel" in {
|
"be able to be accessed in parallel" in {
|
||||||
val index = new Index[Int, Int](100, _ compareTo _)
|
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 key = Random.nextInt(nrOfKeys)
|
||||||
val values = index.valueIterator(key)
|
val values = index.valueIterator(key)
|
||||||
if (key >= nrOfKeys / 2) {
|
if (key >= nrOfKeys / 2) {
|
||||||
values.isEmpty should equal(false)
|
values.isEmpty should be(false)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ package akka.actor
|
||||||
|
|
||||||
import akka.AkkaException
|
import akka.AkkaException
|
||||||
import scala.annotation.tailrec
|
import scala.annotation.tailrec
|
||||||
import scala.reflect.BeanProperty
|
import scala.beans.BeanProperty
|
||||||
import scala.util.control.NoStackTrace
|
import scala.util.control.NoStackTrace
|
||||||
import akka.event.LoggingAdapter
|
import akka.event.LoggingAdapter
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -59,7 +59,7 @@ class AgentSpec extends AkkaSpec {
|
||||||
val result = Future.sequence(Seq(r1, r2, r3)).map(_.mkString(":"))
|
val result = Future.sequence(Seq(r1, r2, r3)).map(_.mkString(":"))
|
||||||
l2.countDown
|
l2.countDown
|
||||||
|
|
||||||
Await.result(result, 5 seconds) should equal("ab:abc:abcd")
|
Await.result(result, 5 seconds) should be("ab:abc:abcd")
|
||||||
|
|
||||||
agent() should be("abcd")
|
agent() should be("abcd")
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ import org.apache.camel._
|
||||||
import org.apache.camel.impl.{ DefaultProducer, DefaultEndpoint, DefaultComponent }
|
import org.apache.camel.impl.{ DefaultProducer, DefaultEndpoint, DefaultComponent }
|
||||||
import akka.actor._
|
import akka.actor._
|
||||||
import akka.pattern._
|
import akka.pattern._
|
||||||
import scala.reflect.BeanProperty
|
import scala.beans.BeanProperty
|
||||||
import scala.concurrent.duration._
|
import scala.concurrent.duration._
|
||||||
import scala.concurrent.{ ExecutionContext, Future }
|
import scala.concurrent.{ ExecutionContext, Future }
|
||||||
import scala.util.control.NonFatal
|
import scala.util.control.NonFatal
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@ class ActivationIntegrationTest extends WordSpec with Matchers with SharedCamelS
|
||||||
"ActivationAware should be notified when endpoint is activated" in {
|
"ActivationAware should be notified when endpoint is activated" in {
|
||||||
val latch = new TestLatch(0)
|
val latch = new TestLatch(0)
|
||||||
val actor = system.actorOf(Props(new TestConsumer("direct:actor-1", latch)), "act-direct-actor-1")
|
val actor = system.actorOf(Props(new TestConsumer("direct:actor-1", latch)), "act-direct-actor-1")
|
||||||
Await.result(camel.activationFutureFor(actor), 10 seconds) should equal(actor)
|
Await.result(camel.activationFutureFor(actor), 10 seconds) should be(actor)
|
||||||
|
|
||||||
template.requestBody("direct:actor-1", "test") should be("received test")
|
template.requestBody("direct:actor-1", "test") should be("received test")
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -21,30 +21,30 @@ class CamelConfigSpec extends WordSpec with Matchers {
|
||||||
}
|
}
|
||||||
"CamelConfigSpec" must {
|
"CamelConfigSpec" must {
|
||||||
"have correct activationTimeout config" in {
|
"have correct activationTimeout config" in {
|
||||||
settings.ActivationTimeout should equal(config.getMillisDuration("akka.camel.consumer.activation-timeout"))
|
settings.ActivationTimeout should be(config.getMillisDuration("akka.camel.consumer.activation-timeout"))
|
||||||
}
|
}
|
||||||
|
|
||||||
"have correct autoAck config" in {
|
"have correct autoAck config" in {
|
||||||
settings.AutoAck should equal(config.getBoolean("akka.camel.consumer.auto-ack"))
|
settings.AutoAck should be(config.getBoolean("akka.camel.consumer.auto-ack"))
|
||||||
}
|
}
|
||||||
|
|
||||||
"have correct replyTimeout config" in {
|
"have correct replyTimeout config" in {
|
||||||
settings.ReplyTimeout should equal(config.getMillisDuration("akka.camel.consumer.reply-timeout"))
|
settings.ReplyTimeout should be(config.getMillisDuration("akka.camel.consumer.reply-timeout"))
|
||||||
}
|
}
|
||||||
|
|
||||||
"have correct streamingCache config" in {
|
"have correct streamingCache config" in {
|
||||||
settings.StreamingCache should equal(config.getBoolean("akka.camel.streamingCache"))
|
settings.StreamingCache should be(config.getBoolean("akka.camel.streamingCache"))
|
||||||
}
|
}
|
||||||
|
|
||||||
"have correct jmxStatistics config" in {
|
"have correct jmxStatistics config" in {
|
||||||
settings.JmxStatistics should equal(config.getBoolean("akka.camel.jmx"))
|
settings.JmxStatistics should be(config.getBoolean("akka.camel.jmx"))
|
||||||
}
|
}
|
||||||
|
|
||||||
"have correct body conversions config" in {
|
"have correct body conversions config" in {
|
||||||
val conversions = config.getConfig("akka.camel.conversions")
|
val conversions = config.getConfig("akka.camel.conversions")
|
||||||
|
|
||||||
conversions.getString("file") should equal("java.io.InputStream")
|
conversions.getString("file") should be("java.io.InputStream")
|
||||||
conversions.entrySet.size should equal(1)
|
conversions.entrySet.size should be(1)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -23,19 +23,19 @@ class DurationConverterSpec extends WordSpec with Matchers {
|
||||||
}
|
}
|
||||||
|
|
||||||
"DurationTypeConverter must throw if invalid format" in {
|
"DurationTypeConverter must throw if invalid format" in {
|
||||||
tryConvertTo(classOf[Duration], "abc nanos") should equal(null)
|
tryConvertTo(classOf[Duration], "abc nanos") should be(null)
|
||||||
|
|
||||||
intercept[TypeConversionException] {
|
intercept[TypeConversionException] {
|
||||||
mandatoryConvertTo(classOf[Duration], "abc nanos") should be(10 nanos)
|
mandatoryConvertTo(classOf[Duration], "abc nanos") should be(10 nanos)
|
||||||
}.getValue should equal("abc nanos")
|
}.getValue should be("abc nanos")
|
||||||
}
|
}
|
||||||
|
|
||||||
"DurationTypeConverter must throw if doesn't end with time unit" in {
|
"DurationTypeConverter must throw if doesn't end with time unit" in {
|
||||||
tryConvertTo(classOf[Duration], "10233") should equal(null)
|
tryConvertTo(classOf[Duration], "10233") should be(null)
|
||||||
|
|
||||||
intercept[TypeConversionException] {
|
intercept[TypeConversionException] {
|
||||||
mandatoryConvertTo(classOf[Duration], "10233") should be(10 nanos)
|
mandatoryConvertTo(classOf[Duration], "10233") should be(10 nanos)
|
||||||
}.getValue should equal("10233")
|
}.getValue should be("10233")
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -39,8 +39,8 @@ class ClusterConfigSpec extends AkkaSpec {
|
||||||
PublishStatsInterval should be(Duration.Undefined)
|
PublishStatsInterval should be(Duration.Undefined)
|
||||||
AutoDownUnreachableAfter should be(Duration.Undefined)
|
AutoDownUnreachableAfter should be(Duration.Undefined)
|
||||||
MinNrOfMembers should be(1)
|
MinNrOfMembers should be(1)
|
||||||
MinNrOfMembersOfRole should equal(Map.empty)
|
MinNrOfMembersOfRole should be(Map.empty)
|
||||||
Roles should equal(Set.empty)
|
Roles should be(Set.empty)
|
||||||
JmxEnabled should be(true)
|
JmxEnabled should be(true)
|
||||||
UseDispatcher should be(Dispatchers.DefaultDispatcherId)
|
UseDispatcher should be(Dispatchers.DefaultDispatcherId)
|
||||||
GossipDifferentViewProbability should be(0.8 +- 0.0001)
|
GossipDifferentViewProbability should be(0.8 +- 0.0001)
|
||||||
|
|
|
||||||
|
|
@ -28,10 +28,10 @@ class MemberOrderingSpec extends WordSpec with Matchers {
|
||||||
m(AddressFromURIString("akka://sys@darkstar:1111"), Up)
|
m(AddressFromURIString("akka://sys@darkstar:1111"), Up)
|
||||||
|
|
||||||
val seq = members.toSeq
|
val seq = members.toSeq
|
||||||
seq.size should equal(3)
|
seq.size should be(3)
|
||||||
seq(0) should equal(m(AddressFromURIString("akka://sys@darkstar:1111"), Up))
|
seq(0) should be(m(AddressFromURIString("akka://sys@darkstar:1111"), Up))
|
||||||
seq(1) should equal(m(AddressFromURIString("akka://sys@darkstar:1112"), Up))
|
seq(1) should be(m(AddressFromURIString("akka://sys@darkstar:1112"), Up))
|
||||||
seq(2) should equal(m(AddressFromURIString("akka://sys@darkstar:1113"), Joining))
|
seq(2) should be(m(AddressFromURIString("akka://sys@darkstar:1113"), Joining))
|
||||||
}
|
}
|
||||||
|
|
||||||
"be sorted by address correctly" in {
|
"be sorted by address correctly" in {
|
||||||
|
|
@ -113,11 +113,11 @@ class MemberOrderingSpec extends WordSpec with Matchers {
|
||||||
AddressFromURIString("akka://sys@darkstar:1111")
|
AddressFromURIString("akka://sys@darkstar:1111")
|
||||||
|
|
||||||
val seq = addresses.toSeq
|
val seq = addresses.toSeq
|
||||||
seq.size should equal(4)
|
seq.size should be(4)
|
||||||
seq(0) should equal(AddressFromURIString("akka://sys@darkstar:1110"))
|
seq(0) should be(AddressFromURIString("akka://sys@darkstar:1110"))
|
||||||
seq(1) should equal(AddressFromURIString("akka://sys@darkstar:1111"))
|
seq(1) should be(AddressFromURIString("akka://sys@darkstar:1111"))
|
||||||
seq(2) should equal(AddressFromURIString("akka://sys@darkstar:1112"))
|
seq(2) should be(AddressFromURIString("akka://sys@darkstar:1112"))
|
||||||
seq(3) should equal(AddressFromURIString("akka://sys@darkstar:1113"))
|
seq(3) should be(AddressFromURIString("akka://sys@darkstar:1113"))
|
||||||
}
|
}
|
||||||
|
|
||||||
"order addresses by hostname" in {
|
"order addresses by hostname" in {
|
||||||
|
|
@ -128,11 +128,11 @@ class MemberOrderingSpec extends WordSpec with Matchers {
|
||||||
AddressFromURIString("akka://sys@darkstar0:1110")
|
AddressFromURIString("akka://sys@darkstar0:1110")
|
||||||
|
|
||||||
val seq = addresses.toSeq
|
val seq = addresses.toSeq
|
||||||
seq.size should equal(4)
|
seq.size should be(4)
|
||||||
seq(0) should equal(AddressFromURIString("akka://sys@darkstar0:1110"))
|
seq(0) should be(AddressFromURIString("akka://sys@darkstar0:1110"))
|
||||||
seq(1) should equal(AddressFromURIString("akka://sys@darkstar1:1110"))
|
seq(1) should be(AddressFromURIString("akka://sys@darkstar1:1110"))
|
||||||
seq(2) should equal(AddressFromURIString("akka://sys@darkstar2:1110"))
|
seq(2) should be(AddressFromURIString("akka://sys@darkstar2:1110"))
|
||||||
seq(3) should equal(AddressFromURIString("akka://sys@darkstar3:1110"))
|
seq(3) should be(AddressFromURIString("akka://sys@darkstar3:1110"))
|
||||||
}
|
}
|
||||||
|
|
||||||
"order addresses by hostname and port" in {
|
"order addresses by hostname and port" in {
|
||||||
|
|
@ -143,11 +143,11 @@ class MemberOrderingSpec extends WordSpec with Matchers {
|
||||||
AddressFromURIString("akka://sys@darkstar0:1110")
|
AddressFromURIString("akka://sys@darkstar0:1110")
|
||||||
|
|
||||||
val seq = addresses.toSeq
|
val seq = addresses.toSeq
|
||||||
seq.size should equal(4)
|
seq.size should be(4)
|
||||||
seq(0) should equal(AddressFromURIString("akka://sys@darkstar0:1110"))
|
seq(0) should be(AddressFromURIString("akka://sys@darkstar0:1110"))
|
||||||
seq(1) should equal(AddressFromURIString("akka://sys@darkstar0:1111"))
|
seq(1) should be(AddressFromURIString("akka://sys@darkstar0:1111"))
|
||||||
seq(2) should equal(AddressFromURIString("akka://sys@darkstar2:1110"))
|
seq(2) should be(AddressFromURIString("akka://sys@darkstar2:1110"))
|
||||||
seq(3) should equal(AddressFromURIString("akka://sys@darkstar2:1111"))
|
seq(3) should be(AddressFromURIString("akka://sys@darkstar2:1111"))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ import akka.testkit.AkkaSpec
|
||||||
class SerializeCreatorsVerificationSpec extends AkkaSpec {
|
class SerializeCreatorsVerificationSpec extends AkkaSpec {
|
||||||
|
|
||||||
"serialize-creators should be on" in {
|
"serialize-creators should be on" in {
|
||||||
system.settings.SerializeAllCreators should equal(true)
|
system.settings.SerializeAllCreators should be(true)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -217,14 +217,14 @@ class VectorClockSpec extends AkkaSpec {
|
||||||
val vv1 = v1 :+ node1
|
val vv1 = v1 :+ node1
|
||||||
val vv2 = v2 :+ node2
|
val vv2 = v2 :+ node2
|
||||||
|
|
||||||
(vv1 > v1) should equal(true)
|
(vv1 > v1) should be(true)
|
||||||
(vv2 > v2) should equal(true)
|
(vv2 > v2) should be(true)
|
||||||
|
|
||||||
(vv1 > v2) should equal(true)
|
(vv1 > v2) should be(true)
|
||||||
(vv2 > v1) should equal(true)
|
(vv2 > v1) should be(true)
|
||||||
|
|
||||||
(vv2 > vv1) should equal(false)
|
(vv2 > vv1) should be(false)
|
||||||
(vv1 > vv2) should equal(false)
|
(vv1 > vv2) should be(false)
|
||||||
}
|
}
|
||||||
|
|
||||||
"pass merging behavior" in {
|
"pass merging behavior" in {
|
||||||
|
|
@ -242,8 +242,8 @@ class VectorClockSpec extends AkkaSpec {
|
||||||
var c = a2.merge(b1)
|
var c = a2.merge(b1)
|
||||||
var c1 = c :+ node3
|
var c1 = c :+ node3
|
||||||
|
|
||||||
(c1 > a2) should equal(true)
|
(c1 > a2) should be(true)
|
||||||
(c1 > b1) should equal(true)
|
(c1 > b1) should be(true)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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 expectTransition(max: FiniteDuration, s1: State, s2: State) = expectMsg(max, FSM.Transition(proxy, s1, s2))
|
||||||
|
|
||||||
def sendN(n: Int) = (1 to n) foreach (proxy ! _)
|
def sendN(n: Int) = (1 to n) foreach (proxy ! _)
|
||||||
def expectN(n: Int) = (1 to n) foreach { n ⇒ expectMsg(n); lastSender should equal(target) }
|
def expectN(n: Int) = (1 to n) foreach { n ⇒ expectMsg(n); lastSender should be(target) }
|
||||||
|
|
||||||
// avoid too long timeout for expectNoMsg when using dilated timeouts, because
|
// avoid too long timeout for expectNoMsg when using dilated timeouts, because
|
||||||
// blackhole will trigger failure detection
|
// blackhole will trigger failure detection
|
||||||
|
|
|
||||||
|
|
@ -505,7 +505,7 @@ class ActorDocSpec extends AkkaSpec(Map("akka.loglevel" -> "INFO")) {
|
||||||
val b = system.actorOf(Props(classOf[Follower], this))
|
val b = system.actorOf(Props(classOf[Follower], this))
|
||||||
watch(b)
|
watch(b)
|
||||||
system.stop(a)
|
system.stop(a)
|
||||||
expectMsgType[akka.actor.Terminated].actor should equal(b)
|
expectMsgType[akka.actor.Terminated].actor should be(b)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -567,12 +567,12 @@ class ActorDocSpec extends AkkaSpec(Map("akka.loglevel" -> "INFO")) {
|
||||||
implicit val me = testActor
|
implicit val me = testActor
|
||||||
actor ! 42
|
actor ! 42
|
||||||
expectMsg(42)
|
expectMsg(42)
|
||||||
lastSender should equal(actor)
|
lastSender should be(actor)
|
||||||
actor ! me
|
actor ! me
|
||||||
expectMsg("reply")
|
expectMsg("reply")
|
||||||
lastSender.path.toStringWithoutAddress should equal("/user")
|
lastSender.path.toStringWithoutAddress should be("/user")
|
||||||
expectMsg("reply")
|
expectMsg("reply")
|
||||||
lastSender.path.toStringWithoutAddress should equal("/user")
|
lastSender.path.toStringWithoutAddress should be("/user")
|
||||||
}
|
}
|
||||||
|
|
||||||
"using ActorDSL outside of akka.actor package" in {
|
"using ActorDSL outside of akka.actor package" in {
|
||||||
|
|
|
||||||
|
|
@ -124,11 +124,11 @@ class TypedActorDocSpec extends AkkaSpec(Map("akka.loglevel" -> "INFO")) {
|
||||||
//#typed-actor-call-strict
|
//#typed-actor-call-strict
|
||||||
//#typed-actor-calls
|
//#typed-actor-calls
|
||||||
|
|
||||||
Await.result(fSquare, 3 seconds) should equal(100)
|
Await.result(fSquare, 3 seconds) should be(100)
|
||||||
|
|
||||||
oSquare should equal(Some(100))
|
oSquare should be(Some(100))
|
||||||
|
|
||||||
iSquare should equal(100)
|
iSquare should be(100)
|
||||||
|
|
||||||
//#typed-actor-stop
|
//#typed-actor-stop
|
||||||
TypedActor(system).stop(mySquarer)
|
TypedActor(system).stop(mySquarer)
|
||||||
|
|
@ -174,6 +174,6 @@ class TypedActorDocSpec extends AkkaSpec(Map("akka.loglevel" -> "INFO")) {
|
||||||
|
|
||||||
TypedActor(system).poisonPill(awesomeFooBar)
|
TypedActor(system).poisonPill(awesomeFooBar)
|
||||||
//#typed-actor-supercharge-usage
|
//#typed-actor-supercharge-usage
|
||||||
Await.result(f, 3 seconds) should equal("YES")
|
Await.result(f, 3 seconds) should be("YES")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -28,20 +28,20 @@ class AgentDocSpec extends AkkaSpec {
|
||||||
//#read-apply
|
//#read-apply
|
||||||
val result = agent()
|
val result = agent()
|
||||||
//#read-apply
|
//#read-apply
|
||||||
result should equal(0)
|
result should be(0)
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
//#read-get
|
//#read-get
|
||||||
val result = agent.get
|
val result = agent.get
|
||||||
//#read-get
|
//#read-get
|
||||||
result should equal(0)
|
result should be(0)
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
//#read-future
|
//#read-future
|
||||||
val future = agent.future
|
val future = agent.future
|
||||||
//#read-future
|
//#read-future
|
||||||
Await.result(future, 5 seconds) should equal(0)
|
Await.result(future, 5 seconds) should be(0)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -67,7 +67,7 @@ class AgentDocSpec extends AkkaSpec {
|
||||||
agent sendOff longRunningOrBlockingFunction
|
agent sendOff longRunningOrBlockingFunction
|
||||||
//#send-off
|
//#send-off
|
||||||
|
|
||||||
Await.result(agent.future, 5 seconds) should equal(16)
|
Await.result(agent.future, 5 seconds) should be(16)
|
||||||
}
|
}
|
||||||
|
|
||||||
"alter and alterOff" in {
|
"alter and alterOff" in {
|
||||||
|
|
@ -91,7 +91,7 @@ class AgentDocSpec extends AkkaSpec {
|
||||||
val f4: Future[Int] = agent alterOff longRunningOrBlockingFunction
|
val f4: Future[Int] = agent alterOff longRunningOrBlockingFunction
|
||||||
//#alter-off
|
//#alter-off
|
||||||
|
|
||||||
Await.result(f4, 5 seconds) should equal(16)
|
Await.result(f4, 5 seconds) should be(16)
|
||||||
}
|
}
|
||||||
|
|
||||||
"transfer example" in {
|
"transfer example" in {
|
||||||
|
|
@ -120,9 +120,9 @@ class AgentDocSpec extends AkkaSpec {
|
||||||
val toValue = to.future // -> 70
|
val toValue = to.future // -> 70
|
||||||
//#transfer-example
|
//#transfer-example
|
||||||
|
|
||||||
Await.result(fromValue, 5 seconds) should equal(50)
|
Await.result(fromValue, 5 seconds) should be(50)
|
||||||
Await.result(toValue, 5 seconds) should equal(70)
|
Await.result(toValue, 5 seconds) should be(70)
|
||||||
ok should equal(true)
|
ok should be(true)
|
||||||
}
|
}
|
||||||
|
|
||||||
"monadic example" in {
|
"monadic example" in {
|
||||||
|
|
@ -149,8 +149,8 @@ class AgentDocSpec extends AkkaSpec {
|
||||||
} yield value1 + value2
|
} yield value1 + value2
|
||||||
//#monadic-example
|
//#monadic-example
|
||||||
|
|
||||||
agent3() should equal(4)
|
agent3() should be(4)
|
||||||
agent4() should equal(4)
|
agent4() should be(4)
|
||||||
agent5() should equal(8)
|
agent5() should be(8)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -47,7 +47,7 @@ class RemoteDeploymentDocSpec extends AkkaSpec("""
|
||||||
val one = AddressFromURIString("akka.tcp://sys@host:1234")
|
val one = AddressFromURIString("akka.tcp://sys@host:1234")
|
||||||
val two = Address("akka.tcp", "sys", "host", 1234) // this gives the same
|
val two = Address("akka.tcp", "sys", "host", 1234) // this gives the same
|
||||||
//#make-address
|
//#make-address
|
||||||
one should equal(two)
|
one should be(two)
|
||||||
}
|
}
|
||||||
|
|
||||||
"demonstrate sampleActor" in {
|
"demonstrate sampleActor" in {
|
||||||
|
|
|
||||||
|
|
@ -123,9 +123,9 @@ package docs.serialization {
|
||||||
#//#serialization-bindings-config
|
#//#serialization-bindings-config
|
||||||
""")
|
""")
|
||||||
val a = ActorSystem("system", config)
|
val a = ActorSystem("system", config)
|
||||||
SerializationExtension(a).serializerFor(classOf[String]).getClass should equal(classOf[JavaSerializer])
|
SerializationExtension(a).serializerFor(classOf[String]).getClass should be(classOf[JavaSerializer])
|
||||||
SerializationExtension(a).serializerFor(classOf[Customer]).getClass should equal(classOf[JavaSerializer])
|
SerializationExtension(a).serializerFor(classOf[Customer]).getClass should be(classOf[JavaSerializer])
|
||||||
SerializationExtension(a).serializerFor(classOf[java.lang.Boolean]).getClass should equal(classOf[MyOwnSerializer])
|
SerializationExtension(a).serializerFor(classOf[java.lang.Boolean]).getClass should be(classOf[MyOwnSerializer])
|
||||||
shutdown(a)
|
shutdown(a)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -149,7 +149,7 @@ package docs.serialization {
|
||||||
val back = serializer.fromBinary(bytes, manifest = None)
|
val back = serializer.fromBinary(bytes, manifest = None)
|
||||||
|
|
||||||
// Voilá!
|
// Voilá!
|
||||||
back should equal(original)
|
back should be(original)
|
||||||
|
|
||||||
//#programmatic
|
//#programmatic
|
||||||
shutdown(system)
|
shutdown(system)
|
||||||
|
|
|
||||||
|
|
@ -55,12 +55,12 @@ trait Player { this: TestConductorExt ⇒
|
||||||
def receive = {
|
def receive = {
|
||||||
case fsm: ActorRef ⇒
|
case fsm: ActorRef ⇒
|
||||||
waiting = sender(); fsm ! SubscribeTransitionCallBack(self)
|
waiting = sender(); fsm ! SubscribeTransitionCallBack(self)
|
||||||
case Transition(_, Connecting, AwaitDone) ⇒ // step 1, not there yet
|
case Transition(_, f: ClientFSM.State, t: ClientFSM.State) if (f == Connecting && t == AwaitDone) ⇒ // step 1, not there yet // // SI-5900 workaround
|
||||||
case Transition(_, AwaitDone, Connected) ⇒
|
case Transition(_, f: ClientFSM.State, t: ClientFSM.State) if (f == AwaitDone && t == Connected) ⇒ // SI-5900 workaround
|
||||||
waiting ! Done; context stop self
|
waiting ! Done; context stop self
|
||||||
case t: Transition[_] ⇒
|
case t: Transition[_] ⇒
|
||||||
waiting ! Status.Failure(new RuntimeException("unexpected transition: " + t)); context stop self
|
waiting ! Status.Failure(new RuntimeException("unexpected transition: " + t)); context stop self
|
||||||
case CurrentState(_, Connected) ⇒
|
case CurrentState(_, s: ClientFSM.State) if (s == Connected) ⇒ // SI-5900 workaround
|
||||||
waiting ! Done; context stop self
|
waiting ! Done; context stop self
|
||||||
case _: CurrentState[_] ⇒
|
case _: CurrentState[_] ⇒
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -254,6 +254,15 @@ abstract class MultiNodeSpec(val myself: RoleName, _system: ActorSystem, _roles:
|
||||||
|
|
||||||
val log: LoggingAdapter = Logging(system, this.getClass)
|
val log: LoggingAdapter = Logging(system, this.getClass)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Enrich `.await()` onto all Awaitables, using remaining duration from the innermost
|
||||||
|
* enclosing `within` block or QueryTimeout.
|
||||||
|
*/
|
||||||
|
implicit def awaitHelper[T](w: Awaitable[T]) = new AwaitHelper(w)
|
||||||
|
class AwaitHelper[T](w: Awaitable[T]) {
|
||||||
|
def await: T = Await.result(w, remainingOr(testConductor.Settings.QueryTimeout.duration))
|
||||||
|
}
|
||||||
|
|
||||||
final override def multiNodeSpecBeforeAll {
|
final override def multiNodeSpecBeforeAll {
|
||||||
atStartup()
|
atStartup()
|
||||||
}
|
}
|
||||||
|
|
@ -264,6 +273,7 @@ abstract class MultiNodeSpec(val myself: RoleName, _system: ActorSystem, _roles:
|
||||||
testConductor.removeNode(myself)
|
testConductor.removeNode(myself)
|
||||||
within(testConductor.Settings.BarrierTimeout.duration) {
|
within(testConductor.Settings.BarrierTimeout.duration) {
|
||||||
awaitCond {
|
awaitCond {
|
||||||
|
// Await.result(testConductor.getNodes, remaining).filterNot(_ == myself).isEmpty
|
||||||
testConductor.getNodes.await.filterNot(_ == myself).isEmpty
|
testConductor.getNodes.await.filterNot(_ == myself).isEmpty
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -361,15 +371,6 @@ abstract class MultiNodeSpec(val myself: RoleName, _system: ActorSystem, _roles:
|
||||||
else messageClasses foreach mute
|
else messageClasses foreach mute
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Enrich `.await()` onto all Awaitables, using remaining duration from the innermost
|
|
||||||
* enclosing `within` block or QueryTimeout.
|
|
||||||
*/
|
|
||||||
implicit def awaitHelper[T](w: Awaitable[T]) = new AwaitHelper(w)
|
|
||||||
class AwaitHelper[T](w: Awaitable[T]) {
|
|
||||||
def await: T = Await.result(w, remainingOr(testConductor.Settings.QueryTimeout.duration))
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Implementation (i.e. wait for start etc.)
|
* Implementation (i.e. wait for start etc.)
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -73,7 +73,7 @@ class RuntimeNameActorSystemActivatorTest extends WordSpec with Matchers with Po
|
||||||
|
|
||||||
"register an ActorSystem and add the bundle id to the system name" in {
|
"register an ActorSystem and add the bundle id to the system name" in {
|
||||||
filterErrors() {
|
filterErrors() {
|
||||||
serviceForType[ActorSystem].name should equal(TestActivators.ACTOR_SYSTEM_NAME_PATTERN.format(bundleForName(TEST_BUNDLE_NAME).getBundleId))
|
serviceForType[ActorSystem].name should be(TestActivators.ACTOR_SYSTEM_NAME_PATTERN.format(bundleForName(TEST_BUNDLE_NAME).getBundleId))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -49,7 +49,7 @@ class LookupRemoteActorSpec extends MultiNodeSpec(LookupRemoteActorMultiJvmSpec)
|
||||||
}
|
}
|
||||||
hello.isInstanceOf[RemoteActorRef] should be(true)
|
hello.isInstanceOf[RemoteActorRef] should be(true)
|
||||||
val masterAddress = testConductor.getAddressFor(master).await
|
val masterAddress = testConductor.getAddressFor(master).await
|
||||||
(hello ? "identify").await.asInstanceOf[ActorRef].path.address should equal(masterAddress)
|
(hello ? "identify").await.asInstanceOf[ActorRef].path.address should be(masterAddress)
|
||||||
}
|
}
|
||||||
enterBarrier("done")
|
enterBarrier("done")
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -59,7 +59,7 @@ class NewRemoteActorSpec extends MultiNodeSpec(NewRemoteActorMultiJvmSpec)
|
||||||
|
|
||||||
val slaveAddress = testConductor.getAddressFor(slave).await
|
val slaveAddress = testConductor.getAddressFor(slave).await
|
||||||
actor ! "identify"
|
actor ! "identify"
|
||||||
expectMsgType[ActorRef].path.address should equal(slaveAddress)
|
expectMsgType[ActorRef].path.address should be(slaveAddress)
|
||||||
}
|
}
|
||||||
|
|
||||||
enterBarrier("done")
|
enterBarrier("done")
|
||||||
|
|
@ -74,7 +74,7 @@ class NewRemoteActorSpec extends MultiNodeSpec(NewRemoteActorMultiJvmSpec)
|
||||||
|
|
||||||
val slaveAddress = testConductor.getAddressFor(slave).await
|
val slaveAddress = testConductor.getAddressFor(slave).await
|
||||||
actor ! "identify"
|
actor ! "identify"
|
||||||
expectMsgType[ActorRef].path.address should equal(slaveAddress)
|
expectMsgType[ActorRef].path.address should be(slaveAddress)
|
||||||
}
|
}
|
||||||
|
|
||||||
enterBarrier("done")
|
enterBarrier("done")
|
||||||
|
|
|
||||||
|
|
@ -134,7 +134,7 @@ class RoundRobinRoutedRemoteActorSpec extends MultiNodeSpec(RoundRobinRoutedRemo
|
||||||
enterBarrier("end")
|
enterBarrier("end")
|
||||||
repliesFrom.size should be(7)
|
repliesFrom.size should be(7)
|
||||||
val repliesFromAddresses = repliesFrom.map(_.path.address)
|
val repliesFromAddresses = repliesFrom.map(_.path.address)
|
||||||
repliesFromAddresses should equal(Set(node(first), node(second), node(third)).map(_.address))
|
repliesFromAddresses should be(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
|
// 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
|
// "Terminate" to a shut down node
|
||||||
|
|
|
||||||
|
|
@ -84,7 +84,7 @@ class ScatterGatherRoutedRemoteActorSpec extends MultiNodeSpec(ScatterGatherRout
|
||||||
actor ! Broadcast(PoisonPill)
|
actor ! Broadcast(PoisonPill)
|
||||||
|
|
||||||
enterBarrier("end")
|
enterBarrier("end")
|
||||||
replies.values.sum should equal(connectionCount * iterationCount)
|
replies.values.sum should be(connectionCount * iterationCount)
|
||||||
replies.get(node(fourth).address) should be(None)
|
replies.get(node(fourth).address) should be(None)
|
||||||
|
|
||||||
// shut down the actor before we let the other node(s) shut down so we don't try to send
|
// shut down the actor before we let the other node(s) shut down so we don't try to send
|
||||||
|
|
|
||||||
|
|
@ -151,7 +151,7 @@ class RemoteRoundRobinSpec extends MultiNodeSpec(RemoteRoundRobinMultiJvmSpec)
|
||||||
enterBarrier("end")
|
enterBarrier("end")
|
||||||
repliesFrom.size should be(7)
|
repliesFrom.size should be(7)
|
||||||
val repliesFromAddresses = repliesFrom.map(_.path.address)
|
val repliesFromAddresses = repliesFrom.map(_.path.address)
|
||||||
repliesFromAddresses should equal(Set(node(first), node(second), node(third)).map(_.address))
|
repliesFromAddresses should be(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
|
// 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
|
// "Terminate" to a shut down node
|
||||||
|
|
|
||||||
|
|
@ -82,7 +82,7 @@ class RemoteScatterGatherSpec extends MultiNodeSpec(RemoteScatterGatherMultiJvmS
|
||||||
actor ! Broadcast(PoisonPill)
|
actor ! Broadcast(PoisonPill)
|
||||||
|
|
||||||
enterBarrier("end")
|
enterBarrier("end")
|
||||||
replies.values.sum should equal(connectionCount * iterationCount)
|
replies.values.sum should be(connectionCount * iterationCount)
|
||||||
replies.get(node(fourth).address) should be(None)
|
replies.get(node(fourth).address) should be(None)
|
||||||
|
|
||||||
// shut down the actor before we let the other node(s) shut down so we don't try to send
|
// shut down the actor before we let the other node(s) shut down so we don't try to send
|
||||||
|
|
|
||||||
|
|
@ -80,13 +80,13 @@ class AckedDeliverySpec extends AkkaSpec {
|
||||||
val msg2 = msg(2)
|
val msg2 = msg(2)
|
||||||
|
|
||||||
val b1 = b0.buffer(msg0)
|
val b1 = b0.buffer(msg0)
|
||||||
b1.nonAcked should equal(Vector(msg0))
|
b1.nonAcked should be(Vector(msg0))
|
||||||
|
|
||||||
val b2 = b1.buffer(msg1)
|
val b2 = b1.buffer(msg1)
|
||||||
b2.nonAcked should equal(Vector(msg0, msg1))
|
b2.nonAcked should be(Vector(msg0, msg1))
|
||||||
|
|
||||||
val b3 = b2.buffer(msg2)
|
val b3 = b2.buffer(msg2)
|
||||||
b3.nonAcked should equal(Vector(msg0, msg1, msg2))
|
b3.nonAcked should be(Vector(msg0, msg1, msg2))
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -107,31 +107,31 @@ class AckedDeliverySpec extends AkkaSpec {
|
||||||
val msg4 = msg(4)
|
val msg4 = msg(4)
|
||||||
|
|
||||||
val b1 = b0.buffer(msg0)
|
val b1 = b0.buffer(msg0)
|
||||||
b1.nonAcked should equal(Vector(msg0))
|
b1.nonAcked should be(Vector(msg0))
|
||||||
|
|
||||||
val b2 = b1.buffer(msg1)
|
val b2 = b1.buffer(msg1)
|
||||||
b2.nonAcked should equal(Vector(msg0, msg1))
|
b2.nonAcked should be(Vector(msg0, msg1))
|
||||||
|
|
||||||
val b3 = b2.buffer(msg2)
|
val b3 = b2.buffer(msg2)
|
||||||
b3.nonAcked should equal(Vector(msg0, msg1, msg2))
|
b3.nonAcked should be(Vector(msg0, msg1, msg2))
|
||||||
|
|
||||||
val b4 = b3.acknowledge(Ack(SeqNo(1)))
|
val b4 = b3.acknowledge(Ack(SeqNo(1)))
|
||||||
b4.nonAcked should equal(Vector(msg2))
|
b4.nonAcked should be(Vector(msg2))
|
||||||
|
|
||||||
val b5 = b4.buffer(msg3)
|
val b5 = b4.buffer(msg3)
|
||||||
b5.nonAcked should equal(Vector(msg2, msg3))
|
b5.nonAcked should be(Vector(msg2, msg3))
|
||||||
|
|
||||||
val b6 = b5.buffer(msg4)
|
val b6 = b5.buffer(msg4)
|
||||||
b6.nonAcked should equal(Vector(msg2, msg3, msg4))
|
b6.nonAcked should be(Vector(msg2, msg3, msg4))
|
||||||
|
|
||||||
val b7 = b6.acknowledge(Ack(SeqNo(1)))
|
val b7 = b6.acknowledge(Ack(SeqNo(1)))
|
||||||
b7.nonAcked should equal(Vector(msg2, msg3, msg4))
|
b7.nonAcked should be(Vector(msg2, msg3, msg4))
|
||||||
|
|
||||||
val b8 = b7.acknowledge(Ack(SeqNo(2)))
|
val b8 = b7.acknowledge(Ack(SeqNo(2)))
|
||||||
b8.nonAcked should equal(Vector(msg3, msg4))
|
b8.nonAcked should be(Vector(msg3, msg4))
|
||||||
|
|
||||||
val b9 = b8.acknowledge(Ack(SeqNo(5)))
|
val b9 = b8.acknowledge(Ack(SeqNo(5)))
|
||||||
b9.nonAcked should equal(Vector.empty)
|
b9.nonAcked should be(Vector.empty)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -144,29 +144,29 @@ class AckedDeliverySpec extends AkkaSpec {
|
||||||
val msg4 = msg(4)
|
val msg4 = msg(4)
|
||||||
|
|
||||||
val b1 = b0.buffer(msg0)
|
val b1 = b0.buffer(msg0)
|
||||||
b1.nonAcked should equal(Vector(msg0))
|
b1.nonAcked should be(Vector(msg0))
|
||||||
|
|
||||||
val b2 = b1.buffer(msg1)
|
val b2 = b1.buffer(msg1)
|
||||||
b2.nonAcked should equal(Vector(msg0, msg1))
|
b2.nonAcked should be(Vector(msg0, msg1))
|
||||||
|
|
||||||
val b3 = b2.buffer(msg2)
|
val b3 = b2.buffer(msg2)
|
||||||
b3.nonAcked should equal(Vector(msg0, msg1, msg2))
|
b3.nonAcked should be(Vector(msg0, msg1, msg2))
|
||||||
|
|
||||||
val b4 = b3.acknowledge(Ack(SeqNo(1), nacks = Set(SeqNo(0))))
|
val b4 = b3.acknowledge(Ack(SeqNo(1), nacks = Set(SeqNo(0))))
|
||||||
b4.nonAcked should equal(Vector(msg2))
|
b4.nonAcked should be(Vector(msg2))
|
||||||
b4.nacked should equal(Vector(msg0))
|
b4.nacked should be(Vector(msg0))
|
||||||
|
|
||||||
val b5 = b4.buffer(msg3).buffer(msg4)
|
val b5 = b4.buffer(msg3).buffer(msg4)
|
||||||
b5.nonAcked should equal(Vector(msg2, msg3, msg4))
|
b5.nonAcked should be(Vector(msg2, msg3, msg4))
|
||||||
b5.nacked should equal(Vector(msg0))
|
b5.nacked should be(Vector(msg0))
|
||||||
|
|
||||||
val b6 = b5.acknowledge(Ack(SeqNo(4), nacks = Set(SeqNo(2), SeqNo(3))))
|
val b6 = b5.acknowledge(Ack(SeqNo(4), nacks = Set(SeqNo(2), SeqNo(3))))
|
||||||
b6.nonAcked should equal(Vector())
|
b6.nonAcked should be(Vector())
|
||||||
b6.nacked should equal(Vector(msg2, msg3))
|
b6.nacked should be(Vector(msg2, msg3))
|
||||||
|
|
||||||
val b7 = b6.acknowledge(Ack(SeqNo(5)))
|
val b7 = b6.acknowledge(Ack(SeqNo(5)))
|
||||||
b7.nonAcked should equal(Vector.empty)
|
b7.nonAcked should be(Vector.empty)
|
||||||
b7.nacked should equal(Vector.empty)
|
b7.nacked should be(Vector.empty)
|
||||||
}
|
}
|
||||||
|
|
||||||
"throw exception if non-buffered sequence number is NACKed" in {
|
"throw exception if non-buffered sequence number is NACKed" in {
|
||||||
|
|
@ -194,28 +194,28 @@ class AckedDeliverySpec extends AkkaSpec {
|
||||||
val msg5 = msg(5)
|
val msg5 = msg(5)
|
||||||
|
|
||||||
val (b1, deliver1, ack1) = b0.receive(msg1).extractDeliverable
|
val (b1, deliver1, ack1) = b0.receive(msg1).extractDeliverable
|
||||||
deliver1 should equal(Vector.empty)
|
deliver1 should be(Vector.empty)
|
||||||
ack1 should equal(Ack(SeqNo(1), nacks = Set(SeqNo(0))))
|
ack1 should be(Ack(SeqNo(1), nacks = Set(SeqNo(0))))
|
||||||
|
|
||||||
val (b2, deliver2, ack2) = b1.receive(msg0).extractDeliverable
|
val (b2, deliver2, ack2) = b1.receive(msg0).extractDeliverable
|
||||||
deliver2 should equal(Vector(msg0, msg1))
|
deliver2 should be(Vector(msg0, msg1))
|
||||||
ack2 should equal(Ack(SeqNo(1)))
|
ack2 should be(Ack(SeqNo(1)))
|
||||||
|
|
||||||
val (b3, deliver3, ack3) = b2.receive(msg4).extractDeliverable
|
val (b3, deliver3, ack3) = b2.receive(msg4).extractDeliverable
|
||||||
deliver3 should equal(Vector.empty)
|
deliver3 should be(Vector.empty)
|
||||||
ack3 should equal(Ack(SeqNo(4), nacks = Set(SeqNo(2), SeqNo(3))))
|
ack3 should be(Ack(SeqNo(4), nacks = Set(SeqNo(2), SeqNo(3))))
|
||||||
|
|
||||||
val (b4, deliver4, ack4) = b3.receive(msg2).extractDeliverable
|
val (b4, deliver4, ack4) = b3.receive(msg2).extractDeliverable
|
||||||
deliver4 should equal(Vector(msg2))
|
deliver4 should be(Vector(msg2))
|
||||||
ack4 should equal(Ack(SeqNo(4), nacks = Set(SeqNo(3))))
|
ack4 should be(Ack(SeqNo(4), nacks = Set(SeqNo(3))))
|
||||||
|
|
||||||
val (b5, deliver5, ack5) = b4.receive(msg5).extractDeliverable
|
val (b5, deliver5, ack5) = b4.receive(msg5).extractDeliverable
|
||||||
deliver5 should equal(Vector.empty)
|
deliver5 should be(Vector.empty)
|
||||||
ack5 should equal(Ack(SeqNo(5), nacks = Set(SeqNo(3))))
|
ack5 should be(Ack(SeqNo(5), nacks = Set(SeqNo(3))))
|
||||||
|
|
||||||
val (_, deliver6, ack6) = b5.receive(msg3).extractDeliverable
|
val (_, deliver6, ack6) = b5.receive(msg3).extractDeliverable
|
||||||
deliver6 should equal(Vector(msg3, msg4, msg5))
|
deliver6 should be(Vector(msg3, msg4, msg5))
|
||||||
ack6 should equal(Ack(SeqNo(5)))
|
ack6 should be(Ack(SeqNo(5)))
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -237,8 +237,8 @@ class AckedDeliverySpec extends AkkaSpec {
|
||||||
|
|
||||||
val (_, deliver, ack) = buf3.extractDeliverable
|
val (_, deliver, ack) = buf3.extractDeliverable
|
||||||
|
|
||||||
deliver should equal(Vector.empty)
|
deliver should be(Vector.empty)
|
||||||
ack should equal(Ack(SeqNo(2)))
|
ack should be(Ack(SeqNo(2)))
|
||||||
}
|
}
|
||||||
|
|
||||||
"be able to correctly merge with another receive buffer" in {
|
"be able to correctly merge with another receive buffer" in {
|
||||||
|
|
@ -254,8 +254,8 @@ class AckedDeliverySpec extends AkkaSpec {
|
||||||
buf2.receive(msg1b).receive(msg3))
|
buf2.receive(msg1b).receive(msg3))
|
||||||
|
|
||||||
val (_, deliver, ack) = buf.receive(msg0).extractDeliverable
|
val (_, deliver, ack) = buf.receive(msg0).extractDeliverable
|
||||||
deliver should equal(Vector(msg0, msg1a, msg2, msg3))
|
deliver should be(Vector(msg0, msg1a, msg2, msg3))
|
||||||
ack should equal(Ack(SeqNo(3)))
|
ack should be(Ack(SeqNo(3)))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -18,12 +18,12 @@ class EndpointRegistrySpec extends AkkaSpec {
|
||||||
"be able to register a writable endpoint and policy" in {
|
"be able to register a writable endpoint and policy" in {
|
||||||
val reg = new EndpointRegistry
|
val reg = new EndpointRegistry
|
||||||
|
|
||||||
reg.writableEndpointWithPolicyFor(address1) should equal(None)
|
reg.writableEndpointWithPolicyFor(address1) should be(None)
|
||||||
|
|
||||||
reg.registerWritableEndpoint(address1, actorA) should equal(actorA)
|
reg.registerWritableEndpoint(address1, actorA) should be(actorA)
|
||||||
|
|
||||||
reg.writableEndpointWithPolicyFor(address1) should equal(Some(Pass(actorA)))
|
reg.writableEndpointWithPolicyFor(address1) should be(Some(Pass(actorA)))
|
||||||
reg.readOnlyEndpointFor(address1) should equal(None)
|
reg.readOnlyEndpointFor(address1) should be(None)
|
||||||
reg.isWritable(actorA) should be(true)
|
reg.isWritable(actorA) should be(true)
|
||||||
reg.isReadOnly(actorA) should be(false)
|
reg.isReadOnly(actorA) should be(false)
|
||||||
|
|
||||||
|
|
@ -32,12 +32,12 @@ class EndpointRegistrySpec extends AkkaSpec {
|
||||||
|
|
||||||
"be able to register a read-only endpoint" in {
|
"be able to register a read-only endpoint" in {
|
||||||
val reg = new EndpointRegistry
|
val reg = new EndpointRegistry
|
||||||
reg.readOnlyEndpointFor(address1) should equal(None)
|
reg.readOnlyEndpointFor(address1) should be(None)
|
||||||
|
|
||||||
reg.registerReadOnlyEndpoint(address1, actorA) should equal(actorA)
|
reg.registerReadOnlyEndpoint(address1, actorA) should be(actorA)
|
||||||
|
|
||||||
reg.readOnlyEndpointFor(address1) should equal(Some(actorA))
|
reg.readOnlyEndpointFor(address1) should be(Some(actorA))
|
||||||
reg.writableEndpointWithPolicyFor(address1) should equal(None)
|
reg.writableEndpointWithPolicyFor(address1) should be(None)
|
||||||
reg.isWritable(actorA) should be(false)
|
reg.isWritable(actorA) should be(false)
|
||||||
reg.isReadOnly(actorA) should be(true)
|
reg.isReadOnly(actorA) should be(true)
|
||||||
reg.isQuarantined(address1, 42) should be(false)
|
reg.isQuarantined(address1, 42) should be(false)
|
||||||
|
|
@ -45,14 +45,14 @@ class EndpointRegistrySpec extends AkkaSpec {
|
||||||
|
|
||||||
"be able to register a writable and a read-only endpoint correctly" in {
|
"be able to register a writable and a read-only endpoint correctly" in {
|
||||||
val reg = new EndpointRegistry
|
val reg = new EndpointRegistry
|
||||||
reg.readOnlyEndpointFor(address1) should equal(None)
|
reg.readOnlyEndpointFor(address1) should be(None)
|
||||||
reg.writableEndpointWithPolicyFor(address1) should equal(None)
|
reg.writableEndpointWithPolicyFor(address1) should be(None)
|
||||||
|
|
||||||
reg.registerReadOnlyEndpoint(address1, actorA) should equal(actorA)
|
reg.registerReadOnlyEndpoint(address1, actorA) should be(actorA)
|
||||||
reg.registerWritableEndpoint(address1, actorB) should equal(actorB)
|
reg.registerWritableEndpoint(address1, actorB) should be(actorB)
|
||||||
|
|
||||||
reg.readOnlyEndpointFor(address1) should equal(Some(actorA))
|
reg.readOnlyEndpointFor(address1) should be(Some(actorA))
|
||||||
reg.writableEndpointWithPolicyFor(address1) should equal(Some(Pass(actorB)))
|
reg.writableEndpointWithPolicyFor(address1) should be(Some(Pass(actorB)))
|
||||||
|
|
||||||
reg.isWritable(actorA) should be(false)
|
reg.isWritable(actorA) should be(false)
|
||||||
reg.isWritable(actorB) should be(true)
|
reg.isWritable(actorB) should be(true)
|
||||||
|
|
@ -65,11 +65,11 @@ class EndpointRegistrySpec extends AkkaSpec {
|
||||||
"be able to register Gated policy for an address" in {
|
"be able to register Gated policy for an address" in {
|
||||||
val reg = new EndpointRegistry
|
val reg = new EndpointRegistry
|
||||||
|
|
||||||
reg.writableEndpointWithPolicyFor(address1) should equal(None)
|
reg.writableEndpointWithPolicyFor(address1) should be(None)
|
||||||
reg.registerWritableEndpoint(address1, actorA)
|
reg.registerWritableEndpoint(address1, actorA)
|
||||||
val deadline = Deadline.now
|
val deadline = Deadline.now
|
||||||
reg.markAsFailed(actorA, deadline)
|
reg.markAsFailed(actorA, deadline)
|
||||||
reg.writableEndpointWithPolicyFor(address1) should equal(Some(Gated(deadline)))
|
reg.writableEndpointWithPolicyFor(address1) should be(Some(Gated(deadline)))
|
||||||
reg.isReadOnly(actorA) should be(false)
|
reg.isReadOnly(actorA) should be(false)
|
||||||
reg.isWritable(actorA) should be(false)
|
reg.isWritable(actorA) should be(false)
|
||||||
}
|
}
|
||||||
|
|
@ -79,7 +79,7 @@ class EndpointRegistrySpec extends AkkaSpec {
|
||||||
|
|
||||||
reg.registerReadOnlyEndpoint(address1, actorA)
|
reg.registerReadOnlyEndpoint(address1, actorA)
|
||||||
reg.markAsFailed(actorA, Deadline.now)
|
reg.markAsFailed(actorA, Deadline.now)
|
||||||
reg.readOnlyEndpointFor(address1) should equal(None)
|
reg.readOnlyEndpointFor(address1) should be(None)
|
||||||
}
|
}
|
||||||
|
|
||||||
"keep tombstones when removing an endpoint" in {
|
"keep tombstones when removing an endpoint" in {
|
||||||
|
|
@ -94,8 +94,8 @@ class EndpointRegistrySpec extends AkkaSpec {
|
||||||
reg.unregisterEndpoint(actorA)
|
reg.unregisterEndpoint(actorA)
|
||||||
reg.unregisterEndpoint(actorB)
|
reg.unregisterEndpoint(actorB)
|
||||||
|
|
||||||
reg.writableEndpointWithPolicyFor(address1) should equal(Some(Gated(deadline)))
|
reg.writableEndpointWithPolicyFor(address1) should be(Some(Gated(deadline)))
|
||||||
reg.writableEndpointWithPolicyFor(address2) should equal(Some(Quarantined(42, deadline)))
|
reg.writableEndpointWithPolicyFor(address2) should be(Some(Quarantined(42, deadline)))
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -109,19 +109,19 @@ class EndpointRegistrySpec extends AkkaSpec {
|
||||||
reg.markAsFailed(actorB, farInTheFuture)
|
reg.markAsFailed(actorB, farInTheFuture)
|
||||||
reg.prune()
|
reg.prune()
|
||||||
|
|
||||||
reg.writableEndpointWithPolicyFor(address1) should equal(None)
|
reg.writableEndpointWithPolicyFor(address1) should be(None)
|
||||||
reg.writableEndpointWithPolicyFor(address2) should equal(Some(Gated(farInTheFuture)))
|
reg.writableEndpointWithPolicyFor(address2) should be(Some(Gated(farInTheFuture)))
|
||||||
}
|
}
|
||||||
|
|
||||||
"be able to register Quarantined policy for an address" in {
|
"be able to register Quarantined policy for an address" in {
|
||||||
val reg = new EndpointRegistry
|
val reg = new EndpointRegistry
|
||||||
val deadline = Deadline.now + 30.minutes
|
val deadline = Deadline.now + 30.minutes
|
||||||
|
|
||||||
reg.writableEndpointWithPolicyFor(address1) should equal(None)
|
reg.writableEndpointWithPolicyFor(address1) should be(None)
|
||||||
reg.markAsQuarantined(address1, 42, deadline)
|
reg.markAsQuarantined(address1, 42, deadline)
|
||||||
reg.isQuarantined(address1, 42) should be(true)
|
reg.isQuarantined(address1, 42) should be(true)
|
||||||
reg.isQuarantined(address1, 33) should be(false)
|
reg.isQuarantined(address1, 33) should be(false)
|
||||||
reg.writableEndpointWithPolicyFor(address1) should equal(Some(Quarantined(42, deadline)))
|
reg.writableEndpointWithPolicyFor(address1) should be(Some(Quarantined(42, deadline)))
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,7 @@ class RemoteConfigSpec extends AkkaSpec(
|
||||||
FlushWait should be(2 seconds)
|
FlushWait should be(2 seconds)
|
||||||
StartupTimeout.duration should be(10 seconds)
|
StartupTimeout.duration should be(10 seconds)
|
||||||
RetryGateClosedFor should be(5 seconds)
|
RetryGateClosedFor should be(5 seconds)
|
||||||
Dispatcher should equal("akka.remote.default-remote-dispatcher")
|
Dispatcher should be("akka.remote.default-remote-dispatcher")
|
||||||
UsePassiveConnections should be(true)
|
UsePassiveConnections should be(true)
|
||||||
BackoffPeriod should be(10 millis)
|
BackoffPeriod should be(10 millis)
|
||||||
SysMsgAckTimeout should be(0.3 seconds)
|
SysMsgAckTimeout should be(0.3 seconds)
|
||||||
|
|
@ -66,10 +66,10 @@ class RemoteConfigSpec extends AkkaSpec(
|
||||||
import settings._
|
import settings._
|
||||||
|
|
||||||
RequireCookie should be(false)
|
RequireCookie should be(false)
|
||||||
SecureCookie should equal(None)
|
SecureCookie should be(None)
|
||||||
|
|
||||||
TransportFailureDetectorImplementationClass should be(classOf[PhiAccrualFailureDetector].getName)
|
TransportFailureDetectorImplementationClass should be(classOf[PhiAccrualFailureDetector].getName)
|
||||||
TransportHeartBeatInterval should equal(4.seconds)
|
TransportHeartBeatInterval should be(4.seconds)
|
||||||
TransportFailureDetectorConfig.getDouble("threshold") should be(7.0 +- 0.0001)
|
TransportFailureDetectorConfig.getDouble("threshold") should be(7.0 +- 0.0001)
|
||||||
TransportFailureDetectorConfig.getInt("max-sample-size") should be(100)
|
TransportFailureDetectorConfig.getInt("max-sample-size") should be(100)
|
||||||
TransportFailureDetectorConfig.getMillisDuration("acceptable-heartbeat-pause") should be(10 seconds)
|
TransportFailureDetectorConfig.getMillisDuration("acceptable-heartbeat-pause") should be(10 seconds)
|
||||||
|
|
@ -82,19 +82,19 @@ class RemoteConfigSpec extends AkkaSpec(
|
||||||
val s = new NettyTransportSettings(c)
|
val s = new NettyTransportSettings(c)
|
||||||
import s._
|
import s._
|
||||||
|
|
||||||
ConnectionTimeout should equal(15.seconds)
|
ConnectionTimeout should be(15.seconds)
|
||||||
WriteBufferHighWaterMark should equal(None)
|
WriteBufferHighWaterMark should be(None)
|
||||||
WriteBufferLowWaterMark should equal(None)
|
WriteBufferLowWaterMark should be(None)
|
||||||
SendBufferSize should equal(Some(256000))
|
SendBufferSize should be(Some(256000))
|
||||||
ReceiveBufferSize should equal(Some(256000))
|
ReceiveBufferSize should be(Some(256000))
|
||||||
MaxFrameSize should equal(128000)
|
MaxFrameSize should be(128000)
|
||||||
Backlog should equal(4096)
|
Backlog should be(4096)
|
||||||
TcpNodelay should be(true)
|
TcpNodelay should be(true)
|
||||||
TcpKeepalive should be(true)
|
TcpKeepalive should be(true)
|
||||||
TcpReuseAddr should be(!Helpers.isWindows)
|
TcpReuseAddr should be(!Helpers.isWindows)
|
||||||
c.getString("hostname") should equal("")
|
c.getString("hostname") should be("")
|
||||||
ServerSocketWorkerPoolSize should equal(2)
|
ServerSocketWorkerPoolSize should be(2)
|
||||||
ClientSocketWorkerPoolSize should equal(2)
|
ClientSocketWorkerPoolSize should be(2)
|
||||||
}
|
}
|
||||||
|
|
||||||
"contain correct socket worker pool configuration values in reference.conf" in {
|
"contain correct socket worker pool configuration values in reference.conf" in {
|
||||||
|
|
@ -103,18 +103,18 @@ class RemoteConfigSpec extends AkkaSpec(
|
||||||
// server-socket-worker-pool
|
// server-socket-worker-pool
|
||||||
{
|
{
|
||||||
val pool = c.getConfig("server-socket-worker-pool")
|
val pool = c.getConfig("server-socket-worker-pool")
|
||||||
pool.getInt("pool-size-min") should equal(2)
|
pool.getInt("pool-size-min") should be(2)
|
||||||
|
|
||||||
pool.getDouble("pool-size-factor") should equal(1.0)
|
pool.getDouble("pool-size-factor") should be(1.0)
|
||||||
pool.getInt("pool-size-max") should equal(2)
|
pool.getInt("pool-size-max") should be(2)
|
||||||
}
|
}
|
||||||
|
|
||||||
// client-socket-worker-pool
|
// client-socket-worker-pool
|
||||||
{
|
{
|
||||||
val pool = c.getConfig("client-socket-worker-pool")
|
val pool = c.getConfig("client-socket-worker-pool")
|
||||||
pool.getInt("pool-size-min") should equal(2)
|
pool.getInt("pool-size-min") should be(2)
|
||||||
pool.getDouble("pool-size-factor") should equal(1.0)
|
pool.getDouble("pool-size-factor") should be(1.0)
|
||||||
pool.getInt("pool-size-max") should equal(2)
|
pool.getInt("pool-size-max") should be(2)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -50,7 +50,7 @@ class RemoteDeployerSpec extends AkkaSpec(RemoteDeployerSpec.deployerConf) {
|
||||||
"reject remote deployment when the source requires LocalScope" in {
|
"reject remote deployment when the source requires LocalScope" in {
|
||||||
intercept[ConfigurationException] {
|
intercept[ConfigurationException] {
|
||||||
system.actorOf(Props.empty.withDeploy(Deploy.local), "service2")
|
system.actorOf(Props.empty.withDeploy(Deploy.local), "service2")
|
||||||
}.getMessage should equal("configuration requested remote deployment for local-only Props at [akka://RemoteDeployerSpec/user/service2]")
|
}.getMessage should be("configuration requested remote deployment for local-only Props at [akka://RemoteDeployerSpec/user/service2]")
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -88,7 +88,7 @@ class RemoteRouterSpec extends AkkaSpec("""
|
||||||
val children = replies.toSet
|
val children = replies.toSet
|
||||||
children should have size 2
|
children should have size 2
|
||||||
children.map(_.parent) should have size 1
|
children.map(_.parent) should have size 1
|
||||||
children foreach (_.address.toString should equal(s"akka.tcp://${sysName}@localhost:${port}"))
|
children foreach (_.address.toString should be(s"akka.tcp://${sysName}@localhost:${port}"))
|
||||||
masterSystem.stop(router)
|
masterSystem.stop(router)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -103,7 +103,7 @@ class RemoteRouterSpec extends AkkaSpec("""
|
||||||
val children = replies.toSet
|
val children = replies.toSet
|
||||||
children should have size 2
|
children should have size 2
|
||||||
children.map(_.parent) should have size 1
|
children.map(_.parent) should have size 1
|
||||||
children foreach (_.address.toString should equal(s"akka.tcp://${sysName}@localhost:${port}"))
|
children foreach (_.address.toString should be(s"akka.tcp://${sysName}@localhost:${port}"))
|
||||||
masterSystem.stop(router)
|
masterSystem.stop(router)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -117,7 +117,7 @@ class RemoteRouterSpec extends AkkaSpec("""
|
||||||
val children = replies.toSet
|
val children = replies.toSet
|
||||||
children.size should be >= 2
|
children.size should be >= 2
|
||||||
children.map(_.parent) should have size 1
|
children.map(_.parent) should have size 1
|
||||||
children foreach (_.address.toString should equal(s"akka.tcp://${sysName}@localhost:${port}"))
|
children foreach (_.address.toString should be(s"akka.tcp://${sysName}@localhost:${port}"))
|
||||||
masterSystem.stop(router)
|
masterSystem.stop(router)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -134,7 +134,7 @@ class RemoteRouterSpec extends AkkaSpec("""
|
||||||
val parents = children.map(_.parent)
|
val parents = children.map(_.parent)
|
||||||
parents should have size 1
|
parents should have size 1
|
||||||
parents.head should be(router.path)
|
parents.head should be(router.path)
|
||||||
children foreach (_.address.toString should equal(s"akka.tcp://${sysName}@localhost:${port}"))
|
children foreach (_.address.toString should be(s"akka.tcp://${sysName}@localhost:${port}"))
|
||||||
masterSystem.stop(router)
|
masterSystem.stop(router)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -152,7 +152,7 @@ class RemoteRouterSpec extends AkkaSpec("""
|
||||||
val parents = children.map(_.parent)
|
val parents = children.map(_.parent)
|
||||||
parents should have size 1
|
parents should have size 1
|
||||||
parents.head should be(router.path)
|
parents.head should be(router.path)
|
||||||
children foreach (_.address.toString should equal(s"akka.tcp://${sysName}@localhost:${port}"))
|
children foreach (_.address.toString should be(s"akka.tcp://${sysName}@localhost:${port}"))
|
||||||
masterSystem.stop(router)
|
masterSystem.stop(router)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -170,7 +170,7 @@ class RemoteRouterSpec extends AkkaSpec("""
|
||||||
val parents = children.map(_.parent)
|
val parents = children.map(_.parent)
|
||||||
parents should have size 1
|
parents should have size 1
|
||||||
parents.head.address should be(Address("akka.tcp", sysName, "localhost", port))
|
parents.head.address should be(Address("akka.tcp", sysName, "localhost", port))
|
||||||
children foreach (_.address.toString should equal(s"akka.tcp://${sysName}@localhost:${port}"))
|
children foreach (_.address.toString should be(s"akka.tcp://${sysName}@localhost:${port}"))
|
||||||
masterSystem.stop(router)
|
masterSystem.stop(router)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -188,7 +188,7 @@ class RemoteRouterSpec extends AkkaSpec("""
|
||||||
val parents = children.map(_.parent)
|
val parents = children.map(_.parent)
|
||||||
parents should have size 1
|
parents should have size 1
|
||||||
parents.head should be(router.path)
|
parents.head should be(router.path)
|
||||||
children foreach (_.address.toString should equal(s"akka.tcp://${sysName}@localhost:${port}"))
|
children foreach (_.address.toString should be(s"akka.tcp://${sysName}@localhost:${port}"))
|
||||||
masterSystem.stop(router)
|
masterSystem.stop(router)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -206,7 +206,7 @@ class RemoteRouterSpec extends AkkaSpec("""
|
||||||
val parents = children.map(_.parent)
|
val parents = children.map(_.parent)
|
||||||
parents should have size 1
|
parents should have size 1
|
||||||
parents.head should be(router.path)
|
parents.head should be(router.path)
|
||||||
children foreach (_.address.toString should equal(s"akka.tcp://${sysName}@localhost:${port}"))
|
children foreach (_.address.toString should be(s"akka.tcp://${sysName}@localhost:${port}"))
|
||||||
masterSystem.stop(router)
|
masterSystem.stop(router)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -265,7 +265,7 @@ class RemotingSpec extends AkkaSpec(RemotingSpec.cfg) with ImplicitSender with D
|
||||||
|
|
||||||
"create and supervise children on remote node" in {
|
"create and supervise children on remote node" in {
|
||||||
val r = system.actorOf(Props[Echo1], "blub")
|
val r = system.actorOf(Props[Echo1], "blub")
|
||||||
r.path.toString should equal("akka.test://remote-sys@localhost:12346/remote/akka.test/RemotingSpec@localhost:12345/user/blub")
|
r.path.toString should be("akka.test://remote-sys@localhost:12346/remote/akka.test/RemotingSpec@localhost:12345/user/blub")
|
||||||
r ! 42
|
r ! 42
|
||||||
expectMsg(42)
|
expectMsg(42)
|
||||||
EventFilter[Exception]("crash", occurrences = 1).intercept {
|
EventFilter[Exception]("crash", occurrences = 1).intercept {
|
||||||
|
|
@ -374,9 +374,9 @@ class RemotingSpec extends AkkaSpec(RemotingSpec.cfg) with ImplicitSender with D
|
||||||
lastSender should be theSameInstanceAs grandchild
|
lastSender should be theSameInstanceAs grandchild
|
||||||
mysel ! Identify(mysel)
|
mysel ! Identify(mysel)
|
||||||
val grandchild2 = expectMsgType[ActorIdentity].ref
|
val grandchild2 = expectMsgType[ActorIdentity].ref
|
||||||
grandchild2 should equal(Some(grandchild))
|
grandchild2 should be(Some(grandchild))
|
||||||
system.actorSelection("/user/looker2/child") ! Identify(None)
|
system.actorSelection("/user/looker2/child") ! Identify(None)
|
||||||
expectMsgType[ActorIdentity].ref should equal(Some(child))
|
expectMsgType[ActorIdentity].ref should be(Some(child))
|
||||||
l ! ActorSelReq("child/..")
|
l ! ActorSelReq("child/..")
|
||||||
expectMsgType[ActorSelection] ! Identify(None)
|
expectMsgType[ActorSelection] ! Identify(None)
|
||||||
expectMsgType[ActorIdentity].ref.get should be theSameInstanceAs l
|
expectMsgType[ActorIdentity].ref.get should be theSameInstanceAs l
|
||||||
|
|
@ -421,7 +421,7 @@ class RemotingSpec extends AkkaSpec(RemotingSpec.cfg) with ImplicitSender with D
|
||||||
watch(child)
|
watch(child)
|
||||||
child ! PoisonPill
|
child ! PoisonPill
|
||||||
expectMsg("postStop")
|
expectMsg("postStop")
|
||||||
expectMsgType[Terminated].actor should equal(child)
|
expectMsgType[Terminated].actor should be(child)
|
||||||
l ! ((Props[Echo1], "child"))
|
l ! ((Props[Echo1], "child"))
|
||||||
val child2 = expectMsgType[ActorRef]
|
val child2 = expectMsgType[ActorRef]
|
||||||
child2 ! Identify("idReq15")
|
child2 ! Identify("idReq15")
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ import akka.testkit.AkkaSpec
|
||||||
class SerializeCreatorsVerificationSpec extends AkkaSpec {
|
class SerializeCreatorsVerificationSpec extends AkkaSpec {
|
||||||
|
|
||||||
"serialize-creators should be on" in {
|
"serialize-creators should be on" in {
|
||||||
system.settings.SerializeAllCreators should equal(true)
|
system.settings.SerializeAllCreators should be(true)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -89,7 +89,7 @@ class RemoteRouterSpec extends AkkaSpec("""
|
||||||
val children = replies.toSet
|
val children = replies.toSet
|
||||||
children should have size 2
|
children should have size 2
|
||||||
children.map(_.parent) should have size 1
|
children.map(_.parent) should have size 1
|
||||||
children foreach (_.address.toString should equal(s"akka.tcp://${sysName}@localhost:${port}"))
|
children foreach (_.address.toString should be(s"akka.tcp://${sysName}@localhost:${port}"))
|
||||||
masterSystem.stop(router)
|
masterSystem.stop(router)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -104,7 +104,7 @@ class RemoteRouterSpec extends AkkaSpec("""
|
||||||
val children = replies.toSet
|
val children = replies.toSet
|
||||||
children should have size 2
|
children should have size 2
|
||||||
children.map(_.parent) should have size 1
|
children.map(_.parent) should have size 1
|
||||||
children foreach (_.address.toString should equal(s"akka.tcp://${sysName}@localhost:${port}"))
|
children foreach (_.address.toString should be(s"akka.tcp://${sysName}@localhost:${port}"))
|
||||||
masterSystem.stop(router)
|
masterSystem.stop(router)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -118,7 +118,7 @@ class RemoteRouterSpec extends AkkaSpec("""
|
||||||
val children = replies.toSet
|
val children = replies.toSet
|
||||||
children.size should be >= 2
|
children.size should be >= 2
|
||||||
children.map(_.parent) should have size 1
|
children.map(_.parent) should have size 1
|
||||||
children foreach (_.address.toString should equal(s"akka.tcp://${sysName}@localhost:${port}"))
|
children foreach (_.address.toString should be(s"akka.tcp://${sysName}@localhost:${port}"))
|
||||||
masterSystem.stop(router)
|
masterSystem.stop(router)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -135,7 +135,7 @@ class RemoteRouterSpec extends AkkaSpec("""
|
||||||
val parents = children.map(_.parent)
|
val parents = children.map(_.parent)
|
||||||
parents should have size 1
|
parents should have size 1
|
||||||
parents.head should be(router.path)
|
parents.head should be(router.path)
|
||||||
children foreach (_.address.toString should equal(s"akka.tcp://${sysName}@localhost:${port}"))
|
children foreach (_.address.toString should be(s"akka.tcp://${sysName}@localhost:${port}"))
|
||||||
masterSystem.stop(router)
|
masterSystem.stop(router)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -153,7 +153,7 @@ class RemoteRouterSpec extends AkkaSpec("""
|
||||||
val parents = children.map(_.parent)
|
val parents = children.map(_.parent)
|
||||||
parents should have size 1
|
parents should have size 1
|
||||||
parents.head should be(router.path)
|
parents.head should be(router.path)
|
||||||
children foreach (_.address.toString should equal(s"akka.tcp://${sysName}@localhost:${port}"))
|
children foreach (_.address.toString should be(s"akka.tcp://${sysName}@localhost:${port}"))
|
||||||
masterSystem.stop(router)
|
masterSystem.stop(router)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -171,7 +171,7 @@ class RemoteRouterSpec extends AkkaSpec("""
|
||||||
val parents = children.map(_.parent)
|
val parents = children.map(_.parent)
|
||||||
parents should have size 1
|
parents should have size 1
|
||||||
parents.head.address should be(Address("akka.tcp", sysName, "localhost", port))
|
parents.head.address should be(Address("akka.tcp", sysName, "localhost", port))
|
||||||
children foreach (_.address.toString should equal(s"akka.tcp://${sysName}@localhost:${port}"))
|
children foreach (_.address.toString should be(s"akka.tcp://${sysName}@localhost:${port}"))
|
||||||
masterSystem.stop(router)
|
masterSystem.stop(router)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -189,7 +189,7 @@ class RemoteRouterSpec extends AkkaSpec("""
|
||||||
val parents = children.map(_.parent)
|
val parents = children.map(_.parent)
|
||||||
parents should have size 1
|
parents should have size 1
|
||||||
parents.head should be(router.path)
|
parents.head should be(router.path)
|
||||||
children foreach (_.address.toString should equal(s"akka.tcp://${sysName}@localhost:${port}"))
|
children foreach (_.address.toString should be(s"akka.tcp://${sysName}@localhost:${port}"))
|
||||||
masterSystem.stop(router)
|
masterSystem.stop(router)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -207,7 +207,7 @@ class RemoteRouterSpec extends AkkaSpec("""
|
||||||
val parents = children.map(_.parent)
|
val parents = children.map(_.parent)
|
||||||
parents should have size 1
|
parents should have size 1
|
||||||
parents.head should be(router.path)
|
parents.head should be(router.path)
|
||||||
children foreach (_.address.toString should equal(s"akka.tcp://${sysName}@localhost:${port}"))
|
children foreach (_.address.toString should be(s"akka.tcp://${sysName}@localhost:${port}"))
|
||||||
masterSystem.stop(router)
|
masterSystem.stop(router)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -152,7 +152,7 @@ class AkkaProtocolSpec extends AkkaSpec("""akka.actor.provider = "akka.remote.Re
|
||||||
|
|
||||||
val wrappedHandle = expectMsgPF() {
|
val wrappedHandle = expectMsgPF() {
|
||||||
case InboundAssociation(h: AkkaProtocolHandle) ⇒
|
case InboundAssociation(h: AkkaProtocolHandle) ⇒
|
||||||
h.handshakeInfo.uid should equal(33)
|
h.handshakeInfo.uid should be(33)
|
||||||
h
|
h
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -166,7 +166,7 @@ class AkkaProtocolSpec extends AkkaSpec("""akka.actor.provider = "akka.remote.Re
|
||||||
reader ! testPayload
|
reader ! testPayload
|
||||||
|
|
||||||
expectMsgPF() {
|
expectMsgPF() {
|
||||||
case InboundPayload(p) ⇒ p should equal(testEnvelope)
|
case InboundPayload(p) ⇒ p should be(testEnvelope)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -222,9 +222,9 @@ class AkkaProtocolSpec extends AkkaSpec("""akka.actor.provider = "akka.remote.Re
|
||||||
|
|
||||||
Await.result(statusPromise.future, 3.seconds) match {
|
Await.result(statusPromise.future, 3.seconds) match {
|
||||||
case h: AkkaProtocolHandle ⇒
|
case h: AkkaProtocolHandle ⇒
|
||||||
h.remoteAddress should equal(remoteAkkaAddress)
|
h.remoteAddress should be(remoteAkkaAddress)
|
||||||
h.localAddress should equal(localAkkaAddress)
|
h.localAddress should be(localAkkaAddress)
|
||||||
h.handshakeInfo.uid should equal(33)
|
h.handshakeInfo.uid should be(33)
|
||||||
|
|
||||||
case _ ⇒ fail()
|
case _ ⇒ fail()
|
||||||
}
|
}
|
||||||
|
|
@ -266,8 +266,8 @@ class AkkaProtocolSpec extends AkkaSpec("""akka.actor.provider = "akka.remote.Re
|
||||||
|
|
||||||
val wrappedHandle = expectMsgPF() {
|
val wrappedHandle = expectMsgPF() {
|
||||||
case InboundAssociation(h: AkkaProtocolHandle) ⇒
|
case InboundAssociation(h: AkkaProtocolHandle) ⇒
|
||||||
h.handshakeInfo.uid should equal(33)
|
h.handshakeInfo.uid should be(33)
|
||||||
h.handshakeInfo.cookie should equal(Some("abcde"))
|
h.handshakeInfo.cookie should be(Some("abcde"))
|
||||||
h
|
h
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -320,8 +320,8 @@ class AkkaProtocolSpec extends AkkaSpec("""akka.actor.provider = "akka.remote.Re
|
||||||
|
|
||||||
val wrappedHandle = Await.result(statusPromise.future, 3.seconds) match {
|
val wrappedHandle = Await.result(statusPromise.future, 3.seconds) match {
|
||||||
case h: AssociationHandle ⇒
|
case h: AssociationHandle ⇒
|
||||||
h.remoteAddress should equal(remoteAkkaAddress)
|
h.remoteAddress should be(remoteAkkaAddress)
|
||||||
h.localAddress should equal(localAkkaAddress)
|
h.localAddress should be(localAkkaAddress)
|
||||||
h
|
h
|
||||||
|
|
||||||
case _ ⇒ fail()
|
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 {
|
val wrappedHandle = Await.result(statusPromise.future, 3.seconds) match {
|
||||||
case h: AssociationHandle ⇒
|
case h: AssociationHandle ⇒
|
||||||
h.remoteAddress should equal(remoteAkkaAddress)
|
h.remoteAddress should be(remoteAkkaAddress)
|
||||||
h.localAddress should equal(localAkkaAddress)
|
h.localAddress should be(localAkkaAddress)
|
||||||
h
|
h
|
||||||
|
|
||||||
case _ ⇒ fail()
|
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 {
|
val wrappedHandle = Await.result(statusPromise.future, 3.seconds) match {
|
||||||
case h: AssociationHandle ⇒
|
case h: AssociationHandle ⇒
|
||||||
h.remoteAddress should equal(remoteAkkaAddress)
|
h.remoteAddress should be(remoteAkkaAddress)
|
||||||
h.localAddress should equal(localAkkaAddress)
|
h.localAddress should be(localAkkaAddress)
|
||||||
h
|
h
|
||||||
|
|
||||||
case _ ⇒ fail()
|
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 {
|
val wrappedHandle = Await.result(statusPromise.future, 3.seconds) match {
|
||||||
case h: AssociationHandle ⇒
|
case h: AssociationHandle ⇒
|
||||||
h.remoteAddress should equal(remoteAkkaAddress)
|
h.remoteAddress should be(remoteAkkaAddress)
|
||||||
h.localAddress should equal(localAkkaAddress)
|
h.localAddress should be(localAkkaAddress)
|
||||||
h
|
h
|
||||||
|
|
||||||
case _ ⇒ fail()
|
case _ ⇒ fail()
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@ class SwitchableLoggedBehaviorSpec extends AkkaSpec with DefaultTimeout {
|
||||||
"execute default behavior" in {
|
"execute default behavior" in {
|
||||||
val behavior = defaultBehavior
|
val behavior = defaultBehavior
|
||||||
|
|
||||||
Await.result(behavior(()), timeout.duration) should equal(3)
|
Await.result(behavior(()), timeout.duration) should be(3)
|
||||||
}
|
}
|
||||||
|
|
||||||
"be able to push generic behavior" in {
|
"be able to push generic behavior" in {
|
||||||
|
|
|
||||||
|
|
@ -126,7 +126,7 @@ abstract class SystemMessageDeliveryStressTest(msg: String, cfg: String)
|
||||||
val toSend = (0 until MsgCount).toList
|
val toSend = (0 until MsgCount).toList
|
||||||
val received = expectMsgAllOf(45.seconds, toSend: _*)
|
val received = expectMsgAllOf(45.seconds, toSend: _*)
|
||||||
|
|
||||||
received should equal(toSend)
|
received should be(toSend)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -88,7 +88,7 @@ class AkkaSpecSpec extends WordSpec with Matchers {
|
||||||
system.registerOnTermination(latch.countDown())
|
system.registerOnTermination(latch.countDown())
|
||||||
TestKit.shutdownActorSystem(system)
|
TestKit.shutdownActorSystem(system)
|
||||||
Await.ready(latch, 2 seconds)
|
Await.ready(latch, 2 seconds)
|
||||||
Await.result(davyJones ? "Die!", timeout.duration) should equal("finally gone")
|
Await.result(davyJones ? "Die!", timeout.duration) should be("finally gone")
|
||||||
|
|
||||||
// this will typically also contain log messages which were sent after the logger shutdown
|
// this will typically also contain log messages which were sent after the logger shutdown
|
||||||
locker should contain(DeadLetter(42, davyJones, probe.ref))
|
locker should contain(DeadLetter(42, davyJones, probe.ref))
|
||||||
|
|
|
||||||
|
|
@ -39,10 +39,10 @@ class JavaTestKitSpec extends AkkaSpec with DefaultTimeout {
|
||||||
|
|
||||||
watch(actor)
|
watch(actor)
|
||||||
system stop actor
|
system stop actor
|
||||||
expectTerminated(actor).existenceConfirmed should equal(true)
|
expectTerminated(actor).existenceConfirmed should be(true)
|
||||||
|
|
||||||
watch(actor)
|
watch(actor)
|
||||||
expectTerminated(5 seconds, actor).actor should equal(actor)
|
expectTerminated(5 seconds, actor).actor should be(actor)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -214,7 +214,7 @@ class TestActorRefSpec extends AkkaSpec("disp1.type=Dispatcher") with BeforeAndA
|
||||||
val f = a ? "work"
|
val f = a ? "work"
|
||||||
// CallingThreadDispatcher means that there is no delay
|
// CallingThreadDispatcher means that there is no delay
|
||||||
f should be('completed)
|
f should be('completed)
|
||||||
Await.result(f, timeout.duration) should equal("workDone")
|
Await.result(f, timeout.duration) should be("workDone")
|
||||||
}
|
}
|
||||||
|
|
||||||
"support receive timeout" in {
|
"support receive timeout" in {
|
||||||
|
|
@ -235,7 +235,7 @@ class TestActorRefSpec extends AkkaSpec("disp1.type=Dispatcher") with BeforeAndA
|
||||||
})
|
})
|
||||||
ref ! "hallo"
|
ref ! "hallo"
|
||||||
val actor = ref.underlyingActor
|
val actor = ref.underlyingActor
|
||||||
actor.s should equal("hallo")
|
actor.s should be("hallo")
|
||||||
}
|
}
|
||||||
|
|
||||||
"set receiveTimeout to None" in {
|
"set receiveTimeout to None" in {
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@ class TestProbeSpec extends AkkaSpec with DefaultTimeout {
|
||||||
tk.expectMsg(0 millis, "hello") // TestActor runs on CallingThreadDispatcher
|
tk.expectMsg(0 millis, "hello") // TestActor runs on CallingThreadDispatcher
|
||||||
tk.lastMessage.sender ! "world"
|
tk.lastMessage.sender ! "world"
|
||||||
future should be('completed)
|
future should be('completed)
|
||||||
Await.result(future, timeout.duration) should equal("world")
|
Await.result(future, timeout.duration) should be("world")
|
||||||
}
|
}
|
||||||
|
|
||||||
"reply to messages" in {
|
"reply to messages" in {
|
||||||
|
|
|
||||||
|
|
@ -86,7 +86,7 @@ class CoordinatedIncrementSpec extends AkkaSpec(CoordinatedIncrement.config) wit
|
||||||
counters(0) ! coordinated(Increment(counters.tail))
|
counters(0) ! coordinated(Increment(counters.tail))
|
||||||
coordinated.await
|
coordinated.await
|
||||||
for (counter ← counters) {
|
for (counter ← counters) {
|
||||||
Await.result((counter ? GetCount).mapTo[Int], remaining) should equal(1)
|
Await.result((counter ? GetCount).mapTo[Int], remaining) should be(1)
|
||||||
}
|
}
|
||||||
counters foreach (system.stop(_))
|
counters foreach (system.stop(_))
|
||||||
system.stop(failer)
|
system.stop(failer)
|
||||||
|
|
@ -103,7 +103,7 @@ class CoordinatedIncrementSpec extends AkkaSpec(CoordinatedIncrement.config) wit
|
||||||
counters(0) ! Coordinated(Increment(counters.tail :+ failer))
|
counters(0) ! Coordinated(Increment(counters.tail :+ failer))
|
||||||
coordinated.await
|
coordinated.await
|
||||||
for (counter ← counters) {
|
for (counter ← counters) {
|
||||||
Await.result(counter ? GetCount, remaining) should equal(0)
|
Await.result(counter ? GetCount, remaining) should be(0)
|
||||||
}
|
}
|
||||||
counters foreach (system.stop(_))
|
counters foreach (system.stop(_))
|
||||||
system.stop(failer)
|
system.stop(failer)
|
||||||
|
|
|
||||||
|
|
@ -130,9 +130,9 @@ class FickleFriendsSpec extends AkkaSpec with BeforeAndAfterAll {
|
||||||
val latch = new CountDownLatch(1)
|
val latch = new CountDownLatch(1)
|
||||||
coordinator ! FriendlyIncrement(counters, timeout, latch)
|
coordinator ! FriendlyIncrement(counters, timeout, latch)
|
||||||
latch.await // this could take a while
|
latch.await // this could take a while
|
||||||
Await.result(coordinator ? GetCount, timeout.duration) should equal(1)
|
Await.result(coordinator ? GetCount, timeout.duration) should be(1)
|
||||||
for (counter ← counters) {
|
for (counter ← counters) {
|
||||||
Await.result(counter ? GetCount, timeout.duration) should equal(1)
|
Await.result(counter ? GetCount, timeout.duration) should be(1)
|
||||||
}
|
}
|
||||||
counters foreach (system.stop(_))
|
counters foreach (system.stop(_))
|
||||||
system.stop(coordinator)
|
system.stop(coordinator)
|
||||||
|
|
|
||||||
|
|
@ -98,7 +98,7 @@ class TransactorSpec extends AkkaSpec {
|
||||||
counters(0) ! Increment(counters.tail, incrementLatch)
|
counters(0) ! Increment(counters.tail, incrementLatch)
|
||||||
Await.ready(incrementLatch, 5 seconds)
|
Await.ready(incrementLatch, 5 seconds)
|
||||||
for (counter ← counters) {
|
for (counter ← counters) {
|
||||||
Await.result(counter ? GetCount, timeout.duration) should equal(1)
|
Await.result(counter ? GetCount, timeout.duration) should be(1)
|
||||||
}
|
}
|
||||||
counters foreach (system.stop(_))
|
counters foreach (system.stop(_))
|
||||||
system.stop(failer)
|
system.stop(failer)
|
||||||
|
|
@ -115,7 +115,7 @@ class TransactorSpec extends AkkaSpec {
|
||||||
counters(0) ! Increment(counters.tail :+ failer, failLatch)
|
counters(0) ! Increment(counters.tail :+ failer, failLatch)
|
||||||
Await.ready(failLatch, 5 seconds)
|
Await.ready(failLatch, 5 seconds)
|
||||||
for (counter ← counters) {
|
for (counter ← counters) {
|
||||||
Await.result(counter ? GetCount, timeout.duration) should equal(0)
|
Await.result(counter ? GetCount, timeout.duration) should be(0)
|
||||||
}
|
}
|
||||||
counters foreach (system.stop(_))
|
counters foreach (system.stop(_))
|
||||||
system.stop(failer)
|
system.stop(failer)
|
||||||
|
|
@ -131,7 +131,7 @@ class TransactorSpec extends AkkaSpec {
|
||||||
transactor ! Set(ref, 5, latch)
|
transactor ! Set(ref, 5, latch)
|
||||||
Await.ready(latch, 5 seconds)
|
Await.ready(latch, 5 seconds)
|
||||||
val value = ref.single.get
|
val value = ref.single.get
|
||||||
value should equal(5)
|
value should be(5)
|
||||||
system.stop(transactor)
|
system.stop(transactor)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -70,14 +70,14 @@ class ConcurrentSocketActorSpec extends AkkaSpec {
|
||||||
msg
|
msg
|
||||||
}.map(m ⇒ m.frames(0).utf8String.toInt)
|
}.map(m ⇒ m.frames(0).utf8String.toInt)
|
||||||
msgNumbers.length should be > 0
|
msgNumbers.length should be > 0
|
||||||
msgNumbers should equal(for (i ← msgNumbers.head to msgNumbers.last) yield i)
|
msgNumbers should be(for (i ← msgNumbers.head to msgNumbers.last) yield i)
|
||||||
} finally {
|
} finally {
|
||||||
msgGenerator.cancel()
|
msgGenerator.cancel()
|
||||||
watch(subscriber)
|
watch(subscriber)
|
||||||
system stop subscriber
|
system stop subscriber
|
||||||
subscriberProbe.receiveWhile(3 seconds) {
|
subscriberProbe.receiveWhile(3 seconds) {
|
||||||
case msg ⇒ msg
|
case msg ⇒ msg
|
||||||
}.last should equal(Closed)
|
}.last should be(Closed)
|
||||||
expectTerminated(subscriber, 5.seconds)
|
expectTerminated(subscriber, 5.seconds)
|
||||||
watch(publisher)
|
watch(publisher)
|
||||||
system stop publisher
|
system stop publisher
|
||||||
|
|
|
||||||
|
|
@ -154,7 +154,12 @@ object AkkaBuild extends Build {
|
||||||
)
|
)
|
||||||
|
|
||||||
val cpsPlugin = Seq(
|
val cpsPlugin = Seq(
|
||||||
libraryDependencies <+= scalaVersion { v => compilerPlugin("org.scala-lang.plugins" % "continuations" % v) },
|
libraryDependencies <++= scalaVersion { v =>
|
||||||
|
if (v.startsWith("2.10.")) Seq(compilerPlugin("org.scala-lang.plugins" % "continuations" % v))
|
||||||
|
else Seq(
|
||||||
|
compilerPlugin("org.scala-lang.plugins" %% "scala-continuations-plugin" % Dependencies.Versions.scalaContinuationsVersion),
|
||||||
|
"org.scala-lang.plugins" %% "scala-continuations-library" % Dependencies.Versions.scalaContinuationsVersion)
|
||||||
|
},
|
||||||
scalacOptions += "-P:continuations:enable"
|
scalacOptions += "-P:continuations:enable"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -1110,6 +1115,7 @@ object Dependencies {
|
||||||
val genJavaDocVersion = System.getProperty("akka.build.genJavaDocVersion", "0.5")
|
val genJavaDocVersion = System.getProperty("akka.build.genJavaDocVersion", "0.5")
|
||||||
val scalaTestVersion = System.getProperty("akka.build.scalaTestVersion", "2.0")
|
val scalaTestVersion = System.getProperty("akka.build.scalaTestVersion", "2.0")
|
||||||
val scalaCheckVersion = System.getProperty("akka.build.scalaCheckVersion", "1.10.1")
|
val scalaCheckVersion = System.getProperty("akka.build.scalaCheckVersion", "1.10.1")
|
||||||
|
val scalaContinuationsVersion = System.getProperty("akka.build.scalaContinuationsVersion", "1.0.0-RC3")
|
||||||
}
|
}
|
||||||
|
|
||||||
object Compile {
|
object Compile {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue