summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorPhilipp Haller <hallerp@gmail.com>2009-07-21 08:25:35 +0000
committerPhilipp Haller <hallerp@gmail.com>2009-07-21 08:25:35 +0000
commit2b51d5c4772d480285359b9d2daf8b1ccef3eae4 (patch)
tree84d6249d71598aeea6b72c103f8322ef4b61ca24 /test
parent294000998f2c244d46785a2d6873fe33d9a6e110 (diff)
downloadscala-2b51d5c4772d480285359b9d2daf8b1ccef3eae4.tar.gz
scala-2b51d5c4772d480285359b9d2daf8b1ccef3eae4.tar.bz2
scala-2b51d5c4772d480285359b9d2daf8b1ccef3eae4.zip
Made daemon-actor-termination test deterministic.
Diffstat (limited to 'test')
-rw-r--r--test/files/jvm/daemon-actor-termination.scala19
1 files changed, 14 insertions, 5 deletions
diff --git a/test/files/jvm/daemon-actor-termination.scala b/test/files/jvm/daemon-actor-termination.scala
index 824bd76211..b089f652bf 100644
--- a/test/files/jvm/daemon-actor-termination.scala
+++ b/test/files/jvm/daemon-actor-termination.scala
@@ -13,15 +13,24 @@ object Test {
class MyDaemon extends DaemonActor {
def act() {
- println("MSG1")
- Thread.sleep(5000)
- println("done")
+ react {
+ case 'hello =>
+ println("MSG1")
+ reply()
+ react {
+ case 'bye =>
+ println("done")
+ }
+ }
}
}
+
def main(args: Array[String]) {
val daemon = new MyDaemon
daemon.start()
- Thread.sleep(500) // give the daemon a chance to start
- println("MSG2")
+ Actor.actor {
+ daemon !? 'hello
+ println("MSG2")
+ }
}
}