From 55fe3ba228552b6f86ad8d00a3c2eec21472927b Mon Sep 17 00:00:00 2001 From: Tyler Benson Date: Tue, 10 Dec 2019 10:08:04 -0800 Subject: [PATCH] Move dropwizard tests to dropwizard project This separate directory helps to avoid conflicts with JerseyTest. ResourceTestRule usage in JerseyTest was causing some odd interactions which resulted in traces not being reported. --- .../dropwizard/dropwizard.gradle | 22 +++++++++++++++++++ .../test/groovy/DropwizardAsyncTest.groovy | 0 .../src/test/groovy/DropwizardTest.groovy | 0 .../test/groovy/JettyTestInstrumentation.java | 0 .../jax-rs-annotations-2.gradle | 17 +++++++------- 5 files changed, 30 insertions(+), 9 deletions(-) rename dd-java-agent/instrumentation/{jax-rs-annotations-2 => dropwizard}/src/test/groovy/DropwizardAsyncTest.groovy (100%) rename dd-java-agent/instrumentation/{jax-rs-annotations-2 => dropwizard}/src/test/groovy/DropwizardTest.groovy (100%) rename dd-java-agent/instrumentation/{jax-rs-annotations-2 => dropwizard}/src/test/groovy/JettyTestInstrumentation.java (100%) diff --git a/dd-java-agent/instrumentation/dropwizard/dropwizard.gradle b/dd-java-agent/instrumentation/dropwizard/dropwizard.gradle index ff6901ae6f..e9cded163a 100644 --- a/dd-java-agent/instrumentation/dropwizard/dropwizard.gradle +++ b/dd-java-agent/instrumentation/dropwizard/dropwizard.gradle @@ -1 +1,23 @@ apply from: "${rootDir}/gradle/java.gradle" + +//apply plugin: 'org.unbroken-dome.test-sets' +// +//testSets { +// latestDepTest { +// dirName = 'test' +// } +//} + +dependencies { + testCompile project(':dd-java-agent:instrumentation:java-concurrent') + testCompile project(':dd-java-agent:instrumentation:jax-rs-annotations-2') + testCompile project(':dd-java-agent:instrumentation:servlet:request-3') + + // First version with DropwizardTestSupport: + testCompile group: 'io.dropwizard', name: 'dropwizard-testing', version: '0.8.0' + testCompile group: 'javax.xml.bind', name: 'jaxb-api', version: '2.2.3' + testCompile group: 'com.fasterxml.jackson.module', name: 'jackson-module-afterburner', version: '2.9.10' + + // Anything 1.0+ fails with a java.lang.NoClassDefFoundError: org/eclipse/jetty/server/RequestLog +// latestDepTestCompile group: 'io.dropwizard', name: 'dropwizard-testing', version: '1.+' +} diff --git a/dd-java-agent/instrumentation/jax-rs-annotations-2/src/test/groovy/DropwizardAsyncTest.groovy b/dd-java-agent/instrumentation/dropwizard/src/test/groovy/DropwizardAsyncTest.groovy similarity index 100% rename from dd-java-agent/instrumentation/jax-rs-annotations-2/src/test/groovy/DropwizardAsyncTest.groovy rename to dd-java-agent/instrumentation/dropwizard/src/test/groovy/DropwizardAsyncTest.groovy diff --git a/dd-java-agent/instrumentation/jax-rs-annotations-2/src/test/groovy/DropwizardTest.groovy b/dd-java-agent/instrumentation/dropwizard/src/test/groovy/DropwizardTest.groovy similarity index 100% rename from dd-java-agent/instrumentation/jax-rs-annotations-2/src/test/groovy/DropwizardTest.groovy rename to dd-java-agent/instrumentation/dropwizard/src/test/groovy/DropwizardTest.groovy diff --git a/dd-java-agent/instrumentation/jax-rs-annotations-2/src/test/groovy/JettyTestInstrumentation.java b/dd-java-agent/instrumentation/dropwizard/src/test/groovy/JettyTestInstrumentation.java similarity index 100% rename from dd-java-agent/instrumentation/jax-rs-annotations-2/src/test/groovy/JettyTestInstrumentation.java rename to dd-java-agent/instrumentation/dropwizard/src/test/groovy/JettyTestInstrumentation.java diff --git a/dd-java-agent/instrumentation/jax-rs-annotations-2/jax-rs-annotations-2.gradle b/dd-java-agent/instrumentation/jax-rs-annotations-2/jax-rs-annotations-2.gradle index f691568a9c..bb9ca60ca3 100644 --- a/dd-java-agent/instrumentation/jax-rs-annotations-2/jax-rs-annotations-2.gradle +++ b/dd-java-agent/instrumentation/jax-rs-annotations-2/jax-rs-annotations-2.gradle @@ -13,13 +13,13 @@ muzzle { apply from: "${rootDir}/gradle/java.gradle" -//apply plugin: 'org.unbroken-dome.test-sets' -// -//testSets { -// latestDepTest { -// dirName = 'test' -// } -//} +apply plugin: 'org.unbroken-dome.test-sets' + +testSets { + latestDepTest { + dirName = 'test' + } +} dependencies { compileOnly group: 'javax.ws.rs', name: 'javax.ws.rs-api', version: '2.0' @@ -32,6 +32,5 @@ dependencies { testCompile group: 'javax.xml.bind', name: 'jaxb-api', version: '2.2.3' testCompile group: 'com.fasterxml.jackson.module', name: 'jackson-module-afterburner', version: '2.9.10' - // Anything 1.0+ fails with a java.lang.NoClassDefFoundError: org/eclipse/jetty/server/RequestLog -// latestDepTestCompile group: 'io.dropwizard', name: 'dropwizard-testing', version: '1.+' + latestDepTestCompile group: 'io.dropwizard', name: 'dropwizard-testing', version: '1.+' }