summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJosh Suereth <Joshua.Suereth@gmail.com>2012-10-31 08:12:40 -0700
committerJosh Suereth <Joshua.Suereth@gmail.com>2012-10-31 08:12:40 -0700
commit4752f1243d5aa316b3a2042b93166647c665ee42 (patch)
tree42a20dca962d51097c6101d30b639a3a09d8a5bd /test
parentbf7e234d4964af2e3d95e149edccc66f4dc25b9e (diff)
parentf627d8a51e6b4f9afc017ee4bf02604cd094c9ae (diff)
downloadscala-4752f1243d5aa316b3a2042b93166647c665ee42.tar.gz
scala-4752f1243d5aa316b3a2042b93166647c665ee42.tar.bz2
scala-4752f1243d5aa316b3a2042b93166647c665ee42.zip
Merge pull request #1536 from vjovanov/issues/SI-6581
SI-6581 fixed by inlining `Actor.self`.
Diffstat (limited to 'test')
-rw-r--r--test/files/jvm/actmig-remote-actor-self.check1
-rw-r--r--test/files/jvm/actmig-remote-actor-self.scala34
2 files changed, 35 insertions, 0 deletions
diff --git a/test/files/jvm/actmig-remote-actor-self.check b/test/files/jvm/actmig-remote-actor-self.check
new file mode 100644
index 0000000000..79d23cb337
--- /dev/null
+++ b/test/files/jvm/actmig-remote-actor-self.check
@@ -0,0 +1 @@
+registered
diff --git a/test/files/jvm/actmig-remote-actor-self.scala b/test/files/jvm/actmig-remote-actor-self.scala
new file mode 100644
index 0000000000..2b994f6081
--- /dev/null
+++ b/test/files/jvm/actmig-remote-actor-self.scala
@@ -0,0 +1,34 @@
+/**
+ * NOTE: Code snippets from this test are included in the Actor Migration Guide. In case you change
+ * code in these tests prior to the 2.10.0 release please send the notification to @vjovanov.
+ */
+import scala.actors._
+import scala.actors.migration._
+import scala.actors.remote._
+import scala.actors.remote.RemoteActor._
+import scala.concurrent._
+import scala.concurrent.duration._
+
+object Test {
+ val finished = Promise[Boolean]
+
+ def main(args: Array[String]): Unit = {
+
+ // can fail with class cast exception in alive
+ val myAkkaActor = ActorDSL.actor(new StashingActor {
+ override def preStart() = {
+ alive(42013)
+ println("registered")
+ finished success true
+ context.stop(self)
+ }
+
+ def receive = {
+ case x: Int =>
+ }
+ })
+
+ Await.result(finished.future, Duration.Inf).toString
+ }
+
+}