diff options
author | Ivan Topolnjak <ivantopo@gmail.com> | 2013-12-18 20:41:20 -0300 |
---|---|---|
committer | Ivan Topolnjak <ivantopo@gmail.com> | 2013-12-18 20:41:20 -0300 |
commit | 705f76aa41ebdf9384530e2e0d850a0ef703a5e6 (patch) | |
tree | d6026b84ca0f59823f5ead10291655b0ec7bf2a5 /kamon-trace/src/test/scala/kamon/trace/instrumentation/ActorMessagePassingTracingSpec.scala | |
parent | 1d9305dc7a8ad2d6457b5ebe1635eb4838cf13a0 (diff) | |
download | Kamon-705f76aa41ebdf9384530e2e0d850a0ef703a5e6.tar.gz Kamon-705f76aa41ebdf9384530e2e0d850a0ef703a5e6.tar.bz2 Kamon-705f76aa41ebdf9384530e2e0d850a0ef703a5e6.zip |
more reformatted code
Diffstat (limited to 'kamon-trace/src/test/scala/kamon/trace/instrumentation/ActorMessagePassingTracingSpec.scala')
-rw-r--r-- | kamon-trace/src/test/scala/kamon/trace/instrumentation/ActorMessagePassingTracingSpec.scala | 60 |
1 files changed, 28 insertions, 32 deletions
diff --git a/kamon-trace/src/test/scala/kamon/trace/instrumentation/ActorMessagePassingTracingSpec.scala b/kamon-trace/src/test/scala/kamon/trace/instrumentation/ActorMessagePassingTracingSpec.scala index 184953b1..89251bf4 100644 --- a/kamon-trace/src/test/scala/kamon/trace/instrumentation/ActorMessagePassingTracingSpec.scala +++ b/kamon-trace/src/test/scala/kamon/trace/instrumentation/ActorMessagePassingTracingSpec.scala @@ -15,56 +15,55 @@ * ========================================================== */ package kamon.trace.instrumentation -import org.scalatest.{WordSpecLike, Matchers} -import akka.actor.{ActorRef, Actor, Props, ActorSystem} +import org.scalatest.{ WordSpecLike, Matchers } +import akka.actor.{ ActorRef, Actor, Props, ActorSystem } -import akka.testkit.{ImplicitSender, TestKit} +import akka.testkit.{ ImplicitSender, TestKit } import kamon.trace.Trace -import akka.pattern.{pipe, ask} +import akka.pattern.{ pipe, ask } import akka.util.Timeout import scala.concurrent.duration._ -import scala.concurrent.{Await, Future} +import scala.concurrent.{ Await, Future } import akka.routing.RoundRobinRouter import kamon.trace.TraceContext - class ActorMessagePassingTracingSpec extends TestKit(ActorSystem("actor-message-passing-tracing-spec")) with WordSpecLike with ImplicitSender { implicit val executionContext = system.dispatcher "the message passing instrumentation" should { - "propagate the TraceContext using bang" in new TraceContextEchoFixture { - Trace.withContext(testTraceContext) { - ctxEchoActor ! "test" - } - - expectMsg(testTraceContext) + "propagate the TraceContext using bang" in new TraceContextEchoFixture { + Trace.withContext(testTraceContext) { + ctxEchoActor ! "test" } - "propagate the TraceContext using tell" in new TraceContextEchoFixture { - Trace.withContext(testTraceContext) { - ctxEchoActor.tell("test", testActor) - } + expectMsg(testTraceContext) + } - expectMsg(testTraceContext) + "propagate the TraceContext using tell" in new TraceContextEchoFixture { + Trace.withContext(testTraceContext) { + ctxEchoActor.tell("test", testActor) } - "propagate the TraceContext using ask" in new TraceContextEchoFixture { - implicit val timeout = Timeout(1 seconds) - Trace.withContext(testTraceContext) { - // The pipe pattern use Futures internally, so FutureTracing test should cover the underpinnings of it. - (ctxEchoActor ? "test") pipeTo(testActor) - } + expectMsg(testTraceContext) + } - expectMsg(testTraceContext) + "propagate the TraceContext using ask" in new TraceContextEchoFixture { + implicit val timeout = Timeout(1 seconds) + Trace.withContext(testTraceContext) { + // The pipe pattern use Futures internally, so FutureTracing test should cover the underpinnings of it. + (ctxEchoActor ? "test") pipeTo (testActor) } - "propagate the TraceContext to actors behind a router" in new RoutedTraceContextEchoFixture { - Trace.withContext(testTraceContext) { - ctxEchoActor ! "test" - } + expectMsg(testTraceContext) + } - expectMsg(testTraceContext) + "propagate the TraceContext to actors behind a router" in new RoutedTraceContextEchoFixture { + Trace.withContext(testTraceContext) { + ctxEchoActor ! "test" } + + expectMsg(testTraceContext) + } } trait TraceContextEchoFixture { @@ -83,6 +82,3 @@ class TraceContextEcho extends Actor { } } - - - |