Skip to content

Commit 8034e05

Browse files
Fix agent-testing tests
1 parent 90404bd commit 8034e05

23 files changed

+25
-25
lines changed

dd-java-agent/instrumentation-testing/build.gradle

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,15 @@ dependencies {
1313
implementation project(':dd-java-agent:agent-debugger')
1414

1515
implementation 'org.junit.platform:junit-platform-runner:1.9.0'
16+
17+
testImplementation project(':utils:test-utils')
18+
testImplementation project(':dd-java-agent:instrumentation:trace-annotation')
19+
20+
testImplementation group: 'cglib', name: 'cglib', version: '3.2.5'
21+
// test instrumenting java 1.1 bytecode
22+
testImplementation group: 'net.sf.jt400', name: 'jt400', version: '6.1'
23+
24+
// We have autoservices defined in test subtree, looks like we need this to be able to properly rebuild this
25+
testAnnotationProcessor libs.autoservice.processor
26+
testCompileOnly libs.autoservice.annotation
1627
}

dd-java-agent/testing/src/test/groovy/context/FieldInjectionForkedTest.groovy renamed to dd-java-agent/instrumentation-testing/src/test/groovy/context/FieldInjectionForkedTest.groovy

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class FieldInjectionForkedTest extends AgentTestRunner {
3939
"Aborting transform for class name = " + typeName + ", loader = " + classLoader)
4040
}
4141

42-
super.onDiscovery(typeName, classLoader, module, loaded)
42+
Object.onDiscovery(typeName, classLoader, module, loaded)
4343
}
4444

4545
def "#keyClassName structure modified = #shouldModifyStructure"() {
@@ -72,12 +72,12 @@ class FieldInjectionForkedTest extends AgentTestRunner {
7272

7373
where:
7474
keyClass | shouldModifyStructure | isInstrumented
75-
KeyClass | true | true
76-
UntransformableKeyClass | false | false
77-
ValidSerializableKeyClass | true | true
78-
InvalidSerializableKeyClass | true | true
79-
ValidInheritsSerializableKeyClass | true | true
80-
InvalidInheritsSerializableKeyClass | true | true
75+
KeyClass | true | true
76+
UntransformableKeyClass | false | false
77+
ValidSerializableKeyClass | true | true
78+
InvalidSerializableKeyClass | true | true
79+
ValidInheritsSerializableKeyClass | true | true
80+
InvalidInheritsSerializableKeyClass | true | true
8181

8282
keyClassName = keyClass.getSimpleName()
8383
}

dd-java-agent/testing/src/test/groovy/excludefilter/ExcludeFilterForkedTest.groovy renamed to dd-java-agent/instrumentation-testing/src/test/groovy/excludefilter/ExcludeFilterForkedTest.groovy

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,13 @@ class ExcludeFilterForkedTest extends AgentTestRunner {
4141

4242
where:
4343
clazz | hasRunnable | hasExecutor | hasAccessor
44-
ExcludedRunnable | false | false | false
45-
NormalRunnable | true | false | true
46-
RunnableExcludedExecutor | true | false | true
47-
ExcludedExecutor | false | false | false
48-
NormalExecutor | false | true | true
49-
ExecutorExcludedRunnable | false | true | true
50-
ExecutorRunnable | true | true | true
44+
ExcludedRunnable | false | false | false
45+
NormalRunnable | true | false | true
46+
RunnableExcludedExecutor | true | false | true
47+
ExcludedExecutor | false | false | false
48+
NormalExecutor | false | true | true
49+
ExecutorExcludedRunnable | false | true | true
50+
ExecutorRunnable | true | true | true
5151
}
5252

5353
static class InjectionCheck {

0 commit comments

Comments
 (0)