Fixed wrong merging

This commit is contained in:
Marcin Grzejszczak
2016-01-14 14:20:56 +01:00
parent 779b32b363
commit bf191d7cba
6 changed files with 44 additions and 82 deletions

View File

@@ -1,40 +0,0 @@
/*
* Copyright 2013-2015 the original author or authors.
*
* 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 integration;
import com.github.kristofa.brave.LoggingSpanCollector;
import com.twitter.zipkin.gen.Span;
import java.util.Collections;
import java.util.LinkedList;
import java.util.List;
/**
* Span Collector that logs spans and adds Spans to a list
*
* @author Marcin Grzejszczak
*/
public class IntegrationTestSpanCollector extends LoggingSpanCollector {
public List<Span> hashedSpans = Collections.<Span>synchronizedList(new LinkedList<Span>());
@Override
public void collect(Span span) {
super.collect(span);
hashedSpans.add(span);
}
}

View File

@@ -15,27 +15,23 @@
*/
package integration;
import integration.ZipkinTests.WaitUntilZipkinIsUpConfig;
import io.zipkin.server.ZipkinServer;
import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.SpringApplicationConfiguration;
import org.springframework.boot.test.WebIntegrationTest;
import org.springframework.cloud.sleuth.zipkin.HttpZipkinSpanReporter;
import org.springframework.cloud.sleuth.zipkin.ZipkinProperties;
import org.springframework.cloud.sleuth.zipkin.ZipkinSpanReporter;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.test.context.TestPropertySource;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.util.JdkIdGenerator;
import com.github.kristofa.brave.EmptySpanCollectorMetricsHandler;
import com.github.kristofa.brave.HttpSpanCollector;
import com.github.kristofa.brave.SpanCollector;
import com.github.kristofa.brave.SpanCollectorMetricsHandler;
import integration.ZipkinTests.WaitUntilZipkinIsUpConfig;
import io.zipkin.server.ZipkinServer;
import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j;
import sample.SampleZipkinApplication;
import tools.AbstractIntegrationTest;
@@ -77,7 +73,7 @@ public class ZipkinTests extends AbstractIntegrationTest {
public static class WaitUntilZipkinIsUpConfig {
@Bean
@SneakyThrows
public SpanCollector spanCollector(final ZipkinProperties zipkin) {
public ZipkinSpanReporter spanCollector(final ZipkinProperties zipkin) {
await().until(new Runnable() {
@Override
public void run() {
@@ -94,11 +90,9 @@ public class ZipkinTests extends AbstractIntegrationTest {
return getSpanCollector(zipkin);
}
private SpanCollector getSpanCollector(ZipkinProperties zipkin) {
private ZipkinSpanReporter getSpanCollector(ZipkinProperties zipkin) {
String url = "http://localhost:" + zipkin.getPort();
// TODO: parameterize this
SpanCollectorMetricsHandler metrics = new EmptySpanCollectorMetricsHandler();
return HttpSpanCollector.create(url, zipkin.getHttpConfig(), metrics);
return new HttpZipkinSpanReporter(url, zipkin.getFlushInterval());
}
}
}