diff options
author | Adriaan Moors <adriaan.moors@typesafe.com> | 2013-02-02 12:21:44 -0800 |
---|---|---|
committer | Adriaan Moors <adriaan.moors@typesafe.com> | 2013-02-02 12:21:44 -0800 |
commit | 0bb743170377ba6e110990d6d0fff764ce1fd153 (patch) | |
tree | 67ff511e6facf249c2448ee78e90275d0af06085 /test/files/jvm | |
parent | ad2a69e313eb1ad25d44d42cbb34b1be086c3358 (diff) | |
parent | 5275baee6c563418f53abd2486764be08916c8c5 (diff) | |
download | scala-0bb743170377ba6e110990d6d0fff764ce1fd153.tar.gz scala-0bb743170377ba6e110990d6d0fff764ce1fd153.tar.bz2 scala-0bb743170377ba6e110990d6d0fff764ce1fd153.zip |
Merge pull request #2044 from phaller/issue/7029
SI-7029 - Makes sure that uncaught exceptions are propagated to the UEH ...
Diffstat (limited to 'test/files/jvm')
-rw-r--r-- | test/files/jvm/future-spec/FutureTests.scala | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/test/files/jvm/future-spec/FutureTests.scala b/test/files/jvm/future-spec/FutureTests.scala index 8674be168c..0efa83fbd9 100644 --- a/test/files/jvm/future-spec/FutureTests.scala +++ b/test/files/jvm/future-spec/FutureTests.scala @@ -70,7 +70,19 @@ object FutureTests extends MinimalScalaTest { //FIXME should check } } - + + "The default ExecutionContext" should { + "report uncaught exceptions" in { + val p = Promise[Throwable]() + val logThrowable: Throwable => Unit = p.trySuccess(_) + val ec: ExecutionContext = ExecutionContext.fromExecutor(null, logThrowable) + + val t = new NotImplementedError("foo") + val f = Future(throw t)(ec) + Await.result(p.future, 2.seconds) mustBe t + } + } + "A future with global ExecutionContext" should { import ExecutionContext.Implicits._ |