Skip to content

Commit

Permalink
convert module apache-dubbo-2.7 test case from groovy to java (#12008)
Browse files Browse the repository at this point in the history
Co-authored-by: Jay DeLuca <[email protected]>
  • Loading branch information
shalk and jaydeluca authored Sep 3, 2024
1 parent 814c3ea commit d9f7030
Show file tree
Hide file tree
Showing 16 changed files with 836 additions and 568 deletions.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/*
* Copyright The OpenTelemetry Authors
* SPDX-License-Identifier: Apache-2.0
*/

package io.opentelemetry.javaagent.instrumentation.apachedubbo.v2_7;

import io.opentelemetry.instrumentation.apachedubbo.v2_7.AbstractDubboTest;
import io.opentelemetry.instrumentation.testing.junit.AgentInstrumentationExtension;
import io.opentelemetry.instrumentation.testing.junit.InstrumentationExtension;
import org.junit.jupiter.api.extension.RegisterExtension;

class DubboAgentTest extends AbstractDubboTest {

@RegisterExtension
static final InstrumentationExtension testing = AgentInstrumentationExtension.create();

@Override
protected InstrumentationExtension testing() {
return testing;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/*
* Copyright The OpenTelemetry Authors
* SPDX-License-Identifier: Apache-2.0
*/

package io.opentelemetry.javaagent.instrumentation.apachedubbo.v2_7;

import io.opentelemetry.instrumentation.apachedubbo.v2_7.AbstractDubboTraceChainTest;
import io.opentelemetry.instrumentation.testing.junit.AgentInstrumentationExtension;
import io.opentelemetry.instrumentation.testing.junit.InstrumentationExtension;
import org.junit.jupiter.api.extension.RegisterExtension;

class DubboAgentTraceChainTest extends AbstractDubboTraceChainTest {

@RegisterExtension
static final InstrumentationExtension testing = AgentInstrumentationExtension.create();

@Override
protected InstrumentationExtension testing() {
return testing;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,13 @@ enum DubboHeadersGetter implements TextMapGetter<DubboRequest> {
INSTANCE;

@Override
@SuppressWarnings("deprecation") // deprecation for dubbo 3.2.15
public Iterable<String> keys(DubboRequest request) {
return request.invocation().getAttachments().keySet();
}

@Override
@SuppressWarnings("deprecation") // deprecation for dubbo 3.2.15
public String get(DubboRequest request, String key) {
return request.invocation().getAttachment(key);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ final class TracingFilter implements Filter {
}

@Override
@SuppressWarnings("deprecation") // deprecation for RpcContext.getContext()
public Result invoke(Invoker<?> invoker, Invocation invocation) {
if (!(invocation instanceof RpcInvocation)) {
return invoker.invoke(invocation);
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/*
* Copyright The OpenTelemetry Authors
* SPDX-License-Identifier: Apache-2.0
*/

package io.opentelemetry.instrumentation.apachedubbo.v2_7;

import io.opentelemetry.instrumentation.testing.junit.InstrumentationExtension;
import io.opentelemetry.instrumentation.testing.junit.LibraryInstrumentationExtension;
import org.junit.jupiter.api.extension.RegisterExtension;

class DubboTest extends AbstractDubboTest {

@RegisterExtension
static final InstrumentationExtension testing = LibraryInstrumentationExtension.create();

@Override
protected InstrumentationExtension testing() {
return testing;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/*
* Copyright The OpenTelemetry Authors
* SPDX-License-Identifier: Apache-2.0
*/

package io.opentelemetry.instrumentation.apachedubbo.v2_7;

import io.opentelemetry.instrumentation.testing.junit.InstrumentationExtension;
import io.opentelemetry.instrumentation.testing.junit.LibraryInstrumentationExtension;
import org.junit.jupiter.api.extension.RegisterExtension;

class DubboTraceChainTest extends AbstractDubboTraceChainTest {

@RegisterExtension
static final InstrumentationExtension testing = LibraryInstrumentationExtension.create();

@Override
protected InstrumentationExtension testing() {
return testing;
}
}

This file was deleted.

Loading

0 comments on commit d9f7030

Please sign in to comment.