diff options
author | Ivan Topolnak <ivantopo@gmail.com> | 2013-08-07 19:06:33 -0300 |
---|---|---|
committer | Ivan Topolnak <ivantopo@gmail.com> | 2013-08-07 19:06:33 -0300 |
commit | 923b88e8adef2f66b43e551fa4a0a1bbae5af7ff (patch) | |
tree | d555199f0c63b690ec51805b496ee2d54eb014da /kamon-core/src/test/scala/akka | |
parent | 1e6665e30d96772eab92aca4d23e176adcd88dc5 (diff) | |
download | Kamon-923b88e8adef2f66b43e551fa4a0a1bbae5af7ff.tar.gz Kamon-923b88e8adef2f66b43e551fa4a0a1bbae5af7ff.tar.bz2 Kamon-923b88e8adef2f66b43e551fa4a0a1bbae5af7ff.zip |
upgrading to akka 2.2
Diffstat (limited to 'kamon-core/src/test/scala/akka')
-rw-r--r-- | kamon-core/src/test/scala/akka/instrumentation/ActorInstrumentationSpec.scala | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/kamon-core/src/test/scala/akka/instrumentation/ActorInstrumentationSpec.scala b/kamon-core/src/test/scala/akka/instrumentation/ActorInstrumentationSpec.scala new file mode 100644 index 00000000..0026d953 --- /dev/null +++ b/kamon-core/src/test/scala/akka/instrumentation/ActorInstrumentationSpec.scala @@ -0,0 +1,45 @@ +package akka.instrumentation + +import org.scalatest.{WordSpecLike, Matchers} +import akka.actor.{Actor, Props, ActorSystem} + +import akka.testkit.{ImplicitSender, TestKit} +import kamon.{TraceContext, Kamon} + + +class ActorInstrumentationSpec extends TestKit(ActorSystem("ActorInstrumentationSpec")) with WordSpecLike with Matchers with ImplicitSender { + + "an instrumented actor ref" when { + "used inside the context of a transaction" should { + "propagate the trace context using bang" in new TraceContextEchoFixture { + echo ! "test" + + expectMsg(Some(testTraceContext)) + } + + "propagate the trace context using tell" in { + + } + + "propagate the trace context using ask" in { + + } + } + } + + trait TraceContextEchoFixture { + val testTraceContext = Kamon.newTraceContext() + val echo = system.actorOf(Props[TraceContextEcho]) + + Kamon.set(testTraceContext) + } + +} + +class TraceContextEcho extends Actor { + def receive = { + case msg ⇒ sender ! Kamon.context() + } +} + + |