proxy isDefinedAt/apply through TestActorRef

This commit is contained in:
Roland 2011-04-21 21:31:24 +02:00
parent 4868f726c5
commit b6446f50dd
2 changed files with 26 additions and 2 deletions

View file

@ -172,6 +172,7 @@ class TestActorRefSpec extends WordSpec with MustMatchers with BeforeAndAfterEac
override def preRestart(reason: Throwable) { counter -= 1 }
override def postRestart(reason: Throwable) { counter -= 1 }
}).start()
self.dispatcher = CallingThreadDispatcher.global
self link ref
def receiveT = { case "sendKill" => ref ! Kill }
}).start()
@ -230,6 +231,17 @@ class TestActorRefSpec extends WordSpec with MustMatchers with BeforeAndAfterEac
EventHandler.removeListener(log)
}
"proxy isDefinedAt/apply for the underlying actor" in {
val ref = TestActorRef[WorkerActor].start()
ref.isDefinedAt("work") must be (true)
ref.isDefinedAt("sleep") must be (false)
val ch = Future.channel()
ref ! ch
val f = ch.future
f must be ('completed)
f() must be ("complexReply")
}
}
private def stopLog() = {
@ -242,4 +254,4 @@ class TestActorRefSpec extends WordSpec with MustMatchers with BeforeAndAfterEac
l foreach {a => EventHandler.addListener(Actor.actorOf[EventHandler.DefaultListener])}
}
}
}