diff options
Diffstat (limited to 'test/disabled/jvm')
-rw-r--r-- | test/disabled/jvm/actor-getstate.check | 2 | ||||
-rw-r--r-- | test/disabled/jvm/actor-getstate.scala | 85 | ||||
-rw-r--r-- | test/disabled/jvm/actor-receivewithin.check | 16 | ||||
-rw-r--r-- | test/disabled/jvm/actor-receivewithin.scala | 69 |
4 files changed, 0 insertions, 172 deletions
diff --git a/test/disabled/jvm/actor-getstate.check b/test/disabled/jvm/actor-getstate.check deleted file mode 100644 index 2c94e48371..0000000000 --- a/test/disabled/jvm/actor-getstate.check +++ /dev/null @@ -1,2 +0,0 @@ -OK -OK diff --git a/test/disabled/jvm/actor-getstate.scala b/test/disabled/jvm/actor-getstate.scala deleted file mode 100644 index a6e15a8721..0000000000 --- a/test/disabled/jvm/actor-getstate.scala +++ /dev/null @@ -1,85 +0,0 @@ -import scala.actors.{Reactor, Actor, TIMEOUT} -import Actor._ - -object Test { - - 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/disabled/jvm/actor-receivewithin.check b/test/disabled/jvm/actor-receivewithin.check deleted file mode 100644 index a6a3e88c61..0000000000 --- a/test/disabled/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/disabled/jvm/actor-receivewithin.scala b/test/disabled/jvm/actor-receivewithin.scala deleted file mode 100644 index a5c87c2722..0000000000 --- a/test/disabled/jvm/actor-receivewithin.scala +++ /dev/null @@ -1,69 +0,0 @@ -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 - } - } -} - -object Test { - def main(args:Array[String]) { - B.start() - } -} |