-
Notifications
You must be signed in to change notification settings - Fork 291
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1045 from DataDog/landerson/decorator-errors
Skip `@Decorator` classes when instrumenting
- Loading branch information
Showing
5 changed files
with
64 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
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 group: 'org.jboss.weld', name: 'weld-core', version: '2.3.0.Final' | ||
testCompile group: 'org.jboss.weld.se', name: 'weld-se', version: '2.3.0.Final' | ||
testCompile group: 'org.jboss.weld.se', name: 'weld-se-core', version: '2.3.0.Final' | ||
|
||
// Beyond 2.x is CDI 2+ and requires Java 8 | ||
latestDepTestCompile group: 'org.jboss.weld', name: 'weld-core', version: '2.+' | ||
latestDepTestCompile group: 'org.jboss.weld.se', name: 'weld-se', version: '2.+' | ||
latestDepTestCompile group: 'org.jboss.weld.se', name: 'weld-se-core', version: '2.+' | ||
} |
25 changes: 25 additions & 0 deletions
25
dd-java-agent/instrumentation/cdi-1.2/src/test/groovy/CDIContainerTest.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import datadog.trace.agent.test.AgentTestRunner | ||
import datadog.trace.instrumentation.TestBean | ||
import org.jboss.weld.environment.se.Weld | ||
import org.jboss.weld.environment.se.WeldContainer | ||
import org.jboss.weld.environment.se.threading.RunnableDecorator | ||
|
||
class CDIContainerTest extends AgentTestRunner { | ||
|
||
def "CDI container starts with agent"() { | ||
given: | ||
Weld builder = new Weld() | ||
.disableDiscovery() | ||
.addDecorator(RunnableDecorator) | ||
.addBeanClass(TestBean) | ||
|
||
when: | ||
WeldContainer container = builder.initialize() | ||
|
||
then: | ||
container.isRunning() | ||
|
||
cleanup: | ||
container?.shutdown() | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
...a-agent/instrumentation/cdi-1.2/src/test/java/datadog/trace/instrumentation/TestBean.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package datadog.trace.instrumentation; | ||
|
||
public class TestBean { | ||
|
||
private String someField; | ||
|
||
public String getSomeField() { | ||
return someField; | ||
} | ||
|
||
public void setSomeField(final String someField) { | ||
this.someField = someField; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters