Do we do want to ignore proxies?
If so, we have to change the test to be compatible.
MODIFY
dd-java-agent/agent-tooling/src/main/java/datadog/trace/agent/tooling/AgentInstaller.java
dd-java-agent/agent-tooling/src/main/java/datadog/trace/agent/tooling/AgentInstaller.java
@@ -48,7 +48,7 @@ public class AgentInstaller {
.or(nameStartsWith("datadog.opentracing."))
.or(nameStartsWith("datadog.slf4j."))
.or(nameStartsWith("java.").and(not(nameStartsWith("java.util.concurrent."))))
- .or(nameStartsWith("com.sun.").and(not(nameStartsWith("com.sun.proxy."))))
+ .or(nameStartsWith("com.sun."))
.or(nameStartsWith("sun."))
.or(nameStartsWith("jdk."))
.or(nameStartsWith("org.aspectj."))

MODIFY
dd-java-agent/instrumentation/jms-1/src/test/groovy/JMS1Test.groovy
dd-java-agent/instrumentation/jms-1/src/test/groovy/JMS1Test.groovy
@@ -8,6 +8,8 @@ import spock.lang.Shared
import spock.lang.Unroll
import javax.jms.Connection
+import javax.jms.Message
+import javax.jms.MessageListener
import javax.jms.Session
import javax.jms.TextMessage
import java.util.concurrent.CountDownLatch
@@ -152,10 +154,13 @@ class JMS1Test extends AgentTestRunner {
def messageRef = new AtomicReference<TextMessage>()
def producer = session.createProducer(destination)
def consumer = session.createConsumer(destination)
- consumer.setMessageListener { message ->
+ consumer.setMessageListener new MessageListener() {
+ @Override
+ void onMessage(Message message) {
lock.await() // ensure the producer trace is reported first.
messageRef.set(message)
}
+ }
def message = session.createTextMessage("a message")
producer.send(message)

MODIFY
dd-java-agent/instrumentation/jms-2/src/test/groovy/JMS2Test.groovy
dd-java-agent/instrumentation/jms-2/src/test/groovy/JMS2Test.groovy
@@ -17,6 +17,8 @@ import org.hornetq.jms.client.HornetQMessageProducer
import spock.lang.Shared
import spock.lang.Unroll
+import javax.jms.Message
+import javax.jms.MessageListener
import javax.jms.Session
import javax.jms.TextMessage
import java.util.concurrent.CountDownLatch
@@ -143,10 +145,13 @@ class JMS2Test extends AgentTestRunner {
def messageRef = new AtomicReference<TextMessage>()
def producer = session.createProducer(destination)
def consumer = session.createConsumer(destination)
- consumer.setMessageListener { message ->
+ consumer.setMessageListener new MessageListener() {
+ @Override
+ void onMessage(Message message) {
lock.await() // ensure the producer trace is reported first.
messageRef.set(message)
}
+ }
def message = session.createTextMessage("a message")
producer.send(message)

Do we do want to ignore proxies?

If so, we have to change the test to be compatible.