From a012c4c92010b640e3448593a948aa5bf3f37950 Mon Sep 17 00:00:00 2001 From: Philipp Haller Date: Mon, 12 Jul 2010 11:49:28 +0000 Subject: Fixed buggy test case. Closes #3551. No review. --- test/files/jvm/actor-executor2.scala | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'test/files/jvm/actor-executor2.scala') diff --git a/test/files/jvm/actor-executor2.scala b/test/files/jvm/actor-executor2.scala index da64a7fc43..f8fcaef69f 100644 --- a/test/files/jvm/actor-executor2.scala +++ b/test/files/jvm/actor-executor2.scala @@ -1,6 +1,6 @@ import scala.actors.{Actor, SchedulerAdapter, Exit} import Actor._ -import java.util.concurrent.Executors +import java.util.concurrent.{Executors, RejectedExecutionException} object One extends AdaptedActor { def act() { @@ -57,9 +57,15 @@ object Test { val scheduler = new SchedulerAdapter { def execute(block: => Unit) { - executor.execute(new Runnable { + val task = new Runnable { def run() { block } - }) + } + try { + executor.execute(task) + } catch { + case ree: RejectedExecutionException => + task.run() // run task on current thread + } } } -- cgit v1.2.3