+tes #12681 add EchoActor

This commit is contained in:
Michal Knapik 2014-06-04 20:51:12 +02:00 committed by Konrad 'ktoso' Malawski
parent 0e2f356d23
commit 7ca3a9699e
5 changed files with 53 additions and 37 deletions

View file

@ -18,9 +18,7 @@ import akka.actor.Actor
import akka.actor.ActorRef
import akka.actor.ActorSystem
import akka.actor.Props
import akka.testkit.DefaultTimeout
import akka.testkit.ImplicitSender
import akka.testkit.TestKit
import akka.testkit.{ TestActors, DefaultTimeout, ImplicitSender, TestKit }
import scala.concurrent.duration._
import scala.collection.immutable
@ -34,7 +32,7 @@ class TestKitUsageSpec
with WordSpecLike with Matchers with BeforeAndAfterAll {
import TestKitUsageSpec._
val echoRef = system.actorOf(Props[EchoActor])
val echoRef = system.actorOf(TestActors.echoActorProps)
val forwardRef = system.actorOf(Props(classOf[ForwardingActor], testActor))
val filterRef = system.actorOf(Props(classOf[FilteringActor], testActor))
val randomHead = Random.nextInt(6)
@ -112,15 +110,6 @@ object TestKitUsageSpec {
}
"""
/**
* An Actor that echoes everything you send to it
*/
class EchoActor extends Actor {
def receive = {
case msg => sender() ! msg
}
}
/**
* An Actor that forwards every message to a next Actor
*/