From 3826ab49382bac0392eff859d2865e8a3675a011 Mon Sep 17 00:00:00 2001 From: Paul Phillips Date: Tue, 6 Oct 2009 20:52:57 +0000 Subject: Disabled an actor test which is hanging the tes... Disabled an actor test which is hanging the test suite. --- test/disabled/jvm/reactor-exceptionOnSend.check | 2 ++ test/disabled/jvm/reactor-exceptionOnSend.scala | 44 +++++++++++++++++++++++++ 2 files changed, 46 insertions(+) create mode 100644 test/disabled/jvm/reactor-exceptionOnSend.check create mode 100644 test/disabled/jvm/reactor-exceptionOnSend.scala (limited to 'test/disabled') diff --git a/test/disabled/jvm/reactor-exceptionOnSend.check b/test/disabled/jvm/reactor-exceptionOnSend.check new file mode 100644 index 0000000000..45d62e26a7 --- /dev/null +++ b/test/disabled/jvm/reactor-exceptionOnSend.check @@ -0,0 +1,2 @@ +receiver handles exception +process diff --git a/test/disabled/jvm/reactor-exceptionOnSend.scala b/test/disabled/jvm/reactor-exceptionOnSend.scala new file mode 100644 index 0000000000..3684943b9b --- /dev/null +++ b/test/disabled/jvm/reactor-exceptionOnSend.scala @@ -0,0 +1,44 @@ +import scala.actors.Reactor +import scala.actors.Actor._ + +case class MyException(text: String) extends Exception(text) + +object A extends Reactor { + 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() { + loop { + react { + case 'hello if guard() => + println("process") + exit() + } + } + } +} + +object B extends Reactor { + def act() { + A.start() + A ! 'hello + A ! 'hello + } +} + +object Test { + def main(args: Array[String]) { + B.start() + } +} -- cgit v1.2.3