From b2211a76a6e537cf2e404d424cb643f171818e92 Mon Sep 17 00:00:00 2001 From: phaller Date: Sat, 29 Sep 2012 18:15:37 +0200 Subject: SI-6442 - Add ActorDSL object for actor migration kit Removes MigrationSystem, since ActorDSL replaces it. --- test/files/jvm/actmig-PinS_2.scala | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) (limited to 'test/files/jvm/actmig-PinS_2.scala') diff --git a/test/files/jvm/actmig-PinS_2.scala b/test/files/jvm/actmig-PinS_2.scala index 7d12578f71..508525463f 100644 --- a/test/files/jvm/actmig-PinS_2.scala +++ b/test/files/jvm/actmig-PinS_2.scala @@ -9,7 +9,7 @@ import scala.concurrent.{ Promise, Await } object SillyActor { val startPromise = Promise[Boolean]() - val ref = MigrationSystem.actorOf(Props(() => new SillyActor, "default-stash-dispatcher")) + val ref = ActorDSL.actor(new SillyActor) } /* PinS, Listing 32.1: A simple actor @@ -29,7 +29,7 @@ class SillyActor extends StashingActor { object SeriousActor { val startPromise = Promise[Boolean]() - val ref = MigrationSystem.actorOf(Props(() => new SeriousActor, "default-stash-dispatcher")) + val ref = ActorDSL.actor(new SeriousActor) } class SeriousActor extends StashingActor { @@ -44,7 +44,7 @@ class SeriousActor extends StashingActor { /* PinS, Listing 32.3: An actor that calls react */ object NameResolver { - val ref = MigrationSystem.actorOf(Props(() => new NameResolver, "default-stash-dispatcher")) + val ref = ActorDSL.actor(new NameResolver) } class NameResolver extends StashingActor { @@ -80,7 +80,7 @@ object Test extends App { /* PinS, Listing 32.2: An actor that calls receive */ - def makeEchoActor(): ActorRef = MigrationSystem.actorOf(Props(() => + def makeEchoActor(): ActorRef = ActorDSL.actor( new StashingActor { def receive = { case _ => println("Nop") } @@ -94,11 +94,11 @@ object Test extends App { } } } - }, "default-stash-dispatcher")) + }) /* PinS, page 696 */ - def makeIntActor(): ActorRef = MigrationSystem.actorOf(Props(() =>new StashingActor { + def makeIntActor(): ActorRef = ActorDSL.actor(new StashingActor { def receive = { case _ => println("Nop") } @@ -108,9 +108,9 @@ object Test extends App { println("Got an Int: " + x) } } - }, "default-stash-dispatcher")) + }) - MigrationSystem.actorOf(Props(() => new StashingActor { + ActorDSL.actor(new StashingActor { def receive = { case _ => println("Nop") } @@ -126,7 +126,7 @@ object Test extends App { case Exit(_: SeriousActor, _) => val seriousPromise2 = Promise[Boolean]() // PinS, page 694 - val seriousActor2 = MigrationSystem.actorOf(Props(() =>{ + val seriousActor2 = ActorDSL.actor( new StashingActor { def receive = { case _ => println("Nop") } @@ -136,8 +136,7 @@ object Test extends App { println("That is the question.") seriousPromise2.success(true) } - } - }, "default-stash-dispatcher")) + }) Await.ready(seriousPromise2.future, 5 seconds) val echoActor = makeEchoActor() @@ -156,5 +155,5 @@ object Test extends App { } } } - }, "default-stash-dispatcher")) + }) } -- cgit v1.2.3