aboutsummaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorIvan Topolnak <ivantopo@gmail.com>2013-05-23 18:27:58 -0300
committerIvan Topolnak <ivantopo@gmail.com>2013-05-23 18:27:58 -0300
commita12e8579e09c5fd8fdf98ba4553f0a232ddfea6b (patch)
tree2388d67e5166687bf5b904c3ebcf7b54db679d1b /src/test
parentc56018c9a3bef9e99cc38f1804eafdfe5c8be45c (diff)
downloadKamon-a12e8579e09c5fd8fdf98ba4553f0a232ddfea6b.tar.gz
Kamon-a12e8579e09c5fd8fdf98ba4553f0a232ddfea6b.tar.bz2
Kamon-a12e8579e09c5fd8fdf98ba4553f0a232ddfea6b.zip
included aspectj support for running tests, and simple test stub
Diffstat (limited to 'src/test')
-rw-r--r--src/test/scala/kamon/instrumentation/FutureInstrumentationSpec.scala25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/test/scala/kamon/instrumentation/FutureInstrumentationSpec.scala b/src/test/scala/kamon/instrumentation/FutureInstrumentationSpec.scala
new file mode 100644
index 00000000..2eb8d07a
--- /dev/null
+++ b/src/test/scala/kamon/instrumentation/FutureInstrumentationSpec.scala
@@ -0,0 +1,25 @@
+package kamon.instrumentation
+
+import scala.concurrent.{Await, Future}
+import org.specs2.mutable.Specification
+import scala.concurrent.ExecutionContext.Implicits.global
+import scala.concurrent.duration.{FiniteDuration, DurationLong}
+import org.specs2.time.{ Duration => SpecsDuration }
+
+
+class FutureInstrumentationSpec extends Specification {
+ import Await.result
+ implicit def specsDuration2Akka(duration: SpecsDuration): FiniteDuration = new DurationLong(duration.inMillis).millis
+
+ "a instrumented Future" should {
+ "preserve the transaction context available during the future creation" in {
+
+ }
+
+ "use the same context available at creation when executing the onComplete callback" in {
+ val future = Future { "hello" }
+
+ result(future, 100 millis) === "hello"
+ }
+ }
+}