diff options
author | Philipp Haller <hallerp@gmail.com> | 2011-12-13 18:33:12 +0100 |
---|---|---|
committer | Philipp Haller <hallerp@gmail.com> | 2011-12-13 18:33:12 +0100 |
commit | 500f451ecef9d64814025b260ae1ab7adc541d75 (patch) | |
tree | 6f89520ea344bec603fbf70aa34a5b7b1ca41a1c /test/files | |
parent | 2d3731c69b69e6a3c2d68c0b18ffa803709d36cd (diff) | |
download | scala-500f451ecef9d64814025b260ae1ab7adc541d75.tar.gz scala-500f451ecef9d64814025b260ae1ab7adc541d75.tar.bz2 scala-500f451ecef9d64814025b260ae1ab7adc541d75.zip |
Add test for recover to Akka TCK
Diffstat (limited to 'test/files')
-rw-r--r-- | test/files/jvm/scala-concurrent-tck-akka.scala | 28 | ||||
-rw-r--r-- | test/files/jvm/scala-concurrent-tck.scala | 1 |
2 files changed, 25 insertions, 4 deletions
diff --git a/test/files/jvm/scala-concurrent-tck-akka.scala b/test/files/jvm/scala-concurrent-tck-akka.scala index 1ef248bda3..dfd906e59e 100644 --- a/test/files/jvm/scala-concurrent-tck-akka.scala +++ b/test/files/jvm/scala-concurrent-tck-akka.scala @@ -188,15 +188,37 @@ trait FutureCombinators extends TestBase { done() } - // recover: stub def testRecoverSuccess(): Unit = once { done => - done() + val cause = new RuntimeException + val f = future { + throw cause + } recover { + case re: RuntimeException => + "recovered" + } onSuccess { case x => + done() + assert(x == "recovered") + } onFailure { case any => + done() + assert(false) + } } def testRecoverFailure(): Unit = once { done => - done() + val cause = new RuntimeException + val f = future { + throw cause + } recover { + case te: TimeoutException => "timeout" + } onSuccess { case x => + done() + assert(false) + } onFailure { case any => + done() + assert(any == cause) + } } testMapSuccess() diff --git a/test/files/jvm/scala-concurrent-tck.scala b/test/files/jvm/scala-concurrent-tck.scala index bf3fa57da9..4261638e1f 100644 --- a/test/files/jvm/scala-concurrent-tck.scala +++ b/test/files/jvm/scala-concurrent-tck.scala @@ -186,7 +186,6 @@ trait FutureCombinators extends TestBase { done() } - // recover: stub def testRecoverSuccess(): Unit = once { done => val cause = new RuntimeException |