This is an automated email from the ASF dual-hosted git repository.

wusheng pushed a commit to branch fix/ot-bridge
in repository https://gitbox.apache.org/repos/asf/incubator-skywalking.git


The following commit(s) were added to refs/heads/fix/ot-bridge by this push:
     new 79a6cea  Try to fix ci.
79a6cea is described below

commit 79a6ceaedcd8bb32c8c9ed7537c510d84695276a
Author: wusheng <wu.sh...@foxmail.com>
AuthorDate: Tue Mar 6 22:21:50 2018 +0800

    Try to fix ci.
---
 .../apm/toolkit/opentracing/SkywalkingContext.java |  1 +
 .../toolkit/opentracing/SkywalkingSpanBuilder.java |  3 +-
 .../tracer/SkywalkingTracerExtractInterceptor.java | 12 +++--
 .../opentracing/SkywalkingSpanActivationTest.java  | 55 +++++++++++++---------
 4 files changed, 43 insertions(+), 28 deletions(-)

diff --git 
a/apm-application-toolkit/apm-toolkit-opentracing/src/main/java/org/apache/skywalking/apm/toolkit/opentracing/SkywalkingContext.java
 
b/apm-application-toolkit/apm-toolkit-opentracing/src/main/java/org/apache/skywalking/apm/toolkit/opentracing/SkywalkingContext.java
index 6d36827..7f76a14 100644
--- 
a/apm-application-toolkit/apm-toolkit-opentracing/src/main/java/org/apache/skywalking/apm/toolkit/opentracing/SkywalkingContext.java
+++ 
b/apm-application-toolkit/apm-toolkit-opentracing/src/main/java/org/apache/skywalking/apm/toolkit/opentracing/SkywalkingContext.java
@@ -20,6 +20,7 @@
 package org.apache.skywalking.apm.toolkit.opentracing;
 
 import io.opentracing.SpanContext;
