introduce AkkaApplication

- remove global Config
- pull everything which depended on it into new AkkaApplication
- leave EventHandler alone for the moment: that evil sucker gets his
  very own AkkaApplication("akka-reference.conf") until we have settled
  on an acceptable logging API without globals
- make akka-actor and akka-testkit compile
- TestKit uses implicit AkkaApplication passing for maximum convenience
- Actor object nearly completely removed, actor creation possible via
  ActorRefFactory interface which is implemented by AkkaApplication and
  ActorContext
- serialization of ActorRef is probably broken, and so is the reflective
  RemoteSupport (now needs AkkaApplication constructor arg)
- everything else is still broken, including akka-actor-tests, so this
  is of course all not runtime-tested
This commit is contained in:
Roland 2011-10-06 21:19:46 +02:00
parent ccb429df13
commit 2381ec54d0
46 changed files with 734 additions and 1066 deletions

View file

@ -8,6 +8,7 @@ import org.scalatest.{ BeforeAndAfterEach, WordSpec }
import akka.actor._
import akka.event.EventHandler
import akka.dispatch.{ Future, Promise }
import akka.AkkaApplication
/**
* Test whether TestActorRef behaves as an ActorRef should, besides its own spec.
@ -89,12 +90,12 @@ object TestActorRefSpec {
}
class TestActorRefSpec extends WordSpec with MustMatchers with BeforeAndAfterEach {
class TestActorRefSpec extends TestKit with WordSpec with MustMatchers with BeforeAndAfterEach {
import TestActorRefSpec._
EventHandler.start()
override def beforeEach {
otherthread = null
}
@ -120,7 +121,7 @@ class TestActorRefSpec extends WordSpec with MustMatchers with BeforeAndAfterEac
"used with ActorRef" in {
val a = TestActorRef(Props(new Actor {
val nested = Actor.actorOf(Props(self { case _ }))
val nested = context.createActor(Props(self { case _ }))
def receive = { case _ reply(nested) }
}))
a must not be (null)
@ -225,7 +226,7 @@ class TestActorRefSpec extends WordSpec with MustMatchers with BeforeAndAfterEac
"proxy apply for the underlying actor" in {
val ref = TestActorRef[WorkerActor]
intercept[IllegalActorStateException] { ref("work") }
val ch = Promise.channel()
val ch = Promise.channel(5000)
ref ! ch
ch must be('completed)
ch.get must be("complexReply")