properly fix the port==0 issue and use it in more tests
- add documentation to RemoteTransport interface what is expected wrt. address’ availability before, during and after start()
This commit is contained in:
parent
ac1ee9ae91
commit
4482f14650
6 changed files with 55 additions and 24 deletions
|
|
@ -22,13 +22,13 @@ akka {
|
|||
actor.provider = "akka.remote.RemoteActorRefProvider"
|
||||
remote.netty {
|
||||
hostname = localhost
|
||||
port = 12345
|
||||
port = 0
|
||||
}
|
||||
actor.deployment {
|
||||
/blub {
|
||||
router = round-robin
|
||||
nr-of-instances = 2
|
||||
target.nodes = ["akka://remote_sys@localhost:12346"]
|
||||
target.nodes = ["akka://remote_sys@localhost:12347"]
|
||||
}
|
||||
/elastic-blub {
|
||||
router = round-robin
|
||||
|
|
@ -36,7 +36,7 @@ akka {
|
|||
lower-bound = 2
|
||||
upper-bound = 3
|
||||
}
|
||||
target.nodes = ["akka://remote_sys@localhost:12346"]
|
||||
target.nodes = ["akka://remote_sys@localhost:12347"]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -44,7 +44,7 @@ akka {
|
|||
|
||||
import RemoteRouterSpec._
|
||||
|
||||
val conf = ConfigFactory.parseString("akka.remote.netty.port=12346").withFallback(system.settings.config)
|
||||
val conf = ConfigFactory.parseString("akka.remote.netty.port=12347").withFallback(system.settings.config)
|
||||
val other = ActorSystem("remote_sys", conf)
|
||||
|
||||
override def atTermination() {
|
||||
|
|
@ -56,26 +56,26 @@ akka {
|
|||
"deploy its children on remote host driven by configuration" in {
|
||||
val router = system.actorOf(Props[Echo].withRouter(RoundRobinRouter(2)), "blub")
|
||||
router ! ""
|
||||
expectMsgType[ActorRef].path.toString must be === "akka://remote_sys@localhost:12346/remote/RemoteRouterSpec@localhost:12345/user/blub/c1"
|
||||
expectMsgType[ActorRef].path.address.toString must be === "akka://remote_sys@localhost:12347"
|
||||
router ! ""
|
||||
expectMsgType[ActorRef].path.toString must be === "akka://remote_sys@localhost:12346/remote/RemoteRouterSpec@localhost:12345/user/blub/c2"
|
||||
expectMsgType[ActorRef].path.address.toString must be === "akka://remote_sys@localhost:12347"
|
||||
}
|
||||
|
||||
"deploy its children on remote host driven by programatic definition" in {
|
||||
val router = system.actorOf(Props[Echo].withRouter(new RemoteRouterConfig(RoundRobinRouter(2),
|
||||
Seq("akka://remote_sys@localhost:12346"))), "blub2")
|
||||
Seq("akka://remote_sys@localhost:12347"))), "blub2")
|
||||
router ! ""
|
||||
expectMsgType[ActorRef].path.toString must be === "akka://remote_sys@localhost:12346/remote/RemoteRouterSpec@localhost:12345/user/blub2/c1"
|
||||
expectMsgType[ActorRef].path.address.toString must be === "akka://remote_sys@localhost:12347"
|
||||
router ! ""
|
||||
expectMsgType[ActorRef].path.toString must be === "akka://remote_sys@localhost:12346/remote/RemoteRouterSpec@localhost:12345/user/blub2/c2"
|
||||
expectMsgType[ActorRef].path.address.toString must be === "akka://remote_sys@localhost:12347"
|
||||
}
|
||||
|
||||
"deploy dynamic resizable number of children on remote host driven by configuration" in {
|
||||
val router = system.actorOf(Props[Echo].withRouter(FromConfig), "elastic-blub")
|
||||
router ! ""
|
||||
expectMsgType[ActorRef].path.toString must be === "akka://remote_sys@localhost:12346/remote/RemoteRouterSpec@localhost:12345/user/elastic-blub/c1"
|
||||
expectMsgType[ActorRef].path.address.toString must be === "akka://remote_sys@localhost:12347"
|
||||
router ! ""
|
||||
expectMsgType[ActorRef].path.toString must be === "akka://remote_sys@localhost:12346/remote/RemoteRouterSpec@localhost:12345/user/elastic-blub/c2"
|
||||
expectMsgType[ActorRef].path.address.toString must be === "akka://remote_sys@localhost:12347"
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue