From 5b73e75943dd89dabda84b0fc3a651837c4a2113 Mon Sep 17 00:00:00 2001 From: Lukas Rytz Date: Tue, 21 Apr 2015 14:49:58 +0200 Subject: Remove scala.actors and the actors migration module dependency --- test/files/jvm/actor-exceptions.check | 1 - test/files/jvm/actor-exceptions.scala | 67 ------------------ test/files/jvm/actor-executor.check | 20 ------ test/files/jvm/actor-executor.scala | 78 -------------------- test/files/jvm/actor-executor2.check | 21 ------ test/files/jvm/actor-executor2.scala | 92 ------------------------ test/files/jvm/actor-executor3.check | 20 ------ test/files/jvm/actor-executor3.scala | 66 ----------------- test/files/jvm/actor-getstate.check | 2 - test/files/jvm/actor-getstate.scala | 87 ----------------------- test/files/jvm/actor-link-getstate.check | 2 - test/files/jvm/actor-link-getstate.scala | 65 ----------------- test/files/jvm/actor-looping.check | 5 -- test/files/jvm/actor-looping.scala | 33 --------- test/files/jvm/actor-normal-exit.check | 2 - test/files/jvm/actor-normal-exit.scala | 38 ---------- test/files/jvm/actor-receivewithin.check | 16 ----- test/files/jvm/actor-receivewithin.scala | 72 ------------------- test/files/jvm/actor-sync-send-timeout.scala | 48 ------------- test/files/jvm/actor-termination.check | 2 - test/files/jvm/actor-termination.scala | 19 ----- test/files/jvm/actor-uncaught-exception.check | 2 - test/files/jvm/actor-uncaught-exception.scala | 64 ----------------- test/files/jvm/actor-uncaught-exception2.check | 2 - test/files/jvm/actor-uncaught-exception2.scala | 63 ----------------- test/files/jvm/daemon-actor-termination.check | 2 - test/files/jvm/daemon-actor-termination.scala | 40 ----------- test/files/jvm/future-alarm.check | 20 ------ test/files/jvm/future-alarm.scala | 23 ------ test/files/jvm/future-awaitall-zero.check | 1 - test/files/jvm/future-awaitall-zero.scala | 24 ------- test/files/jvm/future-termination.check | 1 - test/files/jvm/future-termination.scala | 21 ------ test/files/jvm/reactor-exceptionOnSend.check | 2 - test/files/jvm/reactor-exceptionOnSend.scala | 58 --------------- test/files/jvm/reactor-producer-consumer.check | 10 --- test/files/jvm/reactor-producer-consumer.scala | 97 ------------------------- test/files/jvm/reactor.check | 22 ------ test/files/jvm/reactor.scala | 72 ------------------- test/files/jvm/replyablereactor.check | 5 -- test/files/jvm/replyablereactor.scala | 59 ---------------- test/files/jvm/replyablereactor2.check | 5 -- test/files/jvm/replyablereactor2.scala | 58 --------------- test/files/jvm/replyablereactor3.check | 5 -- test/files/jvm/replyablereactor3.scala | 57 --------------- test/files/jvm/replyablereactor4.check | 5 -- test/files/jvm/replyablereactor4.scala | 57 --------------- test/files/jvm/replyreactor-react-sender.check | 1 - test/files/jvm/replyreactor-react-sender.scala | 53 -------------- test/files/jvm/replyreactor.check | 1 - test/files/jvm/replyreactor.scala | 43 ----------- test/files/jvm/scheduler-adapter.check | 6 -- test/files/jvm/scheduler-adapter.scala | 54 -------------- test/files/jvm/t1449.check | 1 - test/files/jvm/t1449.scala | 28 -------- test/files/jvm/t1948.scala | 26 ------- test/files/jvm/t2359.check | 5 -- test/files/jvm/t2359.scala | 48 ------------- test/files/jvm/t2530.check | 21 ------ test/files/jvm/t2530.scala | 98 -------------------------- test/files/jvm/t3102.check | 2 - test/files/jvm/t3102.scala | 39 ---------- test/files/jvm/t3356.check | 3 - test/files/jvm/t3356.scala | 58 --------------- test/files/jvm/t3365.check | 5 -- test/files/jvm/t3365.scala | 68 ------------------ test/files/jvm/t3407.check | 10 --- test/files/jvm/t3407.scala | 21 ------ test/files/jvm/t3412-channel.check | 10 --- test/files/jvm/t3412-channel.scala | 40 ----------- test/files/jvm/t3412.check | 10 --- test/files/jvm/t3412.scala | 34 --------- test/files/jvm/t3470.check | 3 - test/files/jvm/t3470.scala | 32 --------- test/files/jvm/t3838.check | 1 - test/files/jvm/t3838.scala | 17 ----- 76 files changed, 2269 deletions(-) delete mode 100644 test/files/jvm/actor-exceptions.check delete mode 100644 test/files/jvm/actor-exceptions.scala delete mode 100644 test/files/jvm/actor-executor.check delete mode 100644 test/files/jvm/actor-executor.scala delete mode 100644 test/files/jvm/actor-executor2.check delete mode 100644 test/files/jvm/actor-executor2.scala delete mode 100644 test/files/jvm/actor-executor3.check delete mode 100644 test/files/jvm/actor-executor3.scala delete mode 100644 test/files/jvm/actor-getstate.check delete mode 100644 test/files/jvm/actor-getstate.scala delete mode 100644 test/files/jvm/actor-link-getstate.check delete mode 100644 test/files/jvm/actor-link-getstate.scala delete mode 100644 test/files/jvm/actor-looping.check delete mode 100644 test/files/jvm/actor-looping.scala delete mode 100644 test/files/jvm/actor-normal-exit.check delete mode 100644 test/files/jvm/actor-normal-exit.scala delete mode 100644 test/files/jvm/actor-receivewithin.check delete mode 100644 test/files/jvm/actor-receivewithin.scala delete mode 100644 test/files/jvm/actor-sync-send-timeout.scala delete mode 100644 test/files/jvm/actor-termination.check delete mode 100644 test/files/jvm/actor-termination.scala delete mode 100644 test/files/jvm/actor-uncaught-exception.check delete mode 100644 test/files/jvm/actor-uncaught-exception.scala delete mode 100644 test/files/jvm/actor-uncaught-exception2.check delete mode 100644 test/files/jvm/actor-uncaught-exception2.scala delete mode 100644 test/files/jvm/daemon-actor-termination.check delete mode 100644 test/files/jvm/daemon-actor-termination.scala delete mode 100644 test/files/jvm/future-alarm.check delete mode 100644 test/files/jvm/future-alarm.scala delete mode 100644 test/files/jvm/future-awaitall-zero.check delete mode 100644 test/files/jvm/future-awaitall-zero.scala delete mode 100644 test/files/jvm/future-termination.check delete mode 100644 test/files/jvm/future-termination.scala delete mode 100644 test/files/jvm/reactor-exceptionOnSend.check delete mode 100644 test/files/jvm/reactor-exceptionOnSend.scala delete mode 100644 test/files/jvm/reactor-producer-consumer.check delete mode 100644 test/files/jvm/reactor-producer-consumer.scala delete mode 100644 test/files/jvm/reactor.check delete mode 100644 test/files/jvm/reactor.scala delete mode 100644 test/files/jvm/replyablereactor.check delete mode 100644 test/files/jvm/replyablereactor.scala delete mode 100644 test/files/jvm/replyablereactor2.check delete mode 100644 test/files/jvm/replyablereactor2.scala delete mode 100644 test/files/jvm/replyablereactor3.check delete mode 100644 test/files/jvm/replyablereactor3.scala delete mode 100644 test/files/jvm/replyablereactor4.check delete mode 100644 test/files/jvm/replyablereactor4.scala delete mode 100644 test/files/jvm/replyreactor-react-sender.check delete mode 100644 test/files/jvm/replyreactor-react-sender.scala delete mode 100644 test/files/jvm/replyreactor.check delete mode 100644 test/files/jvm/replyreactor.scala delete mode 100644 test/files/jvm/scheduler-adapter.check delete mode 100644 test/files/jvm/scheduler-adapter.scala delete mode 100644 test/files/jvm/t1449.check delete mode 100644 test/files/jvm/t1449.scala delete mode 100644 test/files/jvm/t1948.scala delete mode 100644 test/files/jvm/t2359.check delete mode 100644 test/files/jvm/t2359.scala delete mode 100644 test/files/jvm/t2530.check delete mode 100644 test/files/jvm/t2530.scala delete mode 100644 test/files/jvm/t3102.check delete mode 100644 test/files/jvm/t3102.scala delete mode 100644 test/files/jvm/t3356.check delete mode 100644 test/files/jvm/t3356.scala delete mode 100644 test/files/jvm/t3365.check delete mode 100644 test/files/jvm/t3365.scala delete mode 100644 test/files/jvm/t3407.check delete mode 100644 test/files/jvm/t3407.scala delete mode 100644 test/files/jvm/t3412-channel.check delete mode 100644 test/files/jvm/t3412-channel.scala delete mode 100644 test/files/jvm/t3412.check delete mode 100644 test/files/jvm/t3412.scala delete mode 100644 test/files/jvm/t3470.check delete mode 100644 test/files/jvm/t3470.scala delete mode 100644 test/files/jvm/t3838.check delete mode 100644 test/files/jvm/t3838.scala (limited to 'test/files/jvm') diff --git a/test/files/jvm/actor-exceptions.check b/test/files/jvm/actor-exceptions.check deleted file mode 100644 index d86bac9de5..0000000000 --- a/test/files/jvm/actor-exceptions.check +++ /dev/null @@ -1 +0,0 @@ -OK diff --git a/test/files/jvm/actor-exceptions.scala b/test/files/jvm/actor-exceptions.scala deleted file mode 100644 index bdd983a0e8..0000000000 --- a/test/files/jvm/actor-exceptions.scala +++ /dev/null @@ -1,67 +0,0 @@ - - -@deprecated("Suppress warnings", since="2.11") -object Test { -import scala.actors.{Actor, Exit} -import Actor._ - -case class MyException(text: String) extends Exception { - override def fillInStackTrace() = this -} - -case class MyOtherException(text: String) extends Exception { - override def fillInStackTrace() = this -} - -object Master extends Actor { - trapExit = true - def act() { - try { - link(Slave) - Slave.start() - for (i <- 0 until 10) Slave ! A - react { - case Exit(from, reason) => - println("OK") - } - } catch { - case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] => - e.printStackTrace() - } - } -} - -object Slave extends Actor { - override def toString = "Slave" - override def exceptionHandler: PartialFunction[Exception, Unit] = { - case MyException(text) => - case other if !other.isInstanceOf[scala.util.control.ControlThrowable] => super.exceptionHandler(other) - } - def act() { - try { - var cnt = 0 - loop { - react { - case A => - cnt += 1 - if (cnt % 2 != 0) throw MyException("problem") - if (cnt == 10) { - throw MyOtherException("unhandled") - } - } - } - } catch { - case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] && - !e.isInstanceOf[MyException] && - !e.isInstanceOf[MyOtherException] => - e.printStackTrace() - } - } -} - -case object A - - def main(args: Array[String]) { - Master.start() - } -} diff --git a/test/files/jvm/actor-executor.check b/test/files/jvm/actor-executor.check deleted file mode 100644 index bdbdb5c6a2..0000000000 --- a/test/files/jvm/actor-executor.check +++ /dev/null @@ -1,20 +0,0 @@ -Two: OK -One: OK -Two: OK -One: OK -Two: OK -One: OK -Two: OK -One: OK -Two: OK -One: OK -Two: OK -One: OK -Two: OK -One: OK -Two: OK -One: OK -Two: OK -One: OK -Two: OK -One: OK diff --git a/test/files/jvm/actor-executor.scala b/test/files/jvm/actor-executor.scala deleted file mode 100644 index 0fc28b4d85..0000000000 --- a/test/files/jvm/actor-executor.scala +++ /dev/null @@ -1,78 +0,0 @@ - - -@deprecated("Suppress warnings", since="2.11") -object Test { -import java.util.concurrent.Executors -import scala.actors.{Actor, SchedulerAdapter} -import Actor._ - -trait AdaptedActor extends Actor { - override def scheduler = - Test.scheduler -} - -object One extends AdaptedActor { - def act() { - try { - Two.start() - var i = 0 - loopWhile (i < 10000) { - i += 1 - Two ! 'MsgForTwo - react { - case 'MsgForOne => - if (i % 1000 == 0) - println("One: OK") - if (i == 10000) - Test.executor.shutdown() - } - } - } catch { - case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] => - e.printStackTrace() - } - } -} - -object Two extends AdaptedActor { - def act() { - try { - var i = 0 - loopWhile (i < 10000) { - i += 1 - react { - case 'MsgForTwo => - if (i % 1000 == 0) - println("Two: OK") - One ! 'MsgForOne - } - } - } catch { - case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] => - e.printStackTrace() - } - } -} - - val executor = - Executors.newFixedThreadPool(Runtime.getRuntime().availableProcessors()) - - val scheduler = - new SchedulerAdapter { - def execute(block: => Unit) { - val task = new Runnable { - def run() { block } - } - try { - executor.execute(task) - } catch { - case ree: java.util.concurrent.RejectedExecutionException => - task.run() - } - } - } - - def main(args: Array[String]) { - One.start() - } -} diff --git a/test/files/jvm/actor-executor2.check b/test/files/jvm/actor-executor2.check deleted file mode 100644 index da78f45836..0000000000 --- a/test/files/jvm/actor-executor2.check +++ /dev/null @@ -1,21 +0,0 @@ -Two: OK -One: OK -Two: OK -One: OK -Two: OK -One: OK -Two: OK -One: OK -Two: OK -One: OK -Two: OK -One: OK -Two: OK -One: OK -Two: OK -One: OK -Two: OK -One: OK -Two: OK -One: OK -One exited diff --git a/test/files/jvm/actor-executor2.scala b/test/files/jvm/actor-executor2.scala deleted file mode 100644 index 5badf2ae7e..0000000000 --- a/test/files/jvm/actor-executor2.scala +++ /dev/null @@ -1,92 +0,0 @@ - - - -@deprecated("Suppress warnings", since="2.11") -object Test { -import scala.actors.{Actor, SchedulerAdapter, Exit} -import Actor._ -import java.util.concurrent.{Executors, RejectedExecutionException} - -object One extends AdaptedActor { - def act() { - try { - Two.start() - var i = 0 - loopWhile (i < Test.NUM_MSG) { - i += 1 - Two ! 'MsgForTwo - react { - case 'MsgForOne => - if (i % (Test.NUM_MSG/10) == 0) - println("One: OK") - } - } - } catch { - case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] => - e.printStackTrace() - } - } -} - -object Two extends AdaptedActor { - def act() { - try { - var i = 0 - loopWhile (i < Test.NUM_MSG) { - i += 1 - react { - case 'MsgForTwo => - if (i % (Test.NUM_MSG/10) == 0) - println("Two: OK") - One ! 'MsgForOne - } - } - } catch { - case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] => - e.printStackTrace() - } - } -} - -trait AdaptedActor extends Actor { - override def scheduler = - Test.scheduler -} - - val NUM_MSG = 100000 - - val executor = - Executors.newFixedThreadPool(Runtime.getRuntime().availableProcessors()) - - val scheduler = - new SchedulerAdapter { - def execute(block: => Unit) { - val task = new Runnable { - def run() { block } - } - try { - executor.execute(task) - } catch { - case ree: RejectedExecutionException => - task.run() // run task on current thread - } - } - } - - def main(args: Array[String]) { - try { - self.trapExit = true - link(One) - One.start() - - receive { - case Exit(from, reason) => - println("One exited") - Test.executor.shutdown() - } - } catch { - case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] => - e.printStackTrace() - } - } -} diff --git a/test/files/jvm/actor-executor3.check b/test/files/jvm/actor-executor3.check deleted file mode 100644 index bdbdb5c6a2..0000000000 --- a/test/files/jvm/actor-executor3.check +++ /dev/null @@ -1,20 +0,0 @@ -Two: OK -One: OK -Two: OK -One: OK -Two: OK -One: OK -Two: OK -One: OK -Two: OK -One: OK -Two: OK -One: OK -Two: OK -One: OK -Two: OK -One: OK -Two: OK -One: OK -Two: OK -One: OK diff --git a/test/files/jvm/actor-executor3.scala b/test/files/jvm/actor-executor3.scala deleted file mode 100644 index f8b57d84b3..0000000000 --- a/test/files/jvm/actor-executor3.scala +++ /dev/null @@ -1,66 +0,0 @@ - - - -@deprecated("Suppress warnings", since="2.11") -object Test { -import scala.actors.Actor -import scala.actors.scheduler.ExecutorScheduler -import java.util.concurrent.Executors - -object One extends AdaptedActor { - def act() { - try { - Two.start() - var i = 0 - loopWhile (i < Test.NUM_MSG) { - i += 1 - Two ! 'MsgForTwo - react { - case 'MsgForOne => - if (i % (Test.NUM_MSG/10) == 0) - println("One: OK") - } - } - } catch { - case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] => - e.printStackTrace() - } - } -} - -object Two extends AdaptedActor { - def act() { - try { - var i = 0 - loopWhile (i < Test.NUM_MSG) { - i += 1 - react { - case 'MsgForTwo => - if (i % (Test.NUM_MSG/10) == 0) - println("Two: OK") - One ! 'MsgForOne - } - } - } catch { - case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] => - e.printStackTrace() - } - } -} - -trait AdaptedActor extends Actor { - override def scheduler = - Test.scheduler -} - - val NUM_MSG = 100000 - - val executor = - Executors.newFixedThreadPool(Runtime.getRuntime().availableProcessors()) - - val scheduler = ExecutorScheduler(executor) - - def main(args: Array[String]) { - One.start() - } -} diff --git a/test/files/jvm/actor-getstate.check b/test/files/jvm/actor-getstate.check deleted file mode 100644 index 2c94e48371..0000000000 --- a/test/files/jvm/actor-getstate.check +++ /dev/null @@ -1,2 +0,0 @@ -OK -OK diff --git a/test/files/jvm/actor-getstate.scala b/test/files/jvm/actor-getstate.scala deleted file mode 100644 index 425efbe5e6..0000000000 --- a/test/files/jvm/actor-getstate.scala +++ /dev/null @@ -1,87 +0,0 @@ - - -@deprecated("Suppress warnings", since="2.11") -object Test { - import scala.actors.{Reactor, Actor, TIMEOUT} - import Actor._ - - def assert(cond: => Boolean, hint: String) { - if (!cond) - println("FAIL ["+hint+"]") - } - - def expectActorState(a: Reactor[T] forSome { type T }, s: Actor.State.Value) { - var done = false - var i = 0 - while (!done) { - i = i + 1 - if (i == 10) { // only wait for 2 seconds total - println("FAIL ["+a+": expected "+s+"]") - done = true - } - - Thread.sleep(200) - if (a.getState == s) // success - done = true - } - } - - def main(args: Array[String]) { - actor { - val a = new Reactor[Any] { - def act() { - assert(getState == Actor.State.Runnable, "runnable1") - react { - case 'go => - println("OK") - } - } - } - expectActorState(a, Actor.State.New) - - a.start() - expectActorState(a, Actor.State.Suspended) - - a ! 'go - expectActorState(a, Actor.State.Terminated) - - val b = new Actor { - def act() { - assert(getState == Actor.State.Runnable, "runnable2: "+getState) - react { - case 'go => - reactWithin(100000) { - case TIMEOUT => - case 'go => - receive { - case 'go => - } - receiveWithin(100000) { - case TIMEOUT => - case 'go => - println("OK") - } - } - } - } - } - expectActorState(b, Actor.State.New) - - b.start() - expectActorState(b, Actor.State.Suspended) - - b ! 'go - expectActorState(b, Actor.State.TimedSuspended) - - b ! 'go - expectActorState(b, Actor.State.Blocked) - - b ! 'go - expectActorState(b, Actor.State.TimedBlocked) - - b ! 'go - expectActorState(b, Actor.State.Terminated) - } - } - -} diff --git a/test/files/jvm/actor-link-getstate.check b/test/files/jvm/actor-link-getstate.check deleted file mode 100644 index 9755447320..0000000000 --- a/test/files/jvm/actor-link-getstate.check +++ /dev/null @@ -1,2 +0,0 @@ -Done -Terminated diff --git a/test/files/jvm/actor-link-getstate.scala b/test/files/jvm/actor-link-getstate.scala deleted file mode 100644 index d8b8ada1e6..0000000000 --- a/test/files/jvm/actor-link-getstate.scala +++ /dev/null @@ -1,65 +0,0 @@ - - -@deprecated("Suppress warnings", since="2.11") -object Test { - import scala.actors.{Actor, Exit} - import scala.actors.Actor._ - -case class MyException(text: String) extends Exception(text) { - override def fillInStackTrace() = this -} - -object Slave extends Actor { - def act() { - try { - loop { - react { - case 'doWork => - Console.out.println("Done") - reply('done) - } - } - } catch { - case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] => - e.printStackTrace() - } - } -} - -object Master extends Actor { - override def toString = "Master" - def act() { - try { - link(Slave) - Slave ! 'doWork - react { - case 'done => - throw new MyException("Master crashed") - } - } catch { - case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] => - e.printStackTrace() - } - } -} - - - def main(args: Array[String]) { - actor { - try { - self.trapExit = true - link(Slave) - Slave.start() - Master.start() - react { - case Exit(from, reason) if (from == Slave) => - Console.out.println(Slave.getState) - } - } catch { - case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] => - e.printStackTrace() - } - } - } - -} diff --git a/test/files/jvm/actor-looping.check b/test/files/jvm/actor-looping.check deleted file mode 100644 index a6f5c2e73a..0000000000 --- a/test/files/jvm/actor-looping.check +++ /dev/null @@ -1,5 +0,0 @@ -received A -received A -received A -received A -received last A diff --git a/test/files/jvm/actor-looping.scala b/test/files/jvm/actor-looping.scala deleted file mode 100644 index 7bc6f1e5c5..0000000000 --- a/test/files/jvm/actor-looping.scala +++ /dev/null @@ -1,33 +0,0 @@ - - -@deprecated("Suppress warnings", since="2.11") -object Test { - import scala.actors.Actor._ - case object A - - def main(args: Array[String]) { - val a = actor { - try { - var cnt = 0 - loop { - react { - case A => - cnt += 1 - if (cnt % 2 != 0) continue - if (cnt < 10) - println("received A") - else { - println("received last A") - exit() - } - } - } - } catch { - case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] => - e.printStackTrace() - } - } - - for (i <- 0 until 10) a ! A - } -} diff --git a/test/files/jvm/actor-normal-exit.check b/test/files/jvm/actor-normal-exit.check deleted file mode 100644 index 6865f83b90..0000000000 --- a/test/files/jvm/actor-normal-exit.check +++ /dev/null @@ -1,2 +0,0 @@ -Done -slave exited for reason 'normal diff --git a/test/files/jvm/actor-normal-exit.scala b/test/files/jvm/actor-normal-exit.scala deleted file mode 100644 index 90495866e2..0000000000 --- a/test/files/jvm/actor-normal-exit.scala +++ /dev/null @@ -1,38 +0,0 @@ - - - -@deprecated("Suppress warnings", since="2.11") -object Test { - import scala.actors.{Actor, Exit} - object Master extends Actor { - trapExit = true - def act() { - try { - Slave.start() - react { - case Exit(from, reason) => - println("slave exited for reason " + reason) - } - } catch { - case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] => - e.printStackTrace() - } - } - } - - object Slave extends Actor { - def act() { - try { - link(Master) - println("Done") - } catch { - case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] => - e.printStackTrace() - } - } - } - - def main(args: Array[String]) { - Master.start() - } -} diff --git a/test/files/jvm/actor-receivewithin.check b/test/files/jvm/actor-receivewithin.check deleted file mode 100644 index a6a3e88c61..0000000000 --- a/test/files/jvm/actor-receivewithin.check +++ /dev/null @@ -1,16 +0,0 @@ -'msg -'msg -'msg -'msg -'msg -TIMEOUT -TIMEOUT -TIMEOUT -TIMEOUT -TIMEOUT -'msg2 -'msg2 -'msg2 -'msg2 -'msg2 -TIMEOUT diff --git a/test/files/jvm/actor-receivewithin.scala b/test/files/jvm/actor-receivewithin.scala deleted file mode 100644 index 5982462502..0000000000 --- a/test/files/jvm/actor-receivewithin.scala +++ /dev/null @@ -1,72 +0,0 @@ - - -@deprecated("Suppress warnings", since="2.11") -object Test { -import scala.actors.{Actor, TIMEOUT} - -object A extends Actor { - def act() { - receive { - case 'done => - var cnt = 0 - while (cnt < 500) { - cnt += 1 - receiveWithin (0) { - case 'msg => - if (cnt % 100 == 0) - println("'msg") - case TIMEOUT => - // should not happen - println("FAIL1") - } - } - cnt = 0 - while (cnt < 500) { - cnt += 1 - receiveWithin (0) { - case 'msg => - // should not happen - println("FAIL2") - case TIMEOUT => - if (cnt % 100 == 0) - println("TIMEOUT") - } - } - B ! 'next - receive { case 'done => } - cnt = 0 - while (cnt < 501) { - cnt += 1 - receiveWithin (500) { - case 'msg2 => - if (cnt % 100 == 0) - println("'msg2") - case TIMEOUT => - println("TIMEOUT") - } - } - } - } -} - -object B extends Actor { - def act() { - A.start() - for (_ <- 1 to 500) { - A ! 'msg - } - A ! 'done - receive { - case 'next => - for (_ <- 1 to 500) { - A ! 'msg2 - } - A ! 'done - } - } -} - - def main(args:Array[String]) { - B.start() - } -} diff --git a/test/files/jvm/actor-sync-send-timeout.scala b/test/files/jvm/actor-sync-send-timeout.scala deleted file mode 100644 index 66a0b0a6ff..0000000000 --- a/test/files/jvm/actor-sync-send-timeout.scala +++ /dev/null @@ -1,48 +0,0 @@ -@deprecated("Suppress warnings", since="2.11") -object Test { -import scala.actors.Actor - -/* This test is a regression test for SI-4759. - */ - val Runs = 5 - - def main(args: Array[String]) = { - var i = 0 - while (i < Runs) { - i += 1 - A1 ! 1 - Thread.sleep(500) - } - //println("done sending to A1") - } - -object A2 extends Actor { - this.start() - def act() { - loop { - react { - case 'stop => - //println("A2 exiting") - exit() - case _ => - } - } - } -} - -object A1 extends Actor { - this.start() - def act() { - var i = 0 - loopWhile(i < Test.Runs) { - i += 1 - react { - case any => - A2 !? (500, any) - if (i == Test.Runs) - A2 ! 'stop - } - } - } -} -} diff --git a/test/files/jvm/actor-termination.check b/test/files/jvm/actor-termination.check deleted file mode 100644 index e3f44d8b18..0000000000 --- a/test/files/jvm/actor-termination.check +++ /dev/null @@ -1,2 +0,0 @@ -I'm going to make you wait. -Ok, I'm done. diff --git a/test/files/jvm/actor-termination.scala b/test/files/jvm/actor-termination.scala deleted file mode 100644 index 4a6bf92d48..0000000000 --- a/test/files/jvm/actor-termination.scala +++ /dev/null @@ -1,19 +0,0 @@ - -/* Test that an actor that hasn't finished prevents termination */ - -@deprecated("Suppress warnings", since="2.11") -object Test { - import scala.actors.Actor - def main(args: Array[String]) { - Actor.actor { - try { - println("I'm going to make you wait.") - Thread.sleep(5000) - println("Ok, I'm done.") - } catch { - case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] => - e.printStackTrace() - } - } - } -} diff --git a/test/files/jvm/actor-uncaught-exception.check b/test/files/jvm/actor-uncaught-exception.check deleted file mode 100644 index 2c94e48371..0000000000 --- a/test/files/jvm/actor-uncaught-exception.check +++ /dev/null @@ -1,2 +0,0 @@ -OK -OK diff --git a/test/files/jvm/actor-uncaught-exception.scala b/test/files/jvm/actor-uncaught-exception.scala deleted file mode 100644 index c28ad2fa3c..0000000000 --- a/test/files/jvm/actor-uncaught-exception.scala +++ /dev/null @@ -1,64 +0,0 @@ -@deprecated("Suppress warnings", since="2.11") -object Test { -import scala.actors.{Actor, Exit} - -class MyException(msg: String) extends Exception(msg) { - override def fillInStackTrace() = this -} - - - case object StartError extends Actor { - def act() { - try { - throw new MyException("I don't want to run!") - } catch { - case e: Throwable if (!e.isInstanceOf[scala.util.control.ControlThrowable] && - !e.isInstanceOf[MyException]) => - e.printStackTrace() - } - } - } - - case object MessageError extends Actor { - def act() { - try { - react { - case _ => throw new MyException("No message for me!") - } - } catch { - case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] => - e.printStackTrace() - } - } - } - - case object Supervisor extends Actor { - def act() { - try { - trapExit = true - link(StartError) - link(MessageError) - StartError.start() - MessageError.start() - - Actor.loop { - react { - case Exit(actor, reason) => - println("OK") - if (actor == StartError) - MessageError ! 'ping - else - exit() - } - } - } catch { - case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] => - e.printStackTrace() - } - } - } - - def main(args: Array[String]) { - Supervisor.start() - } -} diff --git a/test/files/jvm/actor-uncaught-exception2.check b/test/files/jvm/actor-uncaught-exception2.check deleted file mode 100644 index a54f374aed..0000000000 --- a/test/files/jvm/actor-uncaught-exception2.check +++ /dev/null @@ -1,2 +0,0 @@ -UncaughtException(StartError,None,None,Test$MyException: I don't want to run!) -UncaughtException(MessageError,Some('ping),Some(Supervisor),Test$MyException: No message for me!) diff --git a/test/files/jvm/actor-uncaught-exception2.scala b/test/files/jvm/actor-uncaught-exception2.scala deleted file mode 100644 index 8327b4e19d..0000000000 --- a/test/files/jvm/actor-uncaught-exception2.scala +++ /dev/null @@ -1,63 +0,0 @@ -@deprecated("Suppress warnings", since="2.11") -object Test { -import scala.actors.{Actor, Exit, Debug} - -class MyException(msg: String) extends Exception(msg) { - override def fillInStackTrace() = this -} - - case object StartError extends Actor { - def act() { - try { - throw new MyException("I don't want to run!") - } catch { - case e: Throwable if (!e.isInstanceOf[scala.util.control.ControlThrowable] && - !e.isInstanceOf[MyException]) => - e.printStackTrace() - } - } - } - - case object MessageError extends Actor { - def act() { - try { - react { - case _ => throw new MyException("No message for me!") - } - } catch { - case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] => - e.printStackTrace() - } - } - } - - case object Supervisor extends Actor { - def act() { - try { - trapExit = true - link(StartError) - link(MessageError) - StartError.start() - MessageError.start() - - Actor.loop { - react { - case Exit(actor, reason) => - println(reason) - if (actor == StartError) - MessageError ! 'ping - else - exit() - } - } - } catch { - case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] => - e.printStackTrace() - } - } - } - - def main(args: Array[String]) { - Supervisor.start() - } -} diff --git a/test/files/jvm/daemon-actor-termination.check b/test/files/jvm/daemon-actor-termination.check deleted file mode 100644 index b2ff72fd0b..0000000000 --- a/test/files/jvm/daemon-actor-termination.check +++ /dev/null @@ -1,2 +0,0 @@ -MSG1 -MSG2 diff --git a/test/files/jvm/daemon-actor-termination.scala b/test/files/jvm/daemon-actor-termination.scala deleted file mode 100644 index 9bac6340ba..0000000000 --- a/test/files/jvm/daemon-actor-termination.scala +++ /dev/null @@ -1,40 +0,0 @@ - -/* Test that a daemon Actor that hasn't finished does not prevent termination */ - -@deprecated("Suppress warnings", since="2.11") -object Test { - - import scala.actors.{Actor, DaemonActor} - class MyDaemon extends DaemonActor { - def act() { - try { - react { - case 'hello => - println("MSG1") - reply(()) - react { - case 'bye => - println("done") - } - } - } catch { - case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] => - e.printStackTrace() - } - } - } - - def main(args: Array[String]) { - val daemon = new MyDaemon - daemon.start() - Actor.actor { - try { - daemon !? 'hello - println("MSG2") - } catch { - case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] => - e.printStackTrace() - } - } - } -} diff --git a/test/files/jvm/future-alarm.check b/test/files/jvm/future-alarm.check deleted file mode 100644 index 01a87d1c4c..0000000000 --- a/test/files/jvm/future-alarm.check +++ /dev/null @@ -1,20 +0,0 @@ -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK diff --git a/test/files/jvm/future-alarm.scala b/test/files/jvm/future-alarm.scala deleted file mode 100644 index 3e71fa681c..0000000000 --- a/test/files/jvm/future-alarm.scala +++ /dev/null @@ -1,23 +0,0 @@ - - -@deprecated("Suppress warnings", since="2.11") -object Test { - import scala.actors.Futures - def main(args: Array[String]) { - try { - for (i <- 1 to 100000) { - Futures.alarm(0) - if (i % 10000 == 0) - println("OK") - } - for (_ <- 1 to 10) { - val ft = Futures.alarm(100) - ft() - println("OK") - } - } catch { - case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] => - e.printStackTrace() - } - } -} diff --git a/test/files/jvm/future-awaitall-zero.check b/test/files/jvm/future-awaitall-zero.check deleted file mode 100644 index d86bac9de5..0000000000 --- a/test/files/jvm/future-awaitall-zero.check +++ /dev/null @@ -1 +0,0 @@ -OK diff --git a/test/files/jvm/future-awaitall-zero.scala b/test/files/jvm/future-awaitall-zero.scala deleted file mode 100644 index 56f4bab16f..0000000000 --- a/test/files/jvm/future-awaitall-zero.scala +++ /dev/null @@ -1,24 +0,0 @@ - - -@deprecated("Suppress warnings", since="2.11") -object Test { - import scala.actors.Futures._ - import scala.actors.Actor._ - def main(args: Array[String]) { - try { - val ft1 = future { reactWithin(10000) { - case _ => println("FAIL") - } } - - val ft2 = future { reactWithin(20000) { - case _ => println("FAIL") - } } - - val res = awaitAll(0, ft1, ft2) - println("OK") - } catch { - case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] => - e.printStackTrace() - } - } -} diff --git a/test/files/jvm/future-termination.check b/test/files/jvm/future-termination.check deleted file mode 100644 index dc335465d4..0000000000 --- a/test/files/jvm/future-termination.check +++ /dev/null @@ -1 +0,0 @@ -I can't wait that long, bye. diff --git a/test/files/jvm/future-termination.scala b/test/files/jvm/future-termination.scala deleted file mode 100644 index 90ea336ce8..0000000000 --- a/test/files/jvm/future-termination.scala +++ /dev/null @@ -1,21 +0,0 @@ - -/* Test that unevaluated futures do not prevent program termination */ - - -@deprecated("Suppress warnings", since="2.11") -object Test { - import scala.actors.Futures - def main(args: Array[String]) { - try { - val meaningOfLife = Futures.future { - Thread.sleep(5000) // pretend this is a harder problem than it is - println("I have the answer!") - 42 - } - println("I can't wait that long, bye.") - } catch { - case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] => - e.printStackTrace() - } - } -} diff --git a/test/files/jvm/reactor-exceptionOnSend.check b/test/files/jvm/reactor-exceptionOnSend.check deleted file mode 100644 index 45d62e26a7..0000000000 --- a/test/files/jvm/reactor-exceptionOnSend.check +++ /dev/null @@ -1,2 +0,0 @@ -receiver handles exception -process diff --git a/test/files/jvm/reactor-exceptionOnSend.scala b/test/files/jvm/reactor-exceptionOnSend.scala deleted file mode 100644 index 6d79fc9d13..0000000000 --- a/test/files/jvm/reactor-exceptionOnSend.scala +++ /dev/null @@ -1,58 +0,0 @@ - - -@deprecated("Suppress warnings", since="2.11") -object Test { -import scala.actors.Reactor -import scala.actors.Actor._ - -case class MyException(text: String) extends Exception(text) - -object A extends Reactor[Any] { - override def exceptionHandler = { - case MyException(text) => - println("receiver handles exception") - } - - def guard(): Boolean = - if (state == 0) { - state = 1 - throw MyException("illegal state") - } else - true - - var state = 0 - - def act() { - try { - loop { - react { - case 'hello if guard() => - println("process") - exit() - } - } - } catch { - case e: Throwable if (!e.isInstanceOf[scala.util.control.ControlThrowable] && - !e.isInstanceOf[MyException]) => - e.printStackTrace() - } - } -} - -object B extends Reactor[Any] { - def act() { - try { - A.start() - A ! 'hello - A ! 'hello - } catch { - case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] => - e.printStackTrace() - } - } -} - - def main(args: Array[String]) { - B.start() - } -} diff --git a/test/files/jvm/reactor-producer-consumer.check b/test/files/jvm/reactor-producer-consumer.check deleted file mode 100644 index d971cea19e..0000000000 --- a/test/files/jvm/reactor-producer-consumer.check +++ /dev/null @@ -1,10 +0,0 @@ -42 -42 -42 -42 -42 -42 -42 -42 -42 -42 diff --git a/test/files/jvm/reactor-producer-consumer.scala b/test/files/jvm/reactor-producer-consumer.scala deleted file mode 100644 index ec34febe01..0000000000 --- a/test/files/jvm/reactor-producer-consumer.scala +++ /dev/null @@ -1,97 +0,0 @@ - - -@deprecated("Suppress warnings", since="2.11") -object Test { - import scala.actors.Reactor - case class Stop() - case class Get(from: Reactor[Any]) - case class Put(x: Int) - - class UnboundedBuffer extends Reactor[Any] { - def act() { - try { - react { - case Stop() => - case Get(from) => - val consumer = from - react { - case msg @ Put(x) => - consumer ! x - act() - } - } - } catch { - case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] => - e.printStackTrace() - } - } - } - - class Producer(buf: UnboundedBuffer, n: Int, delay: Long, parent: Reactor[Any]) extends Reactor[Any] { - def act() { - try { - var i = 0 - while (i < n) { - i += 1 - if (delay > 0) Thread.sleep(delay) - buf ! Put(42) - } - parent ! Stop() - } catch { - case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] => - e.printStackTrace() - } - } - } - - class Consumer(buf: UnboundedBuffer, n: Int, delay: Long, parent: Reactor[Any]) extends Reactor[Any] { - val step = n / 10 - var i = 0 - def act() { - try { - if (i < n) { - i += 1 - if (delay > 0) Thread.sleep(delay) - buf ! Get(this) - react { - case res => - if (i % step == 0) - println(res) - act() - } - } else { - parent ! Stop() - } - } catch { - case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] => - e.printStackTrace() - } - } - } - - def main(args: Array[String]) { - val parent = new Reactor[Any] { - def act() { - try { - val buffer = new UnboundedBuffer - buffer.start() - val producer = new Producer(buffer, 10000, 0, this) - producer.start() - val consumer = new Consumer(buffer, 10000, 0, this) - consumer.start() - react { - case Stop() => - react { - case Stop() => - buffer ! Stop() - } - } - } catch { - case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] => - e.printStackTrace() - } - } - } - parent.start() - } -} diff --git a/test/files/jvm/reactor.check b/test/files/jvm/reactor.check deleted file mode 100644 index 7b16085797..0000000000 --- a/test/files/jvm/reactor.check +++ /dev/null @@ -1,22 +0,0 @@ -Pong: ping 0 -Ping: pong -Pong: ping 10000 -Ping: pong -Pong: ping 20000 -Ping: pong -Pong: ping 30000 -Ping: pong -Pong: ping 40000 -Ping: pong -Pong: ping 50000 -Ping: pong -Pong: ping 60000 -Ping: pong -Pong: ping 70000 -Ping: pong -Pong: ping 80000 -Ping: pong -Pong: ping 90000 -Ping: pong -Ping: stop -Pong: stop diff --git a/test/files/jvm/reactor.scala b/test/files/jvm/reactor.scala deleted file mode 100644 index 91ded27f07..0000000000 --- a/test/files/jvm/reactor.scala +++ /dev/null @@ -1,72 +0,0 @@ -/** - * Ping pong example for Reactor. - * - * @author Philipp Haller - */ - -@deprecated("Suppress warnings", since="2.11") -object Test { - -import scala.actors.Reactor - -case class Ping(from: Reactor[Any]) -case object Pong -case object Stop - - def main(args: Array[String]) { - val pong = new PongActor - val ping = new PingActor(100000, pong) - ping.start - pong.start - } - -class PingActor(count: Int, pong: Reactor[Any]) extends Reactor[Any] { - def act() { - try { - var pingsLeft = count - 1 - pong ! Ping(this) - loop { - react { - case Pong => - if (pingsLeft % 10000 == 0) - println("Ping: pong") - if (pingsLeft > 0) { - pong ! Ping(this) - pingsLeft -= 1 - } else { - println("Ping: stop") - pong ! Stop - exit() - } - } - } - } catch { - case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] => - e.printStackTrace() - } - } -} - -class PongActor extends Reactor[Any] { - def act() { - try { - var pongCount = 0 - loop { - react { - case Ping(from) => - if (pongCount % 10000 == 0) - println("Pong: ping "+pongCount) - from ! Pong - pongCount += 1 - case Stop => - println("Pong: stop") - exit() - } - } - } catch { - case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] => - e.printStackTrace() - } - } -} -} diff --git a/test/files/jvm/replyablereactor.check b/test/files/jvm/replyablereactor.check deleted file mode 100644 index 0944b17279..0000000000 --- a/test/files/jvm/replyablereactor.check +++ /dev/null @@ -1,5 +0,0 @@ -'hello -'hello -'hello -'hello -'hello diff --git a/test/files/jvm/replyablereactor.scala b/test/files/jvm/replyablereactor.scala deleted file mode 100644 index 4c4e13d9ab..0000000000 --- a/test/files/jvm/replyablereactor.scala +++ /dev/null @@ -1,59 +0,0 @@ - - -@deprecated("Suppress warnings", since="2.11") -object Test { -import scala.actors.ReplyReactor - -class MyActor extends ReplyReactor { - def act() { - try { - loop { - react { - case 'hello => - sender ! 'hello - case 'stop => - exit() - } - } - } catch { - case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] => - e.printStackTrace() - } - } -} - - def main(args: Array[String]) { - val a = new MyActor - a.start() - - val b = new ReplyReactor { - def act() { - try { - react { - case r: MyActor => - var i = 0 - loop { - i += 1 - val ft = r !! 'hello - ft.inputChannel.react { - case msg => - if (i % 10000 == 0) - println(msg) - if (i >= 50000) { - r ! 'stop - exit() - } - } - } - } - } catch { - case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] => - e.printStackTrace() - } - } - } - b.start() - - b ! a - } -} diff --git a/test/files/jvm/replyablereactor2.check b/test/files/jvm/replyablereactor2.check deleted file mode 100644 index 0944b17279..0000000000 --- a/test/files/jvm/replyablereactor2.check +++ /dev/null @@ -1,5 +0,0 @@ -'hello -'hello -'hello -'hello -'hello diff --git a/test/files/jvm/replyablereactor2.scala b/test/files/jvm/replyablereactor2.scala deleted file mode 100644 index 21f33cce56..0000000000 --- a/test/files/jvm/replyablereactor2.scala +++ /dev/null @@ -1,58 +0,0 @@ - - -@deprecated("Suppress warnings", since="2.11") -object Test { -import scala.actors._ -import scala.actors.Actor._ - -class MyActor extends ReplyReactor { - def act() { - try { - loop { - react { - case 'hello => - sender ! 'hello - case 'stop => - exit() - } - } - } catch { - case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] => - e.printStackTrace() - } - } -} - - def main(args: Array[String]) { - val a = new MyActor - a.start() - - val b = new Reactor[Any] { - def act() { - try { - react { - case r: MyActor => - var i = 0 - loop { - i += 1 - val ft = r !! 'hello - val msg = ft() - if (i % 10000 == 0) - println(msg) - if (i >= 50000) { - r ! 'stop - exit() - } - } - } - } catch { - case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] => - e.printStackTrace() - } - } - } - b.start() - - b ! a - } -} diff --git a/test/files/jvm/replyablereactor3.check b/test/files/jvm/replyablereactor3.check deleted file mode 100644 index 0944b17279..0000000000 --- a/test/files/jvm/replyablereactor3.check +++ /dev/null @@ -1,5 +0,0 @@ -'hello -'hello -'hello -'hello -'hello diff --git a/test/files/jvm/replyablereactor3.scala b/test/files/jvm/replyablereactor3.scala deleted file mode 100644 index 5810ed053f..0000000000 --- a/test/files/jvm/replyablereactor3.scala +++ /dev/null @@ -1,57 +0,0 @@ - - -@deprecated("Suppress warnings", since="2.11") -object Test { -import scala.actors._ -import scala.actors.Actor._ - -class MyActor extends ReplyReactor { - def act() { - try { - loop { - react { - case 'hello => - sender ! 'hello - case 'stop => - exit() - } - } - } catch { - case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] => - e.printStackTrace() - } - } -} - - def main(args: Array[String]) { - val a = new MyActor - a.start() - - val b = new Reactor[Any] { - def act() { - try { - react { - case r: MyActor => - var i = 0 - loop { - i += 1 - val msg = r !? 'hello - if (i % 10000 == 0) - println(msg) - if (i >= 50000) { - r ! 'stop - exit() - } - } - } - } catch { - case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] => - e.printStackTrace() - } - } - } - b.start() - - b ! a - } -} diff --git a/test/files/jvm/replyablereactor4.check b/test/files/jvm/replyablereactor4.check deleted file mode 100644 index cac0fffe3b..0000000000 --- a/test/files/jvm/replyablereactor4.check +++ /dev/null @@ -1,5 +0,0 @@ -Some('hello) -Some('hello) -Some('hello) -Some('hello) -Some('hello) diff --git a/test/files/jvm/replyablereactor4.scala b/test/files/jvm/replyablereactor4.scala deleted file mode 100644 index 95d63684dd..0000000000 --- a/test/files/jvm/replyablereactor4.scala +++ /dev/null @@ -1,57 +0,0 @@ - - -@deprecated("Suppress warnings", since="2.11") -object Test { -import scala.actors._ -import scala.actors.Actor._ - -class MyActor extends ReplyReactor { - def act() { - try { - loop { - react { - case 'hello => - sender ! 'hello - case 'stop => - exit() - } - } - } catch { - case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] => - e.printStackTrace() - } - } -} - - def main(args: Array[String]) { - val a = new MyActor - a.start() - - val b = new Reactor[Any] { - def act() { - try { - react { - case r: MyActor => - var i = 0 - loop { - i += 1 - val msg = r !? (500, 'hello) - if (i % 200000 == 0) - println(msg) - if (i >= 1000000) { - r ! 'stop - exit() - } - } - } - } catch { - case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] => - e.printStackTrace() - } - } - } - b.start() - - b ! a - } -} diff --git a/test/files/jvm/replyreactor-react-sender.check b/test/files/jvm/replyreactor-react-sender.check deleted file mode 100644 index d86bac9de5..0000000000 --- a/test/files/jvm/replyreactor-react-sender.check +++ /dev/null @@ -1 +0,0 @@ -OK diff --git a/test/files/jvm/replyreactor-react-sender.scala b/test/files/jvm/replyreactor-react-sender.scala deleted file mode 100644 index fdcea09035..0000000000 --- a/test/files/jvm/replyreactor-react-sender.scala +++ /dev/null @@ -1,53 +0,0 @@ - - -@deprecated("Suppress warnings", since="2.11") -object Test { - import scala.actors.ReplyReactor - import scala.actors.Actor._ - - val NUM = 2000 - - def main(args: Array[String]) { - var b: ReplyReactor = null - - val a = new ReplyReactor { - def act() { - try { - var i = 0 - loopWhile (i < NUM) { - i += 1 - react { - case 'hello if sender == this => b ! 'fail - case 'hello if sender == b => // do nothing - } - } andThen { - b ! 'ok - } - } catch { - case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] => - e.printStackTrace() - } - } - } - a.start() - - b = new ReplyReactor { - def act() { - try { - for (_ <- 0 until NUM) - a ! 'hello - react { - case 'fail => println("FAIL") - case 'ok => println("OK") - case other => println(other) - } - } catch { - case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] => - e.printStackTrace() - } - } - } - b.start() - } - -} diff --git a/test/files/jvm/replyreactor.check b/test/files/jvm/replyreactor.check deleted file mode 100644 index 4b2fea867a..0000000000 --- a/test/files/jvm/replyreactor.check +++ /dev/null @@ -1 +0,0 @@ -'hello diff --git a/test/files/jvm/replyreactor.scala b/test/files/jvm/replyreactor.scala deleted file mode 100644 index 7512fb0eb2..0000000000 --- a/test/files/jvm/replyreactor.scala +++ /dev/null @@ -1,43 +0,0 @@ - - -@deprecated("Suppress warnings", since="2.11") -object Test { - import scala.actors.ReplyReactor - def main(args: Array[String]) { - val a = new ReplyReactor { - def act() { - try { - react { - case 'hello => - sender ! 'hello - } - } catch { - case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] => - e.printStackTrace() - } - } - } - a.start() - - val b = new ReplyReactor { - def act() { - try { - react { - case r: ReplyReactor => - r ! 'hello - react { - case any => - println(any) - } - } - } catch { - case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] => - e.printStackTrace() - } - } - } - b.start() - - b ! a - } -} diff --git a/test/files/jvm/scheduler-adapter.check b/test/files/jvm/scheduler-adapter.check deleted file mode 100644 index b278674cf0..0000000000 --- a/test/files/jvm/scheduler-adapter.check +++ /dev/null @@ -1,6 +0,0 @@ -before -before -before -Two: received msg -before -One: received msg diff --git a/test/files/jvm/scheduler-adapter.scala b/test/files/jvm/scheduler-adapter.scala deleted file mode 100644 index 1c9cfe7019..0000000000 --- a/test/files/jvm/scheduler-adapter.scala +++ /dev/null @@ -1,54 +0,0 @@ - - -@deprecated("Suppress warnings", since="2.11") -object Test { -import scala.actors.{Actor, SchedulerAdapter} - -trait AdaptedActor extends Actor { - override def scheduler = - Test.adapted -} - -object One extends AdaptedActor { - def act() { - try { - Two.start() - Two ! 'MsgForTwo - react { - case 'MsgForOne => - println("One: received msg") - } - } catch { - case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] => - e.printStackTrace() - } - } -} - -object Two extends AdaptedActor { - def act() { - try { - react { - case 'MsgForTwo => - println("Two: received msg") - One ! 'MsgForOne - } - } catch { - case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] => - e.printStackTrace() - } - } -} - - val adapted = - new SchedulerAdapter { - def execute(block: => Unit) { - println("before") - block - } - } - - def main(args: Array[String]) { - One.start() - } -} diff --git a/test/files/jvm/t1449.check b/test/files/jvm/t1449.check deleted file mode 100644 index d81cc0710e..0000000000 --- a/test/files/jvm/t1449.check +++ /dev/null @@ -1 +0,0 @@ -42 diff --git a/test/files/jvm/t1449.scala b/test/files/jvm/t1449.scala deleted file mode 100644 index 7917d6f6d5..0000000000 --- a/test/files/jvm/t1449.scala +++ /dev/null @@ -1,28 +0,0 @@ - - -@deprecated("Suppress warnings", since="2.11") -object Test { - import scala.actors.Actor._ - import scala.actors.Future - import scala.actors.Futures._ - def main(args: Array[String]) { - val a = actor { - try { - react { - case ft: Future[a] => - println(ft()) - } - } catch { - case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] => - e.printStackTrace() - } - } - try { - val ft = future { 42 } - a ! ft - } catch { - case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] => - e.printStackTrace() - } - } -} diff --git a/test/files/jvm/t1948.scala b/test/files/jvm/t1948.scala deleted file mode 100644 index 95777b8037..0000000000 --- a/test/files/jvm/t1948.scala +++ /dev/null @@ -1,26 +0,0 @@ - - -@deprecated("Suppress warnings", since="2.11") -object Test { - import scala.actors._ - import scala.actors.Actor._ - - def main (args: Array[String]) { - val actors = (1 to 1000).toList map { x => actor { - try { - loop { react { - case x: Array[Int] => reply ("OK"); exit }} - } catch { - case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] => - e.printStackTrace() - } - } } - try { - actors foreach { x => x !? new Array[Int] (1000000) } - } catch { - case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] => - e.printStackTrace() - } - } - -} diff --git a/test/files/jvm/t2359.check b/test/files/jvm/t2359.check deleted file mode 100644 index 8a1218a102..0000000000 --- a/test/files/jvm/t2359.check +++ /dev/null @@ -1,5 +0,0 @@ -1 -2 -3 -4 -5 diff --git a/test/files/jvm/t2359.scala b/test/files/jvm/t2359.scala deleted file mode 100644 index 76b78d44f7..0000000000 --- a/test/files/jvm/t2359.scala +++ /dev/null @@ -1,48 +0,0 @@ - - -@deprecated("Suppress warnings", since="2.11") -object Test { - import scala.actors.Futures._ - def main(args: Array[String]) { - val x = future { - try { - System.out.println(1) - future { - try { - System.out.println(2) - future { - try { - System.out.println(3) - future { - try { - System.out.println(4) - future { - try { - System.out.println(5) - } catch { - case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] => - e.printStackTrace() - } - }() - } catch { - case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] => - e.printStackTrace() - } - }() - } catch { - case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] => - e.printStackTrace() - } - }() - } catch { - case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] => - e.printStackTrace() - } - }() - } catch { - case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] => - e.printStackTrace() - } - }() - } -} diff --git a/test/files/jvm/t2530.check b/test/files/jvm/t2530.check deleted file mode 100644 index 0f1c02158d..0000000000 --- a/test/files/jvm/t2530.check +++ /dev/null @@ -1,21 +0,0 @@ - Iteration 1 succeeded - Iteration 2 succeeded - Iteration 3 succeeded - Iteration 4 succeeded - Iteration 5 succeeded - Iteration 6 succeeded - Iteration 7 succeeded - Iteration 8 succeeded - Iteration 9 succeeded - Iteration 10 succeeded - Iteration 11 succeeded - Iteration 12 succeeded - Iteration 13 succeeded - Iteration 14 succeeded - Iteration 15 succeeded - Iteration 16 succeeded - Iteration 17 succeeded - Iteration 18 succeeded - Iteration 19 succeeded - Iteration 20 succeeded -Test done with no deadlock. Try again, it will not occur... diff --git a/test/files/jvm/t2530.scala b/test/files/jvm/t2530.scala deleted file mode 100644 index b41661e623..0000000000 --- a/test/files/jvm/t2530.scala +++ /dev/null @@ -1,98 +0,0 @@ - - -@deprecated("Suppress warnings", since="2.11") -object Test { - import scala.actors.{Future, Futures} - - def main(args:Array[String]) : Unit = { - //scala.actors.Debug.level = 3 - val size = /*if (args.length > 0) Integer.parseInt(args(0)) else*/ 8 - val (m,n) = (size, size) - def random = (for (i <- 0 until m*n) yield java.lang.Math.random).toArray - val A = Matrix(m, n, random) - val B = Matrix(m, n, random) - val format = new java.text.DecimalFormat("000.00'ms'"); - var iter = 1 - val done = 21 - while (iter < done) { - val start = System.nanoTime() - val result = A * B - val time = System.nanoTime() - start - result match { - case Some(result) => { - printf(" Iteration %2d succeeded %n", iter/*, format.format(time / 1e6)*/) - iter += 1 - } - case None => { - printf(">>>> Iteration %2d failed after %s <<<<< %n", iter, format.format(time / 1e6)) - iter = done - } - } - } - println("Test done with no deadlock. Try again, it will not occur...") - } - -case class Matrix(numRows: Int, numCols: Int, values: Array[Double]) { - - def this(m:Int, n:Int) = this(m, n, new Array[Double](m*n)) - - def offset(i:Int, j:Int) = i * numCols + j - def apply(i:Int, j:Int) = values( offset(i,j) ) - def update(i:Int, j:Int, value:Double) = values(offset(i, j)) = value; - - def *(by:Matrix) = { - val aM = numRows - val aN = numCols - assert(aM == by.numCols) - assert(aN == by.numRows) - val resultMatrix = new Matrix(aM, aM) - val m = aM.asInstanceOf[Int] - val n = aN.asInstanceOf[Int] - - val rows = for (j <- 0 until m) yield { - Futures.future { - try { - val b_j = new Array[Double](n) - var k = 0 - while (k < n) { // sadly, while loops are still faster than for loops - b_j(k) = by(k,j) - k += 1 - } - var i = 0 - while (i < m) { - var s = 0.0d; - k = 0 - while (k < n) { - s += Matrix.this(i,k) * b_j(k) - k += 1 - } - resultMatrix(i,j) = s - i += 1 - } - //printf("future %d of %d completed.%n", j, m) - j - } catch { - case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] => - e.printStackTrace() - } - } - } - - // rows.foreach { x=> x() } // This appears to force sequential execution, so use: - // timeout is 10 years; see http://lampsvn.epfl.ch/trac/scala/ticket/2515 - val done: List[Option[Any]] = try { - Futures.awaitAll(10*365*24*60*60*1000, rows.toArray : _*) // list to array, as varargs. - } catch { - case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] => - e.printStackTrace() - List() - } - - if (done.contains(None)) - None - else - Some(resultMatrix) - } - -} -} diff --git a/test/files/jvm/t3102.check b/test/files/jvm/t3102.check deleted file mode 100644 index d705e0b20e..0000000000 --- a/test/files/jvm/t3102.check +++ /dev/null @@ -1,2 +0,0 @@ -42 -OK diff --git a/test/files/jvm/t3102.scala b/test/files/jvm/t3102.scala deleted file mode 100644 index d0e0704859..0000000000 --- a/test/files/jvm/t3102.scala +++ /dev/null @@ -1,39 +0,0 @@ - - -@deprecated("Suppress warnings", since="2.11") -object Test { - import scala.actors.{Actor, TIMEOUT} - import Actor._ - - def main(args: Array[String]) { - val a = actor { - try { - react { - case 'hello => - reply(42) - } - } catch { - case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] => - e.printStackTrace() - } - } - - val b = actor { - try { - self.trapExit = true - val ft = a !! 'hello - println(ft()) - // no message should be left over in mailbox - reactWithin(0) { - case TIMEOUT => - println("OK") - case any => - println(any) - } - } catch { - case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] => - e.printStackTrace() - } - } - } -} diff --git a/test/files/jvm/t3356.check b/test/files/jvm/t3356.check deleted file mode 100644 index 25f47b70c9..0000000000 --- a/test/files/jvm/t3356.check +++ /dev/null @@ -1,3 +0,0 @@ -sending download requests -Couldn't download image because of java.lang.Exception: no connection -Couldn't download image because of java.lang.Exception: no connection diff --git a/test/files/jvm/t3356.scala b/test/files/jvm/t3356.scala deleted file mode 100644 index 53bfd737cd..0000000000 --- a/test/files/jvm/t3356.scala +++ /dev/null @@ -1,58 +0,0 @@ - - -@deprecated("Suppress warnings", since="2.11") -object Test { -import scala.actors.{Actor, Exit, !, UncaughtException} -import Actor._ - -case class ImageInfo(text: String) { - def downloadImage(): ImageData = { - ImageData(text) - } -} - -case class ImageData(text: String) -case class Download(info: ImageInfo) - - - def scanForImageInfo(url: String): List[ImageInfo] = - List(ImageInfo("A"), ImageInfo("B")) - - def renderImage(data: ImageData) { - println("rendering image "+data.text) - } - - def renderImages(url: String) { - val imageInfos = scanForImageInfo(url) - println("sending download requests") - val dataFutures = for (info <- imageInfos) yield { - val loader = link { - react { case Download(info) => - throw new Exception("no connection") - reply(info.downloadImage()) - }; {} - } - loader !! Download(info) - } - var i = 0 - loopWhile (i < imageInfos.size) { - i += 1 - val FutureInput = dataFutures(i-1).inputChannel - react { - case FutureInput ! (data @ ImageData(_)) => - renderImage(data) - case Exit(from, UncaughtException(_, Some(Download(info)), _, _, cause)) => - println("Couldn't download image because of "+cause) - } - } - println("OK, all images rendered.") - } - - def main(args: Array[String]) { - actor { - self.trapExit = true - renderImages("panorama.epfl.ch") - } - } - -} diff --git a/test/files/jvm/t3365.check b/test/files/jvm/t3365.check deleted file mode 100644 index 0944b17279..0000000000 --- a/test/files/jvm/t3365.check +++ /dev/null @@ -1,5 +0,0 @@ -'hello -'hello -'hello -'hello -'hello diff --git a/test/files/jvm/t3365.scala b/test/files/jvm/t3365.scala deleted file mode 100644 index 8321428093..0000000000 --- a/test/files/jvm/t3365.scala +++ /dev/null @@ -1,68 +0,0 @@ - - -@deprecated("Suppress warnings", since="2.11") -object Test { -import scala.actors.{ReplyReactor, Channel, Actor, Future} - -case class ChannelMsg(chan: Channel[Any]) - -class MyActor extends Actor { - def act() { - try { - val chan = new Channel[Any](this) - loop { - react { - case other: ReplyReactor => - other ! ChannelMsg(chan) - loop { - chan.react { - case 'hello => - reply('hello) - case 'stop => - exit() - } - } - } - } - } catch { - case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] => - e.printStackTrace() - } - } -} - - def main(args: Array[String]) { - val a = new MyActor - a.start() - - val b = new Actor { - def act() { - try { - react { - case ChannelMsg(c) => - var i = 0 - loop { - i += 1 - val ft: Future[Any] = c !! 'hello - ft.inputChannel.react { - case msg => - if (i % 10000 == 0) - println(msg) - if (i >= 50000) { - c ! 'stop - exit() - } - } - } - } - } catch { - case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] => - e.printStackTrace() - } - } - } - b.start() - - a ! b - } -} diff --git a/test/files/jvm/t3407.check b/test/files/jvm/t3407.check deleted file mode 100644 index a133c88bbe..0000000000 --- a/test/files/jvm/t3407.check +++ /dev/null @@ -1,10 +0,0 @@ -result: 42 -result: 42 -result: 42 -result: 42 -result: 42 -result: 42 -result: 42 -result: 42 -result: 42 -result: 42 diff --git a/test/files/jvm/t3407.scala b/test/files/jvm/t3407.scala deleted file mode 100644 index 757fa3a438..0000000000 --- a/test/files/jvm/t3407.scala +++ /dev/null @@ -1,21 +0,0 @@ - - -@deprecated("Suppress warnings", since="2.11") -object Test { - import scala.actors._, scala.actors.Actor._ - - def main(args: Array[String]) { - for (i <- 1 to 10) { - val ft = Futures.future { 42 } - println("result: " + ft()) - } - - for (i <- 1 to 10) { - receiveWithin(0) { - case TIMEOUT => - case msg => println("unexpected: " + msg) - } - } - } - -} diff --git a/test/files/jvm/t3412-channel.check b/test/files/jvm/t3412-channel.check deleted file mode 100644 index 954c6e835d..0000000000 --- a/test/files/jvm/t3412-channel.check +++ /dev/null @@ -1,10 +0,0 @@ -6 -6 -6 -6 -6 -6 -6 -6 -6 -6 diff --git a/test/files/jvm/t3412-channel.scala b/test/files/jvm/t3412-channel.scala deleted file mode 100644 index af319d2303..0000000000 --- a/test/files/jvm/t3412-channel.scala +++ /dev/null @@ -1,40 +0,0 @@ - - -@deprecated("Suppress warnings", since="2.11") -object Test { - import scala.actors._, scala.actors.Actor._, scala.actors.Futures._ - - def main(args: Array[String]) { - - actor { - val C: Channel[Int] = new Channel[Int](self) - - def respondAll(fts: List[Future[Int]], cnt: Int): Unit = - fts match { - case List() => C ! 0 - case ft :: rest => - if (cnt % 100 == 0) - println(ft()) - respondAll(rest, cnt + 1) - } - - actor { - val fts = for (_ <- 1 to 1000) - yield C !! (3, {case x: Int => x}) - - actor { - respondAll(fts.toList, 0) - } - } - - loop { - C.react { - case 0 => exit() - case i => reply(i * 2) - } - } - } - - } - -} diff --git a/test/files/jvm/t3412.check b/test/files/jvm/t3412.check deleted file mode 100644 index 954c6e835d..0000000000 --- a/test/files/jvm/t3412.check +++ /dev/null @@ -1,10 +0,0 @@ -6 -6 -6 -6 -6 -6 -6 -6 -6 -6 diff --git a/test/files/jvm/t3412.scala b/test/files/jvm/t3412.scala deleted file mode 100644 index fde6c04cb7..0000000000 --- a/test/files/jvm/t3412.scala +++ /dev/null @@ -1,34 +0,0 @@ - - -@deprecated("Suppress warnings", since="2.11") -object Test { - import scala.actors._, scala.actors.Actor._, scala.actors.Futures._ - - def main(args: Array[String]) { - - val a = actor { - loop { react { - case i: Int => reply(i * 2) - case 'stop => exit() - } } - } - - val fts = for (_ <- 1 to 1000) - yield a !! (3, {case x: Int => x}) - - def respondAll(fts: List[Future[Int]], cnt: Int): Unit = - fts match { - case List() => a ! 'stop - case ft :: rest => - if (cnt % 100 == 0) - println(ft()) - respondAll(rest, cnt + 1) - } - - actor { - respondAll(fts.toList, 0) - } - - } - -} diff --git a/test/files/jvm/t3470.check b/test/files/jvm/t3470.check deleted file mode 100644 index 94cb526756..0000000000 --- a/test/files/jvm/t3470.check +++ /dev/null @@ -1,3 +0,0 @@ -A: started: 1 -A: started: 2 -A: started: 3 diff --git a/test/files/jvm/t3470.scala b/test/files/jvm/t3470.scala deleted file mode 100644 index bcb1d4f8de..0000000000 --- a/test/files/jvm/t3470.scala +++ /dev/null @@ -1,32 +0,0 @@ - - -@deprecated("Suppress warnings", since="2.11") -object Test { - import scala.actors._ - - def expectActorState(a: Reactor[T] forSome { type T }, s: Actor.State.Value) { - var done = false - var i = 0 - while (!done) { - i = i + 1 - if (i == 10) { // only wait for 2 seconds total - println("FAIL ["+a+": expected "+s+"]") - done = true - } - - Thread.sleep(200) - if (a.getState == s) // success - done = true - } - } - - def main(args: Array[String]) { - val a = new Actor { var c = 0; def act() = { c += 1; println("A: started: " + c) } } - a.start() - expectActorState(a, Actor.State.Terminated) - a.restart() - expectActorState(a, Actor.State.Terminated) - a.restart() - } - -} diff --git a/test/files/jvm/t3838.check b/test/files/jvm/t3838.check deleted file mode 100644 index 154227a350..0000000000 --- a/test/files/jvm/t3838.check +++ /dev/null @@ -1 +0,0 @@ -caught java.lang.RuntimeException: unhandled timeout diff --git a/test/files/jvm/t3838.scala b/test/files/jvm/t3838.scala deleted file mode 100644 index a1a71d1049..0000000000 --- a/test/files/jvm/t3838.scala +++ /dev/null @@ -1,17 +0,0 @@ - - -@deprecated("Suppress warnings", since="2.11") -object Test { - import scala.actors.Actor._ - def main(args: Array[String]) { - actor { - try { - receiveWithin(1) { - case str: String => println(str) - } - } catch { - case e: Exception => println("caught "+e) - } - } - } -} -- cgit v1.2.3