diff options
author | Ivan Topolnak <ivantopo@gmail.com> | 2013-09-18 18:43:11 -0300 |
---|---|---|
committer | Ivan Topolnak <ivantopo@gmail.com> | 2013-09-18 18:43:11 -0300 |
commit | bbf7afd85809f6d43b310290b4bb9102dd36043c (patch) | |
tree | e819812cafa5bc5c92065b003311866e7a231386 /kamon-core/src/test/scala/kamon/trace/TraceAggregatorSpec.scala | |
parent | 9382ce9d66b5d6bfef515cee56f40aa178920335 (diff) | |
download | Kamon-bbf7afd85809f6d43b310290b4bb9102dd36043c.tar.gz Kamon-bbf7afd85809f6d43b310290b4bb9102dd36043c.tar.bz2 Kamon-bbf7afd85809f6d43b310290b4bb9102dd36043c.zip |
basic newrelic reporting
Diffstat (limited to 'kamon-core/src/test/scala/kamon/trace/TraceAggregatorSpec.scala')
-rw-r--r-- | kamon-core/src/test/scala/kamon/trace/TraceAggregatorSpec.scala | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/kamon-core/src/test/scala/kamon/trace/TraceAggregatorSpec.scala b/kamon-core/src/test/scala/kamon/trace/TraceAggregatorSpec.scala new file mode 100644 index 00000000..60b5f06d --- /dev/null +++ b/kamon-core/src/test/scala/kamon/trace/TraceAggregatorSpec.scala @@ -0,0 +1,36 @@ +package kamon.trace + +import org.scalatest.{WordSpecLike, WordSpec} +import akka.testkit.{TestKitBase, TestKit} +import akka.actor.ActorSystem +import scala.concurrent.duration._ +import kamon.trace.UowTracing.{Finish, Rename, Start} + +class TraceAggregatorSpec extends TestKit(ActorSystem("TraceAggregatorSpec")) with WordSpecLike { + + "a TraceAggregator" should { + "send a UowTrace message out after receiving a Finish message" in new AggregatorFixture { + within(1 second) { + aggregator ! Start() + aggregator ! Finish() + + expectMsg(UowTrace("UNKNOWN", Seq(Start(), Finish()))) + } + } + + "change the uow name after receiving a Rename message" in new AggregatorFixture { + within(1 second) { + aggregator ! Start() + aggregator ! Rename("test-uow") + aggregator ! Finish() + + expectMsg(UowTrace("test-uow", Seq(Start(), Finish()))) + } + } + } + + + trait AggregatorFixture { + val aggregator = system.actorOf(UowTraceAggregator.props(testActor, 10 seconds)) + } +} |