Agent Testing Project
MODIFY
dd-java-agent/dd-java-agent.gradle
dd-java-agent/dd-java-agent.gradle
@@ -31,22 +31,12 @@ dependencies {
testCompile deps.opentracingMock
}
-
-// include dd-java-agent:integrations:* in shadowJar
+// add all subprojects under 'integrations' to the agent's dependencies
Project java_agent_project = project
subprojects { subProj ->
- if (subProj.getPath().startsWith("${java_agent_project.path}:integrations:")) {
- java_agent_project.shadowJar.dependsOn "${subProj.path}:assemble"
- }
-}
-gradle.taskGraph.whenReady {
- if (gradle.taskGraph.hasTask("${java_agent_project.getPath()}:shadowJar")) {
- subprojects { subProj ->
- if (subProj.getPath().startsWith("${java_agent_project.path}:integrations:")) {
+ if (subProj.getPath().startsWith(java_agent_project.getPath() + ':integrations:')) {
java_agent_project.dependencies {
- compile(project(subProj.path))
- }
- }
+ compile(project(subProj.getPath()))
}
}
}

ADD
dd-java-agent/testing/src/main/java/dd/test/TestUtils2.java
+package dd.test;
+
+import com.datadoghq.agent.TracingAgent;
+
+public class TestUtils2 {
+
+ public static void canSeeAgent() {
+ System.out.println("Can I see the agent? " + TracingAgent.getAgentClassLoader());
+ }
+}

ADD
dd-java-agent/testing/testing.gradle
+apply from: "${rootDir}/gradle/java.gradle"
+
+dependencies {
+ compile deps.bytebuddy
+ compile deps.slf4j
+ compile deps.opentracing
+ compile deps.spock
+
+ compile project(':dd-trace')
+ compile project(':dd-java-agent:tooling')
+}

MODIFY
settings.gradle
settings.gradle
@@ -3,6 +3,7 @@ rootProject.name = 'dd-trace-java'
include ':dd-trace'
include ':dd-java-agent'
include ':dd-java-agent:benchmark'
+include ':dd-java-agent:testing'
include ':dd-java-agent:tooling'
include ':dd-java-agent-ittests'
include ':dd-trace-examples:dropwizard-mongo-client'

Agent Testing Project