summaryrefslogtreecommitdiff
path: root/test/files/jvm/actor-executor2.scala
diff options
context:
space:
mode:
authorPhilipp Haller <hallerp@gmail.com>2010-07-12 11:49:28 +0000
committerPhilipp Haller <hallerp@gmail.com>2010-07-12 11:49:28 +0000
commita012c4c92010b640e3448593a948aa5bf3f37950 (patch)
tree82406dbe8734830a1fb11efd5fdab5d46d331589 /test/files/jvm/actor-executor2.scala
parentb05c0fa47d2c895347c0600858e814707f169327 (diff)
downloadscala-a012c4c92010b640e3448593a948aa5bf3f37950.tar.gz
scala-a012c4c92010b640e3448593a948aa5bf3f37950.tar.bz2
scala-a012c4c92010b640e3448593a948aa5bf3f37950.zip
Fixed buggy test case. Closes #3551. No review.
Diffstat (limited to 'test/files/jvm/actor-executor2.scala')
-rw-r--r--test/files/jvm/actor-executor2.scala12
1 files changed, 9 insertions, 3 deletions
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
+ }
}
}