received Supervise from unregistered child Actor, see #2485

* The problem was that RemoteRouteeProvider didn't attachChild
  when creating routees
* Added test for it
This commit is contained in:
Patrik Nordwall 2012-09-10 11:45:13 +02:00
parent 19d01442ec
commit 14f66d9c05
2 changed files with 23 additions and 6 deletions

View file

@ -67,10 +67,10 @@ akka.actor.deployment {
nr-of-instances = 4
}
}""").withFallback(system.settings.config)
val other = ActorSystem("remote-sys", conf)
val otherSystem = ActorSystem("remote-sys", conf)
override def atTermination() {
other.shutdown()
otherSystem.shutdown()
}
"A Remote Router" must {
@ -199,6 +199,25 @@ akka.actor.deployment {
system.stop(router)
}
"set supplied supervisorStrategy" in {
val escalator = OneForOneStrategy() {
case e
println("## " + e)
testActor ! e; SupervisorStrategy.Escalate
}
val router = system.actorOf(Props.empty.withRouter(new RemoteRouterConfig(
RoundRobinRouter(1, supervisorStrategy = escalator),
Seq(Address("akka", "remote-sys", "localhost", 12347)))), "blub3")
router ! CurrentRoutees
EventFilter[ActorKilledException](occurrences = 1) intercept {
EventFilter[ActorKilledException](occurrences = 1).intercept {
expectMsgType[RouterRoutees].routees.head ! Kill
}(otherSystem)
}
expectMsgType[ActorKilledException]
}
}
}