diff options
author | Adriaan Moors <adriaan.moors@typesafe.com> | 2015-04-27 10:24:54 -0700 |
---|---|---|
committer | Adriaan Moors <adriaan.moors@typesafe.com> | 2015-04-27 10:24:54 -0700 |
commit | 236ee08ba25ada42b9cddf52a4a7c27158612b39 (patch) | |
tree | f42468f667b9f560d7d668ee96138f74303d80db /test | |
parent | a231f7dea1cff409c62902025f6d1ad76c71bcc5 (diff) | |
parent | 7b54922b77fe1cf40177fc4a5ee9707bb5d854d2 (diff) | |
download | scala-236ee08ba25ada42b9cddf52a4a7c27158612b39.tar.gz scala-236ee08ba25ada42b9cddf52a4a7c27158612b39.tar.bz2 scala-236ee08ba25ada42b9cddf52a4a7c27158612b39.zip |
Merge pull request #4466 from lrytz/2.12-milestone
Prepare for the 2.12.0-M1 release
Diffstat (limited to 'test')
103 files changed, 4 insertions, 2793 deletions
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) - } - } - } -} diff --git a/test/files/pos/MailBox.scala b/test/files/pos/MailBox.scala index 8e27bd362d..6bb25adb19 100644 --- a/test/files/pos/MailBox.scala +++ b/test/files/pos/MailBox.scala @@ -1,6 +1,6 @@ package test; -import scala.actors.TIMEOUT; +object TIMEOUT class MailBox { diff --git a/test/files/pos/functions.scala b/test/files/pos/functions.scala index 0207523dde..25d1c46eac 100644 --- a/test/files/pos/functions.scala +++ b/test/files/pos/functions.scala @@ -1,4 +1,6 @@ -import scala.actors.Actor +object Actor { + def receive[A](f: PartialFunction[Any, A]): A = ??? +} object Test { diff --git a/test/files/pos/t533.scala b/test/files/pos/t533.scala deleted file mode 100644 index 0a6515fed3..0000000000 --- a/test/files/pos/t533.scala +++ /dev/null @@ -1,11 +0,0 @@ -import scala.actors._ - -object test extends Actor { - def act() { - receive { - case TIMEOUT => Console.println("TIMEOUT") - //case _ => Console.println("_") - } - } -} - diff --git a/test/files/run/concurrent-stream.check b/test/files/run/concurrent-stream.check deleted file mode 100644 index d4adf84490..0000000000 --- a/test/files/run/concurrent-stream.check +++ /dev/null @@ -1,3 +0,0 @@ -Testing standard cons. -Evaluation 0: List(0, 1, 2, 3, 4, 5, 6, 7, 8, 9) -Evaluation 1: List(0, 1, 2, 3, 4, 5, 6, 7, 8, 9) diff --git a/test/files/run/concurrent-stream.scala b/test/files/run/concurrent-stream.scala deleted file mode 100644 index 9d5ba0428e..0000000000 --- a/test/files/run/concurrent-stream.scala +++ /dev/null @@ -1,37 +0,0 @@ -// test concurrent calls to Stream.tail -@deprecated("Suppress warnings", since="2.11") -object Test { - - def slowRange(from: Int, until: Int, cons: (Int, => Stream[Int]) => Stream[Int]): Stream[Int] = { - var current = from - def next: Stream[Int] = { - Thread.sleep(100) - if (current >= until) Stream.empty - else { - val stream = cons(current, next) - current += 1 - stream - } - } - next - } - - def testCons(cons: (Int, => Stream[Int]) => Stream[Int]): Unit = { - import scala.actors.Actor._ - - val stream = slowRange(0, 10, cons) - val main = self - actor { main ! stream.toList } - actor { main ! stream.toList } - val eval0 = receive { case list: List[Int @unchecked] => list } - val eval1 = receive { case list: List[Int @unchecked] => list } - println("Evaluation 0: " + eval0) - println("Evaluation 1: " + eval1) - } - - def main(args: Array[String]) { - println("Testing standard cons.") - testCons(Stream.cons.apply(_, _)) - } -} - diff --git a/test/long-running/jvm/memleak2_actor.scala b/test/long-running/jvm/memleak2_actor.scala deleted file mode 100644 index 1673b12dac..0000000000 --- a/test/long-running/jvm/memleak2_actor.scala +++ /dev/null @@ -1,39 +0,0 @@ -import scala.actors._ -import Actor._ - -case object Start -case object EndMe - -class A extends Actor { - def act = loop { - react { - case Start => - case EndMe => - exit() - } - } -} - -object Test { - - def z(in: Long) = if (in / 1024L == 0L) in - else if (in / (1024L * 1024L) == 0L) (in / 1024L).toString + "K" - else (in / (1024L * 1024L)).toString + "M" - - def main(args: Array[String]) { - val rt = Runtime.getRuntime() - for (o <- 1 to 300000) { - println("Outer [2AN] "+o) - var a: List[A] = Nil - for (i <- 1 to 10000) { - var t = new A - a = t :: a - t.start - t ! Start - } - for (act <- a) act ! EndMe - //rt.gc() - println("Free "+z(rt.freeMemory())+" total "+z(rt.totalMemory())) - } - } -} diff --git a/test/pending/jvm/actor-executor4.check b/test/pending/jvm/actor-executor4.check deleted file mode 100644 index da78f45836..0000000000 --- a/test/pending/jvm/actor-executor4.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/pending/jvm/actor-executor4.scala b/test/pending/jvm/actor-executor4.scala deleted file mode 100644 index a912d76094..0000000000 --- a/test/pending/jvm/actor-executor4.scala +++ /dev/null @@ -1,64 +0,0 @@ -import scala.actors.{Actor, Exit} -import scala.actors.scheduler.ExecutorScheduler -import java.util.concurrent.Executors - -object One extends AdaptedActor { - def act() { - 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") - } - } - } -} - -object Two extends AdaptedActor { - def act() { - 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 - } - } - } -} - -trait AdaptedActor extends Actor { - override def scheduler = - Test.scheduler -} - -object Test { - val NUM_MSG = 100000 - - val scheduler = - ExecutorScheduler( - Executors.newFixedThreadPool(Runtime.getRuntime().availableProcessors()), - false) - - def main(args: Array[String]) { - (new AdaptedActor { - def act() { - trapExit = true - link(One) - One.start() - - receive { - case Exit(from, reason) => - println("One exited") - Test.scheduler.shutdown() - } - } - }).start() - } -} diff --git a/test/pending/jvm/actor-receive-sender.check b/test/pending/jvm/actor-receive-sender.check deleted file mode 100644 index 2c94e48371..0000000000 --- a/test/pending/jvm/actor-receive-sender.check +++ /dev/null @@ -1,2 +0,0 @@ -OK -OK diff --git a/test/pending/jvm/actor-receive-sender.scala b/test/pending/jvm/actor-receive-sender.scala deleted file mode 100644 index ea7c40cced..0000000000 --- a/test/pending/jvm/actor-receive-sender.scala +++ /dev/null @@ -1,51 +0,0 @@ -import scala.actors.{Actor, TIMEOUT, Exit} -import scala.actors.Actor._ - -object Test { - - val NUM = 2000 - - def main(args: Array[String]) { - var b: Actor = null - var c: Actor = null - - val a = actor { - for (_ <- 0 until NUM) - receive { - case 'hello if sender == b => // do nothing - } - b ! 'ok - for (_ <- 0 until NUM) - receiveWithin (1000) { - case 'bye if sender == b => // do nothing - case TIMEOUT => b ! 'fail - } - b ! 'ok - } - - b = actor { - self.trapExit = true - link(a) - - for (_ <- 0 until NUM) - a ! 'hello - - val proceed = receive { - case Exit(from, reason) => println("FAIL"); false - case 'ok => println("OK"); true - case other => println(other); false - } - - if (proceed) { - for (_ <- 0 until NUM) - a ! 'bye - receive { - case Exit(from, reason) => println("FAIL") - case 'ok => println("OK") - case other => println(other) - } - } - } - } - -} diff --git a/test/pending/jvm/actorgc_leak.check b/test/pending/jvm/actorgc_leak.check deleted file mode 100644 index a965a70ed4..0000000000 --- a/test/pending/jvm/actorgc_leak.check +++ /dev/null @@ -1 +0,0 @@ -Done diff --git a/test/pending/jvm/actorgc_leak.scala b/test/pending/jvm/actorgc_leak.scala deleted file mode 100644 index de3e04f1e8..0000000000 --- a/test/pending/jvm/actorgc_leak.scala +++ /dev/null @@ -1,63 +0,0 @@ - -import scala.actors.Actor - -object Test { - class FatActorFactory extends Actor { - def act() { - var cnt = 0 - Actor.loopWhile(cnt < fatActors) { - //if ((cnt % 5) == 0) println(cnt) - val fa = new FatActor() - fa.start() - cnt += 1 - if (cnt == fatActors) Monitor ! 'done - } - } - } - - class FatActor extends Actor { - def act() { - fat = new Array[Int](fatness) - react { - case 'hi => exit() - } - } - private var fat: Array[Int] = _ - } - - object Monitor extends Actor { - private var cnt = 0 - def act() { - Actor.loop { - react { - case 'done => { - cnt += 1 - if (cnt == factories) System.exit(0) // once GC pressure stops FatActors stop being collected, and as - } // a result ActorGC never finds out that they are defunct - } - } - } - } - - val factories = 4 // the number of factories to start - val fatActors = 50 // the number of FatActors for each factory to produce - val fatness = 1024*1024*10 - - def main(args: Array[String]) { - scala.actors.Scheduler.impl.shutdown() - val sched = { - val s = new scala.actors.FJTaskScheduler2 - s.start() - s - } - scala.actors.Scheduler.impl = sched - - Monitor.start() - for(i <- 1 to factories) { - //if ((i % 50) == 0) println(i) - val fa = new FatActorFactory() - fa.start() - } - println("Done") - } -} diff --git a/test/pending/jvm/reactWithinZero.check b/test/pending/jvm/reactWithinZero.check deleted file mode 100644 index cf2a2facf9..0000000000 --- a/test/pending/jvm/reactWithinZero.check +++ /dev/null @@ -1,2 +0,0 @@ -TIMEOUT -'ack diff --git a/test/pending/jvm/reactWithinZero.scala b/test/pending/jvm/reactWithinZero.scala deleted file mode 100644 index 0786ce271d..0000000000 --- a/test/pending/jvm/reactWithinZero.scala +++ /dev/null @@ -1,18 +0,0 @@ -import scala.actors.{Actor, TIMEOUT} - -class A extends Actor { - def act() = reactWithin(0) { - case TIMEOUT => - println("TIMEOUT") - reply('ack) - act() - case x => println(x) - } -} - -object Test { - def main(args: Array[String]): Unit = { - val a = new A - a.start() - } -} diff --git a/test/pending/jvm/receiveWithinZero.check b/test/pending/jvm/receiveWithinZero.check deleted file mode 100644 index cf2a2facf9..0000000000 --- a/test/pending/jvm/receiveWithinZero.check +++ /dev/null @@ -1,2 +0,0 @@ -TIMEOUT -'ack diff --git a/test/pending/jvm/receiveWithinZero.scala b/test/pending/jvm/receiveWithinZero.scala deleted file mode 100644 index 315dd9c86a..0000000000 --- a/test/pending/jvm/receiveWithinZero.scala +++ /dev/null @@ -1,18 +0,0 @@ -import scala.actors.{Actor, TIMEOUT} - -class A extends Actor { - def act() = receiveWithin(0) { - case TIMEOUT => - println("TIMEOUT") - reply('ack) - act() - case x => println(x) - } -} - -object Test { - def main(args: Array[String]): Unit = { - val a = new A - a.start() - } -} diff --git a/test/pending/jvm/t1801.check b/test/pending/jvm/t1801.check deleted file mode 100644 index bf78a99db9..0000000000 --- a/test/pending/jvm/t1801.check +++ /dev/null @@ -1,6 +0,0 @@ -0 -100 -200 -300 -400 -done! diff --git a/test/pending/jvm/t1801.scala b/test/pending/jvm/t1801.scala deleted file mode 100644 index 6ed7c56336..0000000000 --- a/test/pending/jvm/t1801.scala +++ /dev/null @@ -1,31 +0,0 @@ -import scala.actors.Actor._ - -object Test { - val rt = Runtime.getRuntime() - val sender = actor { - var cnt = 0 - while(cnt < 500) { - if ((cnt % 100) == 0) println(cnt) - receiver ! new Array[Int] (148576) - cnt += 1 - //println ("Used Mem: " + (((rt.totalMemory() - rt.freeMemory()) / 1048576.) formatted "%.2f") + " Mb") - } - receiver ! 'exit - } - - val receiver = actor { - loop { - react { - case x: Array[Int] => ()//println ("received " + x.length) - case 'exit => { - println("done!") - exit() - } - } - } - } - - def main (args: Array[String]) { - sender - } -} diff --git a/test/pending/jvm/t2515.check b/test/pending/jvm/t2515.check deleted file mode 100644 index 8cb8bde11e..0000000000 --- a/test/pending/jvm/t2515.check +++ /dev/null @@ -1,10 +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 diff --git a/test/pending/jvm/t2515.scala b/test/pending/jvm/t2515.scala deleted file mode 100644 index ee655967f3..0000000000 --- a/test/pending/jvm/t2515.scala +++ /dev/null @@ -1,43 +0,0 @@ -import scala.actors.{Futures, TIMEOUT} -import scala.actors.Actor._ - -object Test { - - def compute(): Option[Boolean] = { - val fts = for (j <- 0 until 5) yield Futures.future { - receiveWithin (100) { - case TIMEOUT => true - case other => false - } - } - val done = Futures.awaitAll(2000, fts.toArray: _*) // list to array, as varargs - if (done.contains(None)) - None - else - Some(true) - } - - def main(args:Array[String]) : Unit = { - val ft = Futures.future { - val format = new java.text.DecimalFormat("000.00'ms'") - var iter = 1 - val done = 11 - while (iter < done) { - val start = System.nanoTime() - val result = compute() - val time = System.nanoTime() - start - result match { - case Some(result) => - //printf("Iteration %2d succeeded after %s %n", iter, format.format(time / 1e6)) - printf("Iteration %2d succeeded%n", iter) - iter += 1 - case None => - printf(">>>> Iteration %2d failed after %s <<<<< %n", iter, format.format(time / 1e6)) - iter = done - } - } - } - ft() - } - -} diff --git a/test/pending/jvm/terminateLinked.check b/test/pending/jvm/terminateLinked.check deleted file mode 100644 index a965a70ed4..0000000000 --- a/test/pending/jvm/terminateLinked.check +++ /dev/null @@ -1 +0,0 @@ -Done diff --git a/test/pending/jvm/terminateLinked.scala b/test/pending/jvm/terminateLinked.scala deleted file mode 100644 index 2a3b7fb49e..0000000000 --- a/test/pending/jvm/terminateLinked.scala +++ /dev/null @@ -1,24 +0,0 @@ -import scala.actors.Actor -import Actor._ - -object Test { - def main(args: Array[String]) { - val a = actor { - for (_ <- 1 to 10) - receive { - case b: Actor => link(b) - } - throw new Exception - } - - for (_ <- 1 to 10) - actor { - a ! self - react { - case _ => - } - } - - println("Done") - } -} diff --git a/test/pending/jvm/timeout.check b/test/pending/jvm/timeout.check deleted file mode 100644 index d86bac9de5..0000000000 --- a/test/pending/jvm/timeout.check +++ /dev/null @@ -1 +0,0 @@ -OK diff --git a/test/pending/jvm/timeout.scala b/test/pending/jvm/timeout.scala deleted file mode 100644 index 8f29f8ddbe..0000000000 --- a/test/pending/jvm/timeout.scala +++ /dev/null @@ -1,38 +0,0 @@ -// Test is in pending because although it succeeds locally, -// it takes too long on the machine which runs nightly tests. -// -// [partest] EXPECTED: 100 < x < 900 -// [partest] ACTUAL: 1519 - -import scala.actors.Actor._ -import scala.actors.TIMEOUT - -object Test extends Application { - case class Timing(time: Long) - - actor { - val a = actor { - react { - case 'doTiming => - val s = sender - reactWithin(500) { - case TIMEOUT => - s ! Timing(System.currentTimeMillis) - } - } - } - - val start = System.currentTimeMillis - (a !? 'doTiming) match { - case Timing(end) => - val delay = end - start - - if (delay > 100 && delay < 900) - println("OK") - else { - println("EXPECTED: 100 < x < 900") - println("ACTUAL: "+delay) - } - } - } -} diff --git a/test/pending/run/t5698/client.scala b/test/pending/run/t5698/client.scala deleted file mode 100644 index de672c1809..0000000000 --- a/test/pending/run/t5698/client.scala +++ /dev/null @@ -1,9 +0,0 @@ -package client - - - -object Client extends App { - val peer = actors.remote.Node("localhost", 23456) - val a = actors.remote.RemoteActor.select(peer, 'test) - a ! server.TestMsg -} diff --git a/test/pending/run/t5698/server.scala b/test/pending/run/t5698/server.scala deleted file mode 100644 index e8f3cea225..0000000000 --- a/test/pending/run/t5698/server.scala +++ /dev/null @@ -1,22 +0,0 @@ -package server - - - -object Server extends App { - - class ServerActor extends actors.Actor { - def act() { - actors.remote.RemoteActor.alive(23456) - actors.remote.RemoteActor.register('test, actors.Actor.self) - loop { - react { - case TestMsg => println("Yay!") - } - } - } - } - - val a = new ServerActor - a.start() - -} diff --git a/test/pending/run/t5698/testmsg.scala b/test/pending/run/t5698/testmsg.scala deleted file mode 100644 index 004ff0b8c7..0000000000 --- a/test/pending/run/t5698/testmsg.scala +++ /dev/null @@ -1,5 +0,0 @@ -package server - - - -case object TestMsg |