Skip to content

Commit a6a3c22

Browse files
committed
migrate tests/jmh
1 parent fabaa0b commit a6a3c22

26 files changed

Lines changed: 42 additions & 42 deletions

File tree

dd-java-agent/agent-iast/src/jmh/java/com/datadog/iast/propagation/AbstractBenchmark.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public void start() {
6363
if (Config.get().getIastActivation() == ProductActivation.FULLY_ENABLED) {
6464
tagContext.withRequestContextDataIast(context.getIastContext());
6565
}
66-
span = AgentTracer.startSpan("benchmark", tagContext);
66+
span = AgentTracer.startSpan("iast", "benchmark", tagContext);
6767
scope = AgentTracer.activateSpan(span);
6868
}
6969

dd-java-agent/instrumentation-testing/src/main/groovy/datadog/trace/agent/test/log/injection/LogContextInjectionTestBase.groovy

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ abstract class LogContextInjectionTestBase extends InstrumentationSpecification
4141
def "Log context shows trace and span ids for active scope"() {
4242
when:
4343
put("foo", "bar")
44-
AgentSpan rootSpan = startSpan("root")
44+
AgentSpan rootSpan = startSpan("test", "root")
4545
AgentScope rootScope = activateSpan(rootSpan)
4646

4747
then:
@@ -50,7 +50,7 @@ abstract class LogContextInjectionTestBase extends InstrumentationSpecification
5050
get("foo") == "bar"
5151

5252
when:
53-
AgentSpan childSpan = startSpan("child")
53+
AgentSpan childSpan = startSpan("test", "child")
5454
AgentScope childScope = activateSpan(childSpan)
5555

5656
then:
@@ -93,7 +93,7 @@ abstract class LogContextInjectionTestBase extends InstrumentationSpecification
9393
@Override
9494
void run() {
9595
// other trace in scope
96-
final AgentSpan thread2Span = startSpan("root2")
96+
final AgentSpan thread2Span = startSpan("test", "root2")
9797
final AgentScope thread2Scope = activateSpan(thread2Span)
9898
try {
9999
thread2TraceId.set(get(CorrelationIdentifier.getTraceIdKey()))
@@ -104,7 +104,7 @@ abstract class LogContextInjectionTestBase extends InstrumentationSpecification
104104
}
105105
}
106106

107-
final AgentSpan mainSpan = startSpan("root")
107+
final AgentSpan mainSpan = startSpan("test", "root")
108108
final AgentScope mainScope = activateSpan(mainSpan)
109109
thread1.start()
110110
thread2.start()

dd-java-agent/instrumentation/akka/akka-actor-2.5/src/test/java/LinearTask.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ protected Integer compute() {
3131
return parent;
3232
} else {
3333
int next = parent + 1;
34-
AgentSpan span = startSpan(Integer.toString(next));
34+
AgentSpan span = startSpan("test", Integer.toString(next));
3535
try (AgentScope scope = activateSpan(span)) {
3636
LinearTask child = new LinearTask(next, depth);
3737
return child.fork().join();

dd-java-agent/instrumentation/axis2-1.3/src/test/groovy/datadog/trace/instrumentation/axis2/AxisEngineTest.groovy

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ class AxisEngineTest extends InstrumentationSpecification {
143143

144144
def "test send"() {
145145
when:
146-
AgentSpan span0 = startSpan('test')
146+
AgentSpan span0 = startSpan('test', 'test')
147147
span0.setServiceName('testSpan')
148148
activateSpan(span0).withCloseable {
149149
def message1 = testMessage()
@@ -170,7 +170,7 @@ class AxisEngineTest extends InstrumentationSpecification {
170170
when:
171171
def message = testMessage()
172172
message.setProperty(TRIGGER_PAUSE, true)
173-
AgentSpan span0 = startSpan('test')
173+
AgentSpan span0 = startSpan('test', 'test')
174174
span0.setServiceName('testSpan')
175175
activateSpan(span0).withCloseable {
176176
AxisEngine.send(message)
@@ -201,7 +201,7 @@ class AxisEngineTest extends InstrumentationSpecification {
201201
when:
202202
def message = testMessage()
203203
message.setProperty(TRIGGER_FAIL, true)
204-
AgentSpan span0 = startSpan('test')
204+
AgentSpan span0 = startSpan('test', 'test')
205205
span0.setServiceName('testSpan')
206206
activateSpan(span0).withCloseable {
207207
try {
@@ -224,7 +224,7 @@ class AxisEngineTest extends InstrumentationSpecification {
224224

225225
def "test sendFault"() {
226226
when:
227-
AgentSpan span0 = startSpan('test')
227+
AgentSpan span0 = startSpan('test', 'test')
228228
span0.setServiceName('testSpan')
229229
def faultMessage = createFaultMessageContext(testMessage(), new Exception('internal error'))
230230
activateSpan(span0).withCloseable {
@@ -243,7 +243,7 @@ class AxisEngineTest extends InstrumentationSpecification {
243243

244244
def "test receive"() {
245245
when:
246-
AgentSpan span0 = startSpan('test')
246+
AgentSpan span0 = startSpan('test', 'test')
247247
span0.setServiceName('testSpan')
248248
activateSpan(span0).withCloseable {
249249
def message1 = testMessage()
@@ -271,7 +271,7 @@ class AxisEngineTest extends InstrumentationSpecification {
271271
injectSysConfig("trace.axis.promote.resource-name", "true")
272272
when:
273273
// emulates AxisServlet behaviour
274-
AgentSpan span0 = startSpan("servlet.request")
274+
AgentSpan span0 = startSpan("test", "servlet.request")
275275
span0.setServiceName("testSpan")
276276
span0.setResourceName("POST /some/context/services/TestService")
277277
activateSpan(span0).withCloseable {
@@ -306,7 +306,7 @@ class AxisEngineTest extends InstrumentationSpecification {
306306
when:
307307
def message = testMessage()
308308
message.setProperty(TRIGGER_PAUSE, true)
309-
AgentSpan span0 = startSpan('test')
309+
AgentSpan span0 = startSpan('test', 'test')
310310
span0.setServiceName('testSpan')
311311
activateSpan(span0).withCloseable {
312312
AxisEngine.receive(message)
@@ -337,7 +337,7 @@ class AxisEngineTest extends InstrumentationSpecification {
337337
when:
338338
def message = testMessage()
339339
message.setProperty(TRIGGER_FAIL, true)
340-
AgentSpan span0 = startSpan('test')
340+
AgentSpan span0 = startSpan('test', 'test')
341341
span0.setServiceName('testSpan')
342342
activateSpan(span0).withCloseable {
343343
try {

dd-java-agent/instrumentation/axis2-1.3/src/test/groovy/datadog/trace/instrumentation/axis2/AxisTransportForkedTest.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ class AxisTransportForkedTest extends InstrumentationSpecification {
8383
message1.setProperty("TRANSPORT_HEADERS", ["foo":"bar"] as HashMap)
8484
def message2 = testMessage()
8585
// no action, expect span to use testDestination
86-
AgentSpan span0 = startSpan('test')
86+
AgentSpan span0 = startSpan('test', 'test')
8787
span0.setServiceName('testSpan')
8888
activateSpan(span0).withCloseable {
8989
AxisEngine.send(message1)

dd-java-agent/instrumentation/grizzly/grizzly-http-2.3.20/src/test/groovy/GrizzlyByteBodyInstrumentationTest.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class GrizzlyByteBodyInstrumentationTest extends InstrumentationSpecification {
4040
1 * attributeHolder.setAttribute('datadog.intercepted_request_body', Boolean.TRUE)
4141

4242
TagContext ctx = new TagContext().withRequestContextDataAppSec(new Object())
43-
def agentSpan = AgentTracer.startSpan('test-span', ctx)
43+
def agentSpan = AgentTracer.startSpan('test', 'test-span', ctx)
4444
this.scope = AgentTracer.activateSpan(agentSpan)
4545

4646
ss.registerCallback(EVENTS.requestBodyStart(), { RequestContext reqContext, StoredBodySupplier sup ->

dd-java-agent/instrumentation/grizzly/grizzly-http-2.3.20/src/test/groovy/GrizzlyCharBodyInstrumentationTest.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class GrizzlyCharBodyInstrumentationTest extends InstrumentationSpecification {
3434
1 * attributeHolder.setAttribute('datadog.intercepted_request_body', Boolean.TRUE)
3535

3636
TagContext ctx = new TagContext().withRequestContextDataAppSec(new Object())
37-
def agentSpan = AgentTracer.startSpan('test-span', ctx)
37+
def agentSpan = AgentTracer.startSpan('test', 'test-span', ctx)
3838
this.scope = AgentTracer.activateSpan(agentSpan)
3939

4040
ss.registerCallback(EVENTS.requestBodyStart(), { RequestContext reqContext, StoredBodySupplier sup ->

dd-java-agent/instrumentation/hibernate/hibernate-core-3.3/src/test/groovy/SessionTest.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -540,7 +540,7 @@ class SessionTest extends AbstractHibernateTest {
540540

541541

542542
def "test hibernate overlapping Sessions"() {
543-
AgentScope scope = activateSpan(startSpan("overlapping Sessions"))
543+
AgentScope scope = activateSpan(startSpan("test", "overlapping Sessions"))
544544

545545
def session1 = sessionFactory.openSession()
546546
session1.beginTransaction()

dd-java-agent/instrumentation/hibernate/hibernate-core-4.0/src/test/groovy/SessionTest.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -466,7 +466,7 @@ class SessionTest extends AbstractHibernateTest {
466466
def "test hibernate overlapping Sessions"() {
467467
setup:
468468

469-
AgentScope scope = activateSpan(startSpan("overlapping Sessions"))
469+
AgentScope scope = activateSpan(startSpan("test", "overlapping Sessions"))
470470

471471
def session1 = sessionFactory.openSession()
472472
session1.beginTransaction()

dd-java-agent/instrumentation/java/java-concurrent/java-concurrent-1.8/src/test/java/executor/recursive/RecursiveThreadPoolExecution.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public void run() {
2525
if (depth == maxDepth) {
2626
return;
2727
}
28-
AgentSpan span = startSpan(String.valueOf(depth));
28+
AgentSpan span = startSpan("test", String.valueOf(depth));
2929
try (AgentScope scope = activateSpan(span)) {
3030
executor.execute(new RecursiveThreadPoolExecution(executor, maxDepth, depth + 1));
3131
} finally {

0 commit comments

Comments
 (0)