+
 import java.util.Map;
 
 /**
diff --git 
a/apm-application-toolkit/apm-toolkit-opentracing/src/main/java/org/apache/skywalking/apm/toolkit/opentracing/SkywalkingSpanBuilder.java
 
b/apm-application-toolkit/apm-toolkit-opentracing/src/main/java/org/apache/skywalking/apm/toolkit/opentracing/SkywalkingSpanBuilder.java
index 7af5504..ba7ded3 100644
--- 
a/apm-application-toolkit/apm-toolkit-opentracing/src/main/java/org/apache/skywalking/apm/toolkit/opentracing/SkywalkingSpanBuilder.java
+++ 
b/apm-application-toolkit/apm-toolkit-opentracing/src/main/java/org/apache/skywalking/apm/toolkit/opentracing/SkywalkingSpanBuilder.java
@@ -26,6 +26,7 @@ import io.opentracing.Span;
 import io.opentracing.SpanContext;
 import io.opentracing.Tracer;
 import io.opentracing.tag.Tags;
+
 import java.util.LinkedList;
 import java.util.List;
 
@@ -94,7 +95,7 @@ public class SkywalkingSpanBuilder implements 
Tracer.SpanBuilder {
                 isExit = false;
             }
         } else if (Tags.PEER_HOST_IPV4.getKey().equals(key) || 
Tags.PEER_HOST_IPV6.getKey().equals(key)
-            || Tags.PEER_HOSTNAME.getKey().equals(key)) {
+                || Tags.PEER_HOSTNAME.getKey().equals(key)) {
             peer = value;
         } else if (Tags.PEER_SERVICE.getKey().equals(key)) {
             operationName = value;
diff --git 
a/apm-sniffer/apm-toolkit-activation/apm-toolkit-opentracing-activation/src/main/java/org/apache/skywalking/apm/toolkit/activation/opentracing/tracer/SkywalkingTracerExtractInterceptor.java
 
b/apm-sniffer/apm-toolkit-activation/apm-toolkit-opentracing-activation/src/main/java/org/apache/skywalking/apm/toolkit/activation/opentracing/tracer/SkywalkingTracerExtractInterceptor.java
index 4386302..72eb82a 100644
--- 
a/apm-sniffer/apm-toolkit-activation/apm-toolkit-opentracing-activation/src/main/java/org/apache/skywalking/apm/toolkit/activation/opentracing/tracer/SkywalkingTracerExtractInterceptor.java
+++ 
b/apm-sniffer/apm-toolkit-activation/apm-toolkit-opentracing-activation/src/main/java/org/apache/skywalking/apm/toolkit/activation/opentracing/tracer/SkywalkingTracerExtractInterceptor.java
@@ -21,9 +21,11 @@ package 
org.apache.skywalking.apm.toolkit.activation.opentracing.tracer;
 
 import io.opentracing.propagation.Format;
 import io.opentracing.propagation.TextMap;
+
 import java.lang.reflect.Method;
 import java.util.Iterator;
 import java.util.Map;
+
 import org.apache.skywalking.apm.agent.core.context.ContextCarrier;
 import 
org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.EnhancedInstance;
 import org.apache.skywalking.apm.agent.core.context.CarrierItem;
@@ -36,16 +38,16 @@ import 
org.apache.skywalking.apm.toolkit.opentracing.TextMapContext;
 public class SkywalkingTracerExtractInterceptor implements 
InstanceMethodsAroundInterceptor {
     @Override
     public void beforeMethod(EnhancedInstance objInst, Method method, Object[] 
allArguments,
-        Class<?>[] argumentsTypes, MethodInterceptResult result) throws 
Throwable {
+                             Class<?>[] argumentsTypes, MethodInterceptResult 
result) throws Throwable {
 
     }
 
     @Override
     public Object afterMethod(EnhancedInstance objInst, Method method, 
Object[] allArguments,
-        Class<?>[] argumentsTypes, Object ret) throws Throwable {
-        Format format = (Format)allArguments[0];
+                              Class<?>[] argumentsTypes, Object ret) throws 
Throwable {
+        Format format = (Format) allArguments[0];
         if (Format.Builtin.TEXT_MAP.equals(format) || 
Format.Builtin.HTTP_HEADERS.equals(format)) {
-            TextMap textMapCarrier = (TextMap)allArguments[1];
+            TextMap textMapCarrier = (TextMap) allArguments[1];
 
             ContextCarrier contextCarrier = new ContextCarrier();
             CarrierItem next = contextCarrier.items();
@@ -67,7 +69,7 @@ public class SkywalkingTracerExtractInterceptor implements 
InstanceMethodsAround
 
     @Override
     public void handleMethodException(EnhancedInstance objInst, Method method, 
Object[] allArguments,
-        Class<?>[] argumentsTypes, Throwable t) {
+                                      Class<?>[] argumentsTypes, Throwable t) {
 
     }
 }
diff --git 
a/apm-sniffer/apm-toolkit-activation/apm-toolkit-opentracing-activation/src/test/java/org/apache/skywalking/apm/toolkit/activation/opentracing/SkywalkingSpanActivationTest.java
 
b/apm-sniffer/apm-toolkit-activation/apm-toolkit-opentracing-activation/src/test/java/org/apache/skywalking/apm/toolkit/activation/opentracing/SkywalkingSpanActivationTest.java
index 66ed90a..f6d700d 100644
--- 
a/apm-sniffer/apm-toolkit-activation/apm-toolkit-opentracing-activation/src/test/java/org/apache/skywalking/apm/toolkit/activation/opentracing/SkywalkingSpanActivationTest.java
+++ 
b/apm-sniffer/apm-toolkit-activation/apm-toolkit-opentracing-activation/src/test/java/org/apache/skywalking/apm/toolkit/activation/opentracing/SkywalkingSpanActivationTest.java
@@ -23,10 +23,12 @@ import io.opentracing.Tracer;
 import io.opentracing.propagation.Format;
 import io.opentracing.propagation.TextMap;
 import io.opentracing.tag.Tags;
+
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
+
 import org.apache.skywalking.apm.agent.test.helper.SegmentHelper;
 import org.apache.skywalking.apm.agent.test.tools.SegmentRefAssert;
 import org.apache.skywalking.apm.agent.test.tools.SegmentStorage;
@@ -107,12 +109,12 @@ public class SkywalkingSpanActivationTest {
         spanBuilder = new 
SkywalkingSpanBuilder("test").withTag(Tags.COMPONENT.getKey(), "test");
         constructorWithSpanBuilderInterceptor = new 
ConstructorWithSpanBuilderInterceptor();
         spanLogInterceptor = new SpanLogInterceptor();
-        logArgument = new Object[] {111111111L, event};
-        logArgumentType = new Class[] {long.class, HashMap.class};
+        logArgument = new Object[]{111111111L, event};
+        logArgumentType = new Class[]{long.class, HashMap.class};
 
         setOperationNameInterceptor = new SpanSetOperationNameInterceptor();
-        setOperationNameArgument = new Object[] {"testOperationName"};
-        setOperationNameArgumentType = new Class[] {String.class};
+        setOperationNameArgument = new Object[]{"testOperationName"};
+        setOperationNameArgumentType = new Class[]{String.class};
 
         spanFinishInterceptor = new SpanFinishInterceptor();
 
@@ -165,7 +167,7 @@ public class SkywalkingSpanActivationTest {
     @Test
     public void testCreateExitSpanWithPeer() throws Throwable {
         spanBuilder.withTag(Tags.SPAN_KIND.getKey(), Tags.SPAN_KIND_CLIENT)
-            .withTag(Tags.PEER_HOST_IPV4.getKey(), 
"127.0.0.1").withTag(Tags.PEER_PORT.getKey(), "8080");
+                .withTag(Tags.PEER_HOST_IPV4.getKey(), 
"127.0.0.1").withTag(Tags.PEER_PORT.getKey(), "8080");
         startSpan();
         stopSpan();
 
@@ -187,23 +189,25 @@ public class SkywalkingSpanActivationTest {
     @Test
     public void testInject() throws Throwable {
         spanBuilder.withTag(Tags.SPAN_KIND.getKey(), Tags.SPAN_KIND_CLIENT)
-            .withTag(Tags.PEER_HOST_IPV4.getKey(), 
"127.0.0.1").withTag(Tags.PEER_PORT.getKey(), 8080);
+                .withTag(Tags.PEER_HOST_IPV4.getKey(), 
"127.0.0.1").withTag(Tags.PEER_PORT.getKey(), 8080);
         startSpan();
 
         final Map<String, String> values = new HashMap<String, String>();
         TextMap carrier = new TextMap() {
-            @Override public Iterator<Map.Entry<String, String>> iterator() {
+            @Override
+            public Iterator<Map.Entry<String, String>> iterator() {
                 return null;
             }
 
-            @Override public void put(String key, String value) {
+            @Override
+            public void put(String key, String value) {
                 values.put(key, value);
             }
 
         };
 
         injectInterceptor.afterMethod(enhancedInstance, null,
-            new Object[] {new TextMapContext(), Format.Builtin.TEXT_MAP, 
carrier}, null, null);
+                new Object[]{new TextMapContext(), Format.Builtin.TEXT_MAP, 
carrier}, null, null);
 
         String[] parts = values.get(SW3CarrierItem.HEADER_NAME).split("\\|", 
8);
         Assert.assertEquals("0", parts[1]);
@@ -215,15 +219,17 @@ public class SkywalkingSpanActivationTest {
     @Test
     public void testExtractWithValidateContext() throws Throwable {
         spanBuilder.withTag(Tags.SPAN_KIND.getKey(), Tags.SPAN_KIND_CLIENT)
-            .withTag(Tags.PEER_HOST_IPV4.getKey(), 
"127.0.0.1").withTag(Tags.PEER_PORT.getKey(), 8080);
+                .withTag(Tags.PEER_HOST_IPV4.getKey(), 
"127.0.0.1").withTag(Tags.PEER_PORT.getKey(), 8080);
         startSpan();
         final Map<String, String> values = new HashMap<String, String>();
         TextMap carrier = new TextMap() {
-            @Override public Iterator<Map.Entry<String, String>> iterator() {
+            @Override
+            public Iterator<Map.Entry<String, String>> iterator() {
                 return values.entrySet().iterator();
             }
 
-            @Override public void put(String key, String value) {
+            @Override
+            public void put(String key, String value) {
                 values.put(key, value);
             }
 
@@ -232,7 +238,7 @@ public class SkywalkingSpanActivationTest {
         values.put(SW3CarrierItem.HEADER_NAME, 
"1.343.222|3|1|1|#127.0.0.1:8080|#/portal/|#/testEntrySpan|434.12.12123");
 
         extractInterceptor.afterMethod(enhancedInstance, null,
-            new Object[] {Format.Builtin.TEXT_MAP, carrier}, new Class[] {}, 
null);
+                new Object[]{Format.Builtin.TEXT_MAP, carrier}, new Class[]{}, 
null);
         stopSpan();
 
         TraceSegment tracingSegment = assertTraceSemgnets();
@@ -250,16 +256,18 @@ public class SkywalkingSpanActivationTest {
     @Test
     public void testExtractWithInValidateContext() throws Throwable {
         spanBuilder.withTag(Tags.SPAN_KIND.getKey(), Tags.SPAN_KIND_CLIENT)
-            .withTag(Tags.PEER_HOST_IPV4.getKey(), 
"127.0.0.1").withTag(Tags.PEER_PORT.getKey(), 8080);
+                .withTag(Tags.PEER_HOST_IPV4.getKey(), 
"127.0.0.1").withTag(Tags.PEER_PORT.getKey(), 8080);
         startSpan();
 
         final Map<String, String> values = new HashMap<String, String>();
         TextMap carrier = new TextMap() {
-            @Override public Iterator<Map.Entry<String, String>> iterator() {
+            @Override
+            public Iterator<Map.Entry<String, String>> iterator() {
                 return values.entrySet().iterator();
             }
 
-            @Override public void put(String key, String value) {
+            @Override
+            public void put(String key, String value) {
                 values.put(key, value);
             }
 
@@ -268,7 +276,7 @@ public class SkywalkingSpanActivationTest {
         values.put(SW3CarrierItem.HEADER_NAME, 
"aaaaaaaa|3|#192.168.1.8:18002|#/portal/|#/testEntrySpan|1.234.444");
 
         extractInterceptor.afterMethod(enhancedInstance, null,
-            new Object[] {Format.Builtin.TEXT_MAP, carrier}, new Class[] {}, 
null);
+                new Object[]{Format.Builtin.TEXT_MAP, carrier}, new Class[]{}, 
null);
         stopSpan();
 
         TraceSegment tracingSegment = assertTraceSemgnets();
@@ -284,7 +292,8 @@ public class SkywalkingSpanActivationTest {
         constructorInterceptor.onConstruct(continuationHolder, null);
         assertTrue(continuationHolder.getSkyWalkingDynamicField() instanceof 
ContextSnapshot);
         new Thread() {
-            @Override public void run() {
+            @Override
+            public void run() {
                 MockEnhancedInstance enhancedInstance = new 
MockEnhancedInstance();
                 try {
                     startSpan(enhancedInstance);
@@ -331,21 +340,23 @@ public class SkywalkingSpanActivationTest {
     }
 
     private void startSpan(MockEnhancedInstance enhancedInstance) throws 
Throwable {
-        constructorWithSpanBuilderInterceptor.onConstruct(enhancedInstance, 
new Object[] {spanBuilder});
+        constructorWithSpanBuilderInterceptor.onConstruct(enhancedInstance, 
new Object[]{spanBuilder});
         spanLogInterceptor.afterMethod(enhancedInstance, null, logArgument, 
logArgumentType, null);
 
         setOperationNameInterceptor.afterMethod(enhancedInstance, 
SkywalkingSpan.class.getMethod("setOperationName", String.class),
-            setOperationNameArgument, setOperationNameArgumentType, null);
+                setOperationNameArgument, setOperationNameArgumentType, null);
     }
 
     private class MockEnhancedInstance implements EnhancedInstance {
         public Object object;
 
-        @Override public Object getSkyWalkingDynamicField() {
+        @Override
+        public Object getSkyWalkingDynamicField() {
             return object;
         }
 
-        @Override public void setSkyWalkingDynamicField(Object value) {
+        @Override
+        public void setSkyWalkingDynamicField(Object value) {
             this.object = value;
         }
     }

-- 
To stop receiving notification emails like this one, please contact
wush...@apache.org.

Reply via email to