diff options
author | Ivan Topolnjak <ivantopo@gmail.com> | 2017-08-14 23:08:14 +0200 |
---|---|---|
committer | Ivan Topolnjak <ivantopo@gmail.com> | 2017-08-14 23:08:35 +0200 |
commit | 407d74e89acdd4dff5a887c1ae5793d63e9e7a2e (patch) | |
tree | 677f0a573dfe028f31826748609e315a4bfa36dd /kamon-core/src/test/scala | |
parent | 3a8c0fa25f12230b27e943d1fffe07f814c650fe (diff) | |
download | Kamon-407d74e89acdd4dff5a887c1ae5793d63e9e7a2e.tar.gz Kamon-407d74e89acdd4dff5a887c1ae5793d63e9e7a2e.tar.bz2 Kamon-407d74e89acdd4dff5a887c1ae5793d63e9e7a2e.zip |
expose the identity provider through the Tracer
Diffstat (limited to 'kamon-core/src/test/scala')
-rw-r--r-- | kamon-core/src/test/scala/kamon/LogInterceptor.scala | 30 | ||||
-rw-r--r-- | kamon-core/src/test/scala/kamon/context/ContextCodecSpec.scala | 2 | ||||
-rw-r--r-- | kamon-core/src/test/scala/kamon/testkit/SpanBuilding.scala | 10 | ||||
-rw-r--r-- | kamon-core/src/test/scala/kamon/trace/B3SpanCodecSpec.scala (renamed from kamon-core/src/test/scala/kamon/trace/ExtendedB3SpanContextCodecSpec.scala) | 5 | ||||
-rw-r--r-- | kamon-core/src/test/scala/kamon/trace/DefaultIdentityGeneratorSpec.scala | 4 | ||||
-rw-r--r-- | kamon-core/src/test/scala/kamon/trace/DoubleLengthTraceIdentityGeneratorSpec.scala | 4 |
6 files changed, 11 insertions, 44 deletions
diff --git a/kamon-core/src/test/scala/kamon/LogInterceptor.scala b/kamon-core/src/test/scala/kamon/LogInterceptor.scala deleted file mode 100644 index 76480a2f..00000000 --- a/kamon-core/src/test/scala/kamon/LogInterceptor.scala +++ /dev/null @@ -1,30 +0,0 @@ -/* ========================================================================================= - * Copyright © 2013-2017 the kamon project <http://kamon.io/> - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the - * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, - * either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - * ========================================================================================= - */ - - -package kamon - -//import uk.org.lidalia.slf4jext.Level -//import uk.org.lidalia.slf4jtest.{LoggingEvent, TestLogger} -// -//trait LogInterceptor { -// -// def interceptLog[T](level: Level)(code: => T)(implicit tl: TestLogger): Seq[LoggingEvent] = { -// import scala.collection.JavaConverters._ -// tl.clear() -// val run = code -// tl.getLoggingEvents().asScala.filter(_.getLevel == level) -// } -//} diff --git a/kamon-core/src/test/scala/kamon/context/ContextCodecSpec.scala b/kamon-core/src/test/scala/kamon/context/ContextCodecSpec.scala index 242c3345..11be85a7 100644 --- a/kamon-core/src/test/scala/kamon/context/ContextCodecSpec.scala +++ b/kamon-core/src/test/scala/kamon/context/ContextCodecSpec.scala @@ -14,5 +14,5 @@ class ContextCodecSpec extends WordSpec with Matchers { } } - val ContextCodec = new Codec(Kamon.config()) + val ContextCodec = new Codec(Kamon.identityProvider, Kamon.config()) } diff --git a/kamon-core/src/test/scala/kamon/testkit/SpanBuilding.scala b/kamon-core/src/test/scala/kamon/testkit/SpanBuilding.scala index 29678b34..7a216ecc 100644 --- a/kamon-core/src/test/scala/kamon/testkit/SpanBuilding.scala +++ b/kamon-core/src/test/scala/kamon/testkit/SpanBuilding.scala @@ -1,18 +1,16 @@ package kamon.testkit import kamon.trace.SpanContext.SamplingDecision -import kamon.trace.{IdentityProvider, SpanContext, SpanContextCodec} +import kamon.trace.{IdentityProvider, SpanContext} trait SpanBuilding { private val identityProvider = IdentityProvider.Default() - private val extendedB3Codec = SpanContextCodec.ExtendedB3(identityProvider) def createSpanContext(samplingDecision: SamplingDecision = SamplingDecision.Sample): SpanContext = SpanContext( - traceID = identityProvider.traceIdentifierGenerator().generate(), - spanID = identityProvider.spanIdentifierGenerator().generate(), - parentID = identityProvider.spanIdentifierGenerator().generate(), + traceID = identityProvider.traceIdGenerator().generate(), + spanID = identityProvider.spanIdGenerator().generate(), + parentID = identityProvider.spanIdGenerator().generate(), samplingDecision = samplingDecision ) - } diff --git a/kamon-core/src/test/scala/kamon/trace/ExtendedB3SpanContextCodecSpec.scala b/kamon-core/src/test/scala/kamon/trace/B3SpanCodecSpec.scala index cc886bd9..e6fa283e 100644 --- a/kamon-core/src/test/scala/kamon/trace/ExtendedB3SpanContextCodecSpec.scala +++ b/kamon-core/src/test/scala/kamon/trace/B3SpanCodecSpec.scala @@ -23,9 +23,8 @@ import kamon.trace.SpanContext.SamplingDecision import org.scalatest.{Matchers, OptionValues, WordSpecLike} -class ExtendedB3SpanContextCodecSpec extends WordSpecLike with Matchers with OptionValues with SpanBuilding { - val identityProvider = IdentityProvider.Default() - val extendedB3Codec = SpanContextCodec.ExtendedB3(identityProvider) +class B3SpanCodecSpec extends WordSpecLike with Matchers with OptionValues with SpanBuilding { + val extendedB3Codec = SpanCodec.B3() "The ExtendedB3 SpanContextCodec" should { "return a TextMap containing the SpanContext data" in { diff --git a/kamon-core/src/test/scala/kamon/trace/DefaultIdentityGeneratorSpec.scala b/kamon-core/src/test/scala/kamon/trace/DefaultIdentityGeneratorSpec.scala index 8977e3cd..8f9af7b0 100644 --- a/kamon-core/src/test/scala/kamon/trace/DefaultIdentityGeneratorSpec.scala +++ b/kamon-core/src/test/scala/kamon/trace/DefaultIdentityGeneratorSpec.scala @@ -6,8 +6,8 @@ import org.scalactic.TimesOnInt._ class DefaultIdentityGeneratorSpec extends WordSpecLike with Matchers with OptionValues { val idProvider = IdentityProvider.Default() - val traceGenerator = idProvider.traceIdentifierGenerator() - val spanGenerator = idProvider.spanIdentifierGenerator() + val traceGenerator = idProvider.traceIdGenerator() + val spanGenerator = idProvider.spanIdGenerator() validateGenerator("TraceID Generator", traceGenerator) validateGenerator("SpanID Generator", spanGenerator) diff --git a/kamon-core/src/test/scala/kamon/trace/DoubleLengthTraceIdentityGeneratorSpec.scala b/kamon-core/src/test/scala/kamon/trace/DoubleLengthTraceIdentityGeneratorSpec.scala index 54e590ad..b22f17e1 100644 --- a/kamon-core/src/test/scala/kamon/trace/DoubleLengthTraceIdentityGeneratorSpec.scala +++ b/kamon-core/src/test/scala/kamon/trace/DoubleLengthTraceIdentityGeneratorSpec.scala @@ -6,8 +6,8 @@ import org.scalatest.{Matchers, OptionValues, WordSpecLike} class DoubleLengthTraceIdentityGeneratorSpec extends WordSpecLike with Matchers with OptionValues { val idProvider = IdentityProvider.DoubleSizeTraceID() - val traceGenerator = idProvider.traceIdentifierGenerator() - val spanGenerator = idProvider.spanIdentifierGenerator() + val traceGenerator = idProvider.traceIdGenerator() + val spanGenerator = idProvider.spanIdGenerator() "The DoubleSizeTraceID identity provider" when { "generating trace identifiers" should { |