From 557fe9e9d2c14f363918e89056233a981dc5ef5c Mon Sep 17 00:00:00 2001 From: Josh Suereth Date: Tue, 30 Oct 2012 15:17:05 -0400 Subject: Removing actors-migration from main repository so it can live on elsewhere. * Removes actors-migration hooks from partest * Removes actors-migration code * removes actors-migration tests * removes actors-migration distribution packaging. --- test/files/jvm/actmig-PinS.scala | 116 --------------------------------------- 1 file changed, 116 deletions(-) delete mode 100644 test/files/jvm/actmig-PinS.scala (limited to 'test/files/jvm/actmig-PinS.scala') diff --git a/test/files/jvm/actmig-PinS.scala b/test/files/jvm/actmig-PinS.scala deleted file mode 100644 index 3f07fab12e..0000000000 --- a/test/files/jvm/actmig-PinS.scala +++ /dev/null @@ -1,116 +0,0 @@ -/** - * NOTE: Code snippets from this test are included in the Actor Migration Guide. In case you change - * code in these tests prior to the 2.10.0 release please send the notification to @vjovanov. - */ -import scala.actors._ -import scala.concurrent.duration._ -import scala.concurrent.{ Promise, Await } - -import scala.actors.Actor._ - -/* PinS, Listing 32.1: A simple actor - */ -object SillyActor extends Actor { - def act() { - for (i <- 1 to 5) - println("I'm acting!") - - println("Post stop") - } -} - -object SeriousActor extends Actor { - def act() { - for (i <- 1 to 5) - println("To be or not to be.") - } -} - -/* PinS, Listing 32.3: An actor that calls react - */ -object NameResolver extends Actor { - import java.net.{InetAddress, UnknownHostException} - - def act() { - react { - case (name: String, actor: Actor) => - actor ! getIp(name) - act() - case "EXIT" => - println("Name resolver exiting.") - // quit - case msg => - println("Unhandled message: " + msg) - act() - } - } - - def getIp(name: String): Option[InetAddress] = { - try { - Some(InetAddress.getByName(name)) - } catch { - case _: UnknownHostException => None - } - } - -} - -object Test extends App { - /* PinS, Listing 32.2: An actor that calls receive - */ - def makeEchoActor(): Actor = actor { - while (true) { - receive { - case 'stop => - exit() - case msg => - println("received message: " + msg) - } - } - } - - /* PinS, page 696 - */ - def makeIntActor(): Actor = actor { - receive { - case x: Int => // I only want Ints - println("Got an Int: " + x) - } - } - - actor { - self.trapExit = true - self.link(SillyActor) - SillyActor.start() - react { - case Exit(SillyActor, _) => - self.link(SeriousActor) - SeriousActor.start() - react { - case Exit(SeriousActor, _) => - val seriousPromise2 = Promise[Boolean] - // PinS, page 694 - val seriousActor2 = actor { - for (i <- 1 to 5) - println("That is the question.") - seriousPromise2.success(true) - } - - Await.ready(seriousPromise2.future, 5 seconds) - val echoActor = makeEchoActor() - self.link(echoActor) - echoActor ! "hi there" - echoActor ! 15 - echoActor ! 'stop - react { - case Exit(_, _) => - val intActor = makeIntActor() - intActor ! "hello" - intActor ! math.Pi - // only the following send leads to output - intActor ! 12 - } - } - } - } -} -- cgit v1.2.3