Skip to content

Commit 65fcfcb

Browse files
committed
update
1 parent 85c7a9e commit 65fcfcb

File tree

9 files changed

+49
-86
lines changed

9 files changed

+49
-86
lines changed

instrumentation/apache-dubbo-2.7/javaagent/src/testDubbo/java/io/opentelemetry/javaagent/instrumentation/apachedubbo/v2_7/DubboAgentTest.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,9 @@ class DubboAgentTest extends AbstractDubboTest {
1919
protected InstrumentationExtension testing() {
2020
return testing;
2121
}
22+
23+
@Override
24+
protected boolean hasPeerService() {
25+
return true;
26+
}
2227
}

instrumentation/apache-dubbo-2.7/javaagent/src/testDubbo/java/io/opentelemetry/javaagent/instrumentation/apachedubbo/v2_7/DubboAgentTraceChainTest.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,9 @@ class DubboAgentTraceChainTest extends AbstractDubboTraceChainTest {
1919
protected InstrumentationExtension testing() {
2020
return testing;
2121
}
22+
23+
@Override
24+
protected boolean hasPeerService() {
25+
return true;
26+
}
2227
}

instrumentation/apache-dubbo-2.7/library-autoconfigure/src/test/java/io/opentelemetry/instrumentation/apachedubbo/v2_7/DubboTest.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,9 @@ class DubboTest extends AbstractDubboTest {
1818
protected InstrumentationExtension testing() {
1919
return testing;
2020
}
21+
22+
@Override
23+
protected boolean hasPeerService() {
24+
return false;
25+
}
2126
}

instrumentation/apache-dubbo-2.7/library-autoconfigure/src/test/java/io/opentelemetry/instrumentation/apachedubbo/v2_7/DubboTraceChainTest.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,9 @@ class DubboTraceChainTest extends AbstractDubboTraceChainTest {
1818
protected InstrumentationExtension testing() {
1919
return testing;
2020
}
21+
22+
@Override
23+
protected boolean hasPeerService() {
24+
return false;
25+
}
2126
}

instrumentation/apache-dubbo-2.7/library-autoconfigure/src/test/java/io/opentelemetry/instrumentation/apachedubbo/v2_7/TestOpenTelemetryClientFilter.java

Lines changed: 0 additions & 48 deletions
This file was deleted.

instrumentation/apache-dubbo-2.7/library-autoconfigure/src/test/java/io/opentelemetry/instrumentation/apachedubbo/v2_7/TestOpenTelemetryServerFilter.java

Lines changed: 0 additions & 31 deletions
This file was deleted.

instrumentation/apache-dubbo-2.7/library-autoconfigure/src/test/resources/META-INF/services/org.apache.dubbo.rpc.Filter

Lines changed: 0 additions & 2 deletions
This file was deleted.

