summaryrefslogtreecommitdiff
path: root/test/disabled/jvm
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2012-04-12 15:19:27 +0100
committerPaul Phillips <paulp@improving.org>2012-04-12 15:22:20 +0100
commitf9e8a8c13ff6f75f330766ae6e0febe431fc4b12 (patch)
tree2f61037ff9324c8b31ea5aab463386d9cc270f52 /test/disabled/jvm
parentdf0bb47a56f95db1f1aebb84b689d40d5e1f717a (diff)
downloadscala-f9e8a8c13ff6f75f330766ae6e0febe431fc4b12.tar.gz
scala-f9e8a8c13ff6f75f330766ae6e0febe431fc4b12.tar.bz2
scala-f9e8a8c13ff6f75f330766ae6e0febe431fc4b12.zip
Disabling failing tests.
I turn them over to the responsible parties. Iulian knows about the deadlock test; for philipp I presume, 07:10:29 [partest] concurrent-future.scala:97: error: not found: type FutureTimeoutException 07:10:29 [partest] throw new FutureTimeoutException(null) 07:10:29 [partest] ^ 07:10:29 [partest] one error found
Diffstat (limited to 'test/disabled/jvm')
-rw-r--r--test/disabled/jvm/concurrent-future.check16
-rw-r--r--test/disabled/jvm/concurrent-future.scala122
2 files changed, 138 insertions, 0 deletions
diff --git a/test/disabled/jvm/concurrent-future.check b/test/disabled/jvm/concurrent-future.check
new file mode 100644
index 0000000000..c55e824818
--- /dev/null
+++ b/test/disabled/jvm/concurrent-future.check
@@ -0,0 +1,16 @@
+test1: hai world
+test1: kthxbye
+test2: hai world
+test2: awsum thx
+test2: kthxbye
+test3: hai world
+test4: hai world
+test4: kthxbye
+test5: hai world
+test5: kthxbye
+test6: hai world
+test6: kthxbye
+test7: hai world
+test7: kthxbye
+test8: hai world
+test8: im in yr loop
diff --git a/test/disabled/jvm/concurrent-future.scala b/test/disabled/jvm/concurrent-future.scala
new file mode 100644
index 0000000000..b44d054219
--- /dev/null
+++ b/test/disabled/jvm/concurrent-future.scala
@@ -0,0 +1,122 @@
+
+
+
+import scala.concurrent._
+
+
+
+object Test extends App {
+
+ def once(body: (() => Unit) => Unit) {
+ val sv = new SyncVar[Boolean]
+ body(() => sv put true)
+ sv.take()
+ }
+
+ def output(num: Int, msg: String) {
+ println("test" + num + ": " + msg)
+ }
+
+ def testOnSuccess(): Unit = once {
+ done =>
+ val f = future {
+ output(1, "hai world")
+ }
+ f onSuccess { case _ =>
+ output(1, "kthxbye")
+ done()
+ }
+ }
+
+ def testOnSuccessWhenCompleted(): Unit = once {
+ done =>
+ val f = future {
+ output(2, "hai world")
+ }
+ f onSuccess { case _ =>
+ output(2, "awsum thx")
+ f onSuccess { case _ =>
+ output(2, "kthxbye")
+ done()
+ }
+ }
+ }
+
+ def testOnSuccessWhenFailed(): Unit = once {
+ done =>
+ val f = future[Unit] {
+ output(3, "hai world")
+ done()
+ throw new Exception
+ }
+ f onSuccess { case _ =>
+ output(3, "onoes")
+ }
+ }
+
+ def testOnFailure(): Unit = once {
+ done =>
+ val f = future[Unit] {
+ output(4, "hai world")
+ throw new Exception
+ }
+ f onSuccess { case _ =>
+ output(4, "onoes")
+ done()
+ }
+ f onFailure { case _ =>
+ output(4, "kthxbye")
+ done()
+ }
+ }
+
+ def testOnFailureWhenSpecialThrowable(num: Int, cause: Throwable): Unit = once {
+ done =>
+ val f = future[Unit] {
+ output(num, "hai world")
+ throw cause
+ }
+ f onSuccess { case _ =>
+ output(num, "onoes")
+ done()
+ }
+ f onFailure {
+ case e: ExecutionException if (e.getCause == cause) =>
+ output(num, "kthxbye")
+ done()
+ case _ =>
+ output(num, "onoes")
+ done()
+ }
+ }
+
+ def testOnFailureWhenFutureTimeoutException(): Unit = once {
+ done =>
+ val f = future[Unit] {
+ output(8, "hai world")
+ throw new FutureTimeoutException(null)
+ }
+ f onSuccess { case _ =>
+ output(8, "onoes")
+ done()
+ }
+ f onFailure {
+ case e: FutureTimeoutException =>
+ output(8, "im in yr loop")
+ done()
+ case other =>
+ output(8, "onoes: " + other)
+ done()
+ }
+ }
+
+ testOnSuccess()
+ testOnSuccessWhenCompleted()
+ testOnSuccessWhenFailed()
+ testOnFailure()
+ testOnFailureWhenSpecialThrowable(5, new Error)
+ testOnFailureWhenSpecialThrowable(6, new scala.util.control.ControlThrowable { })
+ testOnFailureWhenSpecialThrowable(7, new InterruptedException)
+ testOnFailureWhenFutureTimeoutException()
+
+}