summaryrefslogtreecommitdiff
path: root/test/files/jvm/actor-uncaught-exception.scala
diff options
context:
space:
mode:
authorPhilipp Haller <hallerp@gmail.com>2010-04-13 14:41:02 +0000
committerPhilipp Haller <hallerp@gmail.com>2010-04-13 14:41:02 +0000
commitbc791369f79f2d1a72a93674eb7b0f34ca58d8d1 (patch)
treea29f5941272cbe318f67f446d8202156da0ecf06 /test/files/jvm/actor-uncaught-exception.scala
parentc54b7a99e8a4913ceee3f40631edba72c33145ec (diff)
downloadscala-bc791369f79f2d1a72a93674eb7b0f34ca58d8d1.tar.gz
scala-bc791369f79f2d1a72a93674eb7b0f34ca58d8d1.tar.bz2
scala-bc791369f79f2d1a72a93674eb7b0f34ca58d8d1.zip
Hardened actor tests. No review.
Diffstat (limited to 'test/files/jvm/actor-uncaught-exception.scala')
-rw-r--r--test/files/jvm/actor-uncaught-exception.scala16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/files/jvm/actor-uncaught-exception.scala b/test/files/jvm/actor-uncaught-exception.scala
index 9f64be26e1..9dbd36dd82 100644
--- a/test/files/jvm/actor-uncaught-exception.scala
+++ b/test/files/jvm/actor-uncaught-exception.scala
@@ -8,20 +8,32 @@ object Test {
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)
@@ -37,6 +49,10 @@ object Test {
exit()
}
}
+ } catch {
+ case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] =>
+ e.printStackTrace()
+ }
}
}