diff options
author | Lukas Rytz <lukas.rytz@gmail.com> | 2015-04-21 14:49:58 +0200 |
---|---|---|
committer | Lukas Rytz <lukas.rytz@gmail.com> | 2015-04-23 09:58:22 +0200 |
commit | 5b73e75943dd89dabda84b0fc3a651837c4a2113 (patch) | |
tree | 761bc0b25004c4edd7d89f500fac13b50d868406 /test/pending/jvm | |
parent | 9cba434b228e33f62e01460abe186fb56038a70e (diff) | |
download | scala-5b73e75943dd89dabda84b0fc3a651837c4a2113.tar.gz scala-5b73e75943dd89dabda84b0fc3a651837c4a2113.tar.bz2 scala-5b73e75943dd89dabda84b0fc3a651837c4a2113.zip |
Remove scala.actors and the actors migration module dependency
Diffstat (limited to 'test/pending/jvm')
-rw-r--r-- | test/pending/jvm/actor-executor4.check | 21 | ||||
-rw-r--r-- | test/pending/jvm/actor-executor4.scala | 64 | ||||
-rw-r--r-- | test/pending/jvm/actor-receive-sender.check | 2 | ||||
-rw-r--r-- | test/pending/jvm/actor-receive-sender.scala | 51 | ||||
-rw-r--r-- | test/pending/jvm/actorgc_leak.check | 1 | ||||
-rw-r--r-- | test/pending/jvm/actorgc_leak.scala | 63 | ||||
-rw-r--r-- | test/pending/jvm/reactWithinZero.check | 2 | ||||
-rw-r--r-- | test/pending/jvm/reactWithinZero.scala | 18 | ||||
-rw-r--r-- | test/pending/jvm/receiveWithinZero.check | 2 | ||||
-rw-r--r-- | test/pending/jvm/receiveWithinZero.scala | 18 | ||||
-rw-r--r-- | test/pending/jvm/t1801.check | 6 | ||||
-rw-r--r-- | test/pending/jvm/t1801.scala | 31 | ||||
-rw-r--r-- | test/pending/jvm/t2515.check | 10 | ||||
-rw-r--r-- | test/pending/jvm/t2515.scala | 43 | ||||
-rw-r--r-- | test/pending/jvm/terminateLinked.check | 1 | ||||
-rw-r--r-- | test/pending/jvm/terminateLinked.scala | 24 | ||||
-rw-r--r-- | test/pending/jvm/timeout.check | 1 | ||||
-rw-r--r-- | test/pending/jvm/timeout.scala | 38 |
18 files changed, 0 insertions, 396 deletions
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) - } - } - } -} |