Skip to content

Commit

Permalink
Fix broken links after move
Browse files Browse the repository at this point in the history
  • Loading branch information
Franklin Hu committed Jul 31, 2012
1 parent e7bdb6a commit 0a6c4b4
Show file tree
Hide file tree
Showing 7 changed files with 47 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ class App(config: ZipkinWebConfig, client: gen.ZipkinQuery.FinagledClient) exten
case _ => {
client.getTraceSummariesByIds(ids, adjusters).map {
_.map { summary =>
JsonAdapter(ThriftAdapter(summary))
JsonQueryAdapter(ThriftQueryAdapter(summary))
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,16 +105,5 @@ class ThriftAdapterSpec extends Specification with JMocker with ClassMocker {
ThriftAdapter(noBinaryAnnotationsSpan) mustEqual Span(0, "name", 0, None, List(), Seq())
}
}

"convert TraceSummary" in {
"to thrift and back" in {
val expectedTraceSummary = TraceSummary(123, 10000, 10300, 300, Map("service1" -> 1),
List(Endpoint(123, 123, "service1")))
val thriftTraceSummary = ThriftAdapter(expectedTraceSummary)
val actualTraceSummary = ThriftAdapter(thriftTraceSummary)
expectedTraceSummary mustEqual actualTraceSummary
}
}
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/*
* Copyright 2012 Twitter Inc.
*
* 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 com.twitter.zipkin.adapter

import com.twitter.zipkin.common.Endpoint
import com.twitter.zipkin.query.TraceSummary
import org.specs.mock.{JMocker, ClassMocker}
import org.specs.Specification

class ThriftQueryAdapterSpec extends Specification with JMocker with ClassMocker {

"ThriftQueryAdapter" should {
"convert TraceSummary" in {
"to thrift and back" in {
val expectedTraceSummary = TraceSummary(123, 10000, 10300, 300, Map("service1" -> 1),
List(Endpoint(123, 123, "service1")))
val thriftTraceSummary = ThriftQueryAdapter(expectedTraceSummary)
val actualTraceSummary = ThriftQueryAdapter(thriftTraceSummary)
expectedTraceSummary mustEqual actualTraceSummary
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import org.specs.Specification
import com.twitter.zipkin.gen
import collection.mutable
import java.nio.ByteBuffer
import com.twitter.zipkin.query.{TraceSummary, SpanTreeEntry}
import com.twitter.zipkin.query.{Timespan, Trace, TraceSummary, SpanTreeEntry}
import com.twitter.zipkin.adapter.{ThriftQueryAdapter, ThriftAdapter}

class TraceSpec extends Specification {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ class QueryServiceSpec extends Specification with JMocker with ClassMocker {
one(storage).getTracesByIds(List(traceId)) willReturn Future(List(trace1))
}

val ts = List(ThriftAdapter(TraceSummary(1, 100, 150, 50, Map("service1" -> 1), List(ep1))))
val ts = List(ThriftQueryAdapter(TraceSummary(1, 100, 150, 50, Map("service1" -> 1), List(ep1))))
ts mustEqual qs.getTraceSummariesByIds(List(traceId), List())()
}

Expand All @@ -178,7 +178,7 @@ class QueryServiceSpec extends Specification with JMocker with ClassMocker {
one(storage).getTracesByIds(List(traceId)) willReturn Future(List(trace1))
}
val trace = ThriftQueryAdapter(trace1)
val summary = ThriftAdapter(TraceSummary(1, 100, 150, 50, Map("service1" -> 1), List(ep1)))
val summary = ThriftQueryAdapter(TraceSummary(1, 100, 150, 50, Map("service1" -> 1), List(ep1)))
val timeline = TraceTimeline(trace1).map(ThriftQueryAdapter(_))
val combo = gen.TraceCombo(trace, Some(summary), timeline, Some(Map(666L -> 1)))
Seq(combo) mustEqual qs.getTraceCombosByIds(List(traceId), List())()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ import org.specs.Specification
import org.specs.mock.{ClassMocker, JMocker}
import scala.collection._
import com.twitter.zipkin.gen
import com.twitter.zipkin.common.{Endpoint, Trace, Annotation, Span}
import com.twitter.zipkin.common.{Endpoint, Annotation, Span}
import com.twitter.zipkin.query.Trace

class TimeSkewAdjusterSpec extends Specification with JMocker with ClassMocker {
val endpoint1 = Some(Endpoint(123, 123, "service"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,13 @@
*/
package com.twitter.zipkin.query.conversions

import com.twitter.zipkin.adapter.ThriftAdapter
import com.twitter.zipkin.common._
import com.twitter.zipkin.gen
import com.twitter.zipkin.query.{Trace, TimelineAnnotation, TraceTimeline}
import org.specs.Specification
import org.specs.mock.{ClassMocker, JMocker}
import com.twitter.zipkin.gen

import scala.collection.JavaConversions._
import java.nio.ByteBuffer
import com.twitter.zipkin.adapter.ThriftAdapter
import com.twitter.zipkin.query.{TimelineAnnotation, TraceTimeline}
import com.twitter.zipkin.common._

class TraceTimelineSpec extends Specification with JMocker with ClassMocker {

Expand Down

0 comments on commit 0a6c4b4

Please sign in to comment.