Skip to content

Commit

Permalink
fix testcase failed
Browse files Browse the repository at this point in the history
  • Loading branch information
ascrutae committed Jul 22, 2017
1 parent 3aa5633 commit 61186fe
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 10 deletions.
Expand Up @@ -79,7 +79,7 @@ public void createSpanWithInvalidateContextCarrier() {

@Test
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());

AbstractSpan firstEntrySpan = ContextManager.createEntrySpan("/testFirstEntry", contextCarrier);
Expand Down Expand Up @@ -202,7 +202,7 @@ public void tearDown() throws Exception {

@Test
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());

AbstractSpan firstEntrySpan = ContextManager.createEntrySpan("/testFirstEntry", contextCarrier);
Expand Down
Expand Up @@ -148,7 +148,7 @@ public void testConsumerWithResultHasException() throws Throwable {
@Test
public void testProviderWithAttachment() throws Throwable {
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.afterMethod(enhancedInstance, "invoke", allArguments, argumentTypes, result);
Expand All @@ -160,7 +160,7 @@ public void testProviderBelow283() throws Throwable {
when(rpcContext.isConsumerSide()).thenReturn(false);
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.afterMethod(enhancedInstance, "invoke", allArguments, argumentTypes, result);
Expand Down
Expand Up @@ -91,7 +91,7 @@ public void testInvokerWithoutRefSegment() throws Throwable {
@Test
public void testInvokerWithRefSegment() throws Throwable {
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);

invokeInterceptor.beforeMethod(enhancedInstance, "execute", arguments, argumentType, null);
Expand Down
Expand Up @@ -90,7 +90,7 @@ public void testWithoutSerializedContextData() throws Throwable {

@Test
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.afterMethod(enhancedInstance, "service", arguments, argumentType, null);
Expand Down
Expand Up @@ -92,7 +92,7 @@ public void testWithoutSerializedContextData() throws Throwable {

@Test
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.afterMethod(enhancedInstance, "service", arguments, argumentType, null);
Expand Down
Expand Up @@ -82,7 +82,7 @@ public void testWithoutSerializedContextData() throws Throwable {

@Test
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.afterMethod(enhancedInstance, "invoke", arguments, argumentType, null);
Expand Down
Expand Up @@ -181,7 +181,7 @@ public void testExtractWithValidateContext() throws Throwable {
.withTag(Tags.PEER_HOST_IPV4.getKey(), "127.0.0.1").withTag(Tags.PEER_PORT.getKey(), 8080);
startSpan();
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();

TraceSegment tracingSegment = assertTraceSemgnets();
Expand All @@ -201,7 +201,7 @@ public void testExtractWithInValidateContext() throws Throwable {
.withTag(Tags.PEER_HOST_IPV4.getKey(), "127.0.0.1").withTag(Tags.PEER_PORT.getKey(), 8080);
startSpan();
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();

TraceSegment tracingSegment = assertTraceSemgnets();
Expand Down

0 comments on commit 61186fe

Please sign in to comment.