提交 61186fe5 编写于 作者: A ascrutae

fix testcase failed

上级 3aa56332
...@@ -79,7 +79,7 @@ public class ContextManagerTest { ...@@ -79,7 +79,7 @@ public class ContextManagerTest {
@Test @Test
public void createMultipleEntrySpan() { public void createMultipleEntrySpan() {
ContextCarrier contextCarrier = new ContextCarrier().deserialize("#AQA=#AQA=4WcWe0tQNQA=|1|1|#127.0.0.1:8080|#/portal/|#/testEntrySpan|#AQA=#AQA=Et0We0tQNQA="); ContextCarrier contextCarrier = new ContextCarrier().deserialize("#AQA*#AQA*4WcWe0tQNQA*|1|1|#127.0.0.1:8080|#/portal/|#/testEntrySpan|#AQA*#AQA*Et0We0tQNQA*");
assertTrue(contextCarrier.isValid()); assertTrue(contextCarrier.isValid());
AbstractSpan firstEntrySpan = ContextManager.createEntrySpan("/testFirstEntry", contextCarrier); AbstractSpan firstEntrySpan = ContextManager.createEntrySpan("/testFirstEntry", contextCarrier);
...@@ -202,7 +202,7 @@ public class ContextManagerTest { ...@@ -202,7 +202,7 @@ public class ContextManagerTest {
@Test @Test
public void testTransform() throws InvalidProtocolBufferException { public void testTransform() throws InvalidProtocolBufferException {
ContextCarrier contextCarrier = new ContextCarrier().deserialize("#AQA=#AQA=4WcWe0tQNQA=|3|1|#127.0.0.1:8080|#/portal/|#/testEntrySpan|#AQA=#AQA=Et0We0tQNQA="); ContextCarrier contextCarrier = new ContextCarrier().deserialize("#AQA*#AQA*4WcWe0tQNQA*|3|1|#127.0.0.1:8080|#/portal/|#/testEntrySpan|#AQA*#AQA*Et0We0tQNQA*");
assertTrue(contextCarrier.isValid()); assertTrue(contextCarrier.isValid());
AbstractSpan firstEntrySpan = ContextManager.createEntrySpan("/testFirstEntry", contextCarrier); AbstractSpan firstEntrySpan = ContextManager.createEntrySpan("/testFirstEntry", contextCarrier);
......
...@@ -148,7 +148,7 @@ public class DubboInterceptorTest { ...@@ -148,7 +148,7 @@ public class DubboInterceptorTest {
@Test @Test
public void testProviderWithAttachment() throws Throwable { public void testProviderWithAttachment() throws Throwable {
when(rpcContext.isConsumerSide()).thenReturn(false); when(rpcContext.isConsumerSide()).thenReturn(false);
when(rpcContext.getAttachment(Config.Plugin.Propagation.HEADER_NAME)).thenReturn("#AQA=#AQA=4WcWe0tQNQA=|3|1|#192.168.1.8 :18002|#/portal/|#/testEntrySpan|#AQA=#AQA=Et0We0tQNQA="); when(rpcContext.getAttachment(Config.Plugin.Propagation.HEADER_NAME)).thenReturn("#AQA*#AQA*4WcWe0tQNQA*|3|1|#192.168.1.8 :18002|#/portal/|#/testEntrySpan|#AQA*#AQA*Et0We0tQNQA*");
dubboInterceptor.beforeMethod(enhancedInstance, "invoke", allArguments, argumentTypes, methodInterceptResult); dubboInterceptor.beforeMethod(enhancedInstance, "invoke", allArguments, argumentTypes, methodInterceptResult);
dubboInterceptor.afterMethod(enhancedInstance, "invoke", allArguments, argumentTypes, result); dubboInterceptor.afterMethod(enhancedInstance, "invoke", allArguments, argumentTypes, result);
...@@ -160,7 +160,7 @@ public class DubboInterceptorTest { ...@@ -160,7 +160,7 @@ public class DubboInterceptorTest {
when(rpcContext.isConsumerSide()).thenReturn(false); when(rpcContext.isConsumerSide()).thenReturn(false);
FieldSetter.setStaticValue(BugFixActive.class, "ACTIVE", true); FieldSetter.setStaticValue(BugFixActive.class, "ACTIVE", true);
testParam.setTraceContext("#AQA=#AQA=4WcWe0tQNQA=|3|1|#192.168.1.8 :18002|#/portal/|#/testEntrySpan|#AQA=#AQA=Et0We0tQNQA="); testParam.setTraceContext("#AQA*#AQA*4WcWe0tQNQA*|3|1|#192.168.1.8 :18002|#/portal/|#/testEntrySpan|#AQA*#AQA*Et0We0tQNQA*");
dubboInterceptor.beforeMethod(enhancedInstance, "invoke", allArguments, argumentTypes, methodInterceptResult); dubboInterceptor.beforeMethod(enhancedInstance, "invoke", allArguments, argumentTypes, methodInterceptResult);
dubboInterceptor.afterMethod(enhancedInstance, "invoke", allArguments, argumentTypes, result); dubboInterceptor.afterMethod(enhancedInstance, "invoke", allArguments, argumentTypes, result);
......
...@@ -91,7 +91,7 @@ public class MotanProviderInterceptorTest { ...@@ -91,7 +91,7 @@ public class MotanProviderInterceptorTest {
@Test @Test
public void testInvokerWithRefSegment() throws Throwable { public void testInvokerWithRefSegment() throws Throwable {
HashMap attachments = new HashMap(); HashMap attachments = new HashMap();
attachments.put(Config.Plugin.Propagation.HEADER_NAME, "#AQA=#AQA=4WcWe0tQNQA=|3|1|#192.168.1.8:18002|#/portal/|#/testEntrySpan|#AQA=#AQA=Et0We0tQNQA="); attachments.put(Config.Plugin.Propagation.HEADER_NAME, "#AQA*#AQA*4WcWe0tQNQA*|3|1|#192.168.1.8:18002|#/portal/|#/testEntrySpan|#AQA*#AQA*Et0We0tQNQA*");
when(request.getAttachments()).thenReturn(attachments); when(request.getAttachments()).thenReturn(attachments);
invokeInterceptor.beforeMethod(enhancedInstance, "execute", arguments, argumentType, null); invokeInterceptor.beforeMethod(enhancedInstance, "execute", arguments, argumentType, null);
......
...@@ -90,7 +90,7 @@ public class ResinV3InterceptorTest { ...@@ -90,7 +90,7 @@ public class ResinV3InterceptorTest {
@Test @Test
public void testWithSerializedContextData() throws Throwable { public void testWithSerializedContextData() throws Throwable {
when(request.getHeader(Config.Plugin.Propagation.HEADER_NAME)).thenReturn("#AQA=#AQA=4WcWe0tQNQA=|3|1|#192.168.1.8:18002|#/portal/|#/testEntrySpan|#AQA=#AQA=Et0We0tQNQA="); when(request.getHeader(Config.Plugin.Propagation.HEADER_NAME)).thenReturn("#AQA*#AQA*4WcWe0tQNQA*|3|1|#192.168.1.8:18002|#/portal/|#/testEntrySpan|#AQA*#AQA*Et0We0tQNQA*");
interceptor.beforeMethod(enhancedInstance, "service", arguments, argumentType, methodInterceptResult); interceptor.beforeMethod(enhancedInstance, "service", arguments, argumentType, methodInterceptResult);
interceptor.afterMethod(enhancedInstance, "service", arguments, argumentType, null); interceptor.afterMethod(enhancedInstance, "service", arguments, argumentType, null);
......
...@@ -92,7 +92,7 @@ public class ResinV4InterceptorTest { ...@@ -92,7 +92,7 @@ public class ResinV4InterceptorTest {
@Test @Test
public void testWithSerializedContextData() throws Throwable { public void testWithSerializedContextData() throws Throwable {
when(request.getHeader(Config.Plugin.Propagation.HEADER_NAME)).thenReturn("#AQA=#AQA=4WcWe0tQNQA=|3|1|#192.168.1.8:18002|#/portal/|#/testEntrySpan|#AQA=#AQA=Et0We0tQNQA="); when(request.getHeader(Config.Plugin.Propagation.HEADER_NAME)).thenReturn("#AQA*#AQA*4WcWe0tQNQA*|3|1|#192.168.1.8:18002|#/portal/|#/testEntrySpan|#AQA*#AQA*Et0We0tQNQA*");
interceptor.beforeMethod(enhancedInstance, "service", arguments, argumentType, methodInterceptResult); interceptor.beforeMethod(enhancedInstance, "service", arguments, argumentType, methodInterceptResult);
interceptor.afterMethod(enhancedInstance, "service", arguments, argumentType, null); interceptor.afterMethod(enhancedInstance, "service", arguments, argumentType, null);
......
...@@ -82,7 +82,7 @@ public class TomcatInterceptorTest { ...@@ -82,7 +82,7 @@ public class TomcatInterceptorTest {
@Test @Test
public void testWithSerializedContextData() throws Throwable { public void testWithSerializedContextData() throws Throwable {
when(request.getHeader(Config.Plugin.Propagation.HEADER_NAME)).thenReturn("#AQA=#AQA=4WcWe0tQNQA=|3|1|#192.168.1.8:18002|#/portal/|#/testEntrySpan|#AQA=#AQA=Et0We0tQNQA="); when(request.getHeader(Config.Plugin.Propagation.HEADER_NAME)).thenReturn("#AQA*#AQA*4WcWe0tQNQA*|3|1|#192.168.1.8:18002|#/portal/|#/testEntrySpan|#AQA*#AQA*Et0We0tQNQA*");
tomcatInterceptor.beforeMethod(enhancedInstance, "invoke", arguments, argumentType, methodInterceptResult); tomcatInterceptor.beforeMethod(enhancedInstance, "invoke", arguments, argumentType, methodInterceptResult);
tomcatInterceptor.afterMethod(enhancedInstance, "invoke", arguments, argumentType, null); tomcatInterceptor.afterMethod(enhancedInstance, "invoke", arguments, argumentType, null);
......
...@@ -181,7 +181,7 @@ public class SkywalkingSpanActivationTest { ...@@ -181,7 +181,7 @@ public class SkywalkingSpanActivationTest {
.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(); startSpan();
extractInterceptor.afterMethod(enhancedInstance, "extract", extractInterceptor.afterMethod(enhancedInstance, "extract",
new Object[] {"#AQA=#AQA=4WcWe0tQNQA=|3|1|#127.0.0.1:8080|#/portal/|#/testEntrySpan|#AQA=#AQA=Et0We0tQNQA="}, new Class[] {String.class}, null); new Object[] {"#AQA*#AQA*4WcWe0tQNQA*|3|1|#127.0.0.1:8080|#/portal/|#/testEntrySpan|#AQA*#AQA*Et0We0tQNQA*"}, new Class[] {String.class}, null);
stopSpan(); stopSpan();
TraceSegment tracingSegment = assertTraceSemgnets(); TraceSegment tracingSegment = assertTraceSemgnets();
...@@ -201,7 +201,7 @@ public class SkywalkingSpanActivationTest { ...@@ -201,7 +201,7 @@ public class SkywalkingSpanActivationTest {
.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(); startSpan();
extractInterceptor.afterMethod(enhancedInstance, "extract", extractInterceptor.afterMethod(enhancedInstance, "extract",
new Object[] {"#AQA=#AQA=4WcWe0tQNQA=|3|#192.168.1.8:18002|#/portal/|#/testEntrySpan|#AQA=#AQA=Et0We0tQNQA="}, new Class[] {String.class}, null); new Object[] {"#AQA*#AQA*4WcWe0tQNQA*|3|#192.168.1.8:18002|#/portal/|#/testEntrySpan|#AQA*#AQA*Et0We0tQNQA*"}, new Class[] {String.class}, null);
stopSpan(); stopSpan();
TraceSegment tracingSegment = assertTraceSemgnets(); TraceSegment tracingSegment = assertTraceSemgnets();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册