instrumentation/apache-dubbo-2.7/testing/src/main/java/io/opentelemetry/instrumentation/apachedubbo/v2_7/AbstractDubboTest.java

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ public abstract class AbstractDubboTest {
5252

5353
protected abstract InstrumentationExtension testing();
5454

55+
protected abstract boolean hasPeerService();
56+
5557
@RegisterExtension static final AutoCleanupExtension cleanup = AutoCleanupExtension.create();
5658

5759
@BeforeAll
@@ -142,7 +144,11 @@ void testApacheDubboBase() throws ReflectiveOperationException {
142144
RpcIncubatingAttributes.RpcSystemIncubatingValues.APACHE_DUBBO),
143145
equalTo(RPC_SERVICE, "org.apache.dubbo.rpc.service.GenericService"),
144146
equalTo(RPC_METHOD, "$invoke"),
145-
equalTo(PEER_SERVICE, "test-peer-service"),
147+
satisfies(
148+
PEER_SERVICE,
149+
k ->
150+
k.isEqualTo(
151+
hasPeerService() ? "test-peer-service" : null)),
146152
equalTo(SERVER_ADDRESS, "localhost"),
147153
satisfies(SERVER_PORT, k -> k.isInstanceOf(Long.class)),
148154
satisfies(
@@ -274,7 +280,11 @@ void testApacheDubboTest()
274280
RpcIncubatingAttributes.RpcSystemIncubatingValues.APACHE_DUBBO),
275281
equalTo(RPC_SERVICE, "org.apache.dubbo.rpc.service.GenericService"),
276282
equalTo(RPC_METHOD, "$invokeAsync"),
277-
equalTo(PEER_SERVICE, "test-peer-service"),
283+
satisfies(
284+
PEER_SERVICE,
285+
k ->
286+
k.isEqualTo(
287+
hasPeerService() ? "test-peer-service" : null)),
278288
equalTo(SERVER_ADDRESS, "localhost"),
279289
satisfies(SERVER_PORT, k -> k.isInstanceOf(Long.class)),
280290
satisfies(

instrumentation/apache-dubbo-2.7/testing/src/main/java/io/opentelemetry/instrumentation/apachedubbo/v2_7/AbstractDubboTraceChainTest.java

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ static void tearDown() {
6464

6565
protected abstract InstrumentationExtension testing();
6666

67+
protected abstract boolean hasPeerService();
68+
6769
ReferenceConfig<HelloService> configureClient(int port) {
6870
ReferenceConfig<HelloService> reference = new ReferenceConfig<>();
6971
reference.setInterface(HelloService.class);
@@ -184,7 +186,11 @@ void testDubboChain() throws ReflectiveOperationException {
184186
RpcIncubatingAttributes.RpcSystemIncubatingValues.APACHE_DUBBO),
185187
equalTo(RPC_SERVICE, "org.apache.dubbo.rpc.service.GenericService"),
186188
equalTo(RPC_METHOD, "$invoke"),
187-
equalTo(PEER_SERVICE, "test-peer-service"),
189+
satisfies(
190+
PEER_SERVICE,
191+
k ->
192+
k.isEqualTo(
193+
hasPeerService() ? "test-peer-service" : null)),
188194
equalTo(SERVER_ADDRESS, "localhost"),
189195
satisfies(SERVER_PORT, k -> k.isInstanceOf(Long.class)),
190196
satisfies(
@@ -219,7 +225,11 @@ void testDubboChain() throws ReflectiveOperationException {
219225
RpcIncubatingAttributes.RpcSystemIncubatingValues.APACHE_DUBBO),
220226
equalTo(RPC_SERVICE, "org.apache.dubbo.rpc.service.GenericService"),
221227
equalTo(RPC_METHOD, "$invoke"),
222-
equalTo(PEER_SERVICE, "test-peer-service"),
228+
satisfies(
229+
PEER_SERVICE,
230+
k ->
231+
k.isEqualTo(
232+
hasPeerService() ? "test-peer-service" : null)),
223233
equalTo(SERVER_ADDRESS, "localhost"),
224234
satisfies(SERVER_PORT, k -> k.isInstanceOf(Long.class)),
225235
satisfies(
@@ -383,7 +393,11 @@ void testDubboChainInJvm() throws ReflectiveOperationException {
383393
RpcIncubatingAttributes.RpcSystemIncubatingValues.APACHE_DUBBO),
384394
equalTo(RPC_SERVICE, "org.apache.dubbo.rpc.service.GenericService"),
385395
equalTo(RPC_METHOD, "$invoke"),
386-
equalTo(PEER_SERVICE, "test-peer-service"),
396+
satisfies(
397+
PEER_SERVICE,
398+
k ->
399+
k.isEqualTo(
400+
hasPeerService() ? "test-peer-service" : null)),
387401
equalTo(SERVER_ADDRESS, "localhost"),
388402
satisfies(SERVER_PORT, k -> k.isInstanceOf(Long.class)),
389403
satisfies(

0 commit comments

Comments
 (0)