Revert addition of tests. Too many issues
This commit is contained in:
parent
ae9f8e15dd
commit
f3bb22d8df
|
@ -80,8 +80,7 @@ public class AgentInstaller {
|
|||
"datadog.trace.bootstrap.instrumentation.java.concurrent.RunnableWrapper")
|
||||
.or(
|
||||
named(
|
||||
"datadog.trace.bootstrap.instrumentation.java.concurrent.CallableWrapper")
|
||||
.or(nameStartsWith("datadog.trace.agent.test"))))))
|
||||
"datadog.trace.bootstrap.instrumentation.java.concurrent.CallableWrapper")))))
|
||||
.or(nameStartsWith("datadog.opentracing."))
|
||||
.or(nameStartsWith("datadog.slf4j."))
|
||||
.or(nameStartsWith("net.bytebuddy."))
|
||||
|
|
|
@ -1,18 +0,0 @@
|
|||
package datadog.trace.agent.tooling
|
||||
|
||||
import datadog.trace.agent.test.AgentTestRunner
|
||||
import datadog.trace.agent.test.TestClass
|
||||
|
||||
class AgentInstallerTest extends AgentTestRunner {
|
||||
|
||||
def "Exception in instrumentation is limited to that instrumentation"() {
|
||||
given:
|
||||
TestClass instance = new TestClass()
|
||||
|
||||
when:
|
||||
String returnValue = instance.doSomething()
|
||||
|
||||
then:
|
||||
returnValue == "overridden value"
|
||||
}
|
||||
}
|
|
@ -1,26 +0,0 @@
|
|||
package datadog.trace.agent.test;
|
||||
|
||||
import com.google.auto.service.AutoService;
|
||||
import datadog.trace.agent.tooling.Instrumenter;
|
||||
import java.util.Collections;
|
||||
import java.util.Map;
|
||||
import net.bytebuddy.description.method.MethodDescription;
|
||||
import net.bytebuddy.description.type.TypeDescription;
|
||||
import net.bytebuddy.matcher.ElementMatcher;
|
||||
|
||||
@AutoService(Instrumenter.class)
|
||||
public class BadInstrumentation extends Instrumenter.Default {
|
||||
public BadInstrumentation() {
|
||||
super("bad-test-instrumentation");
|
||||
}
|
||||
|
||||
@Override
|
||||
public ElementMatcher<? super TypeDescription> typeMatcher() {
|
||||
throw new RuntimeException("Test Exception");
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<? extends ElementMatcher<? super MethodDescription>, String> transformers() {
|
||||
return Collections.emptyMap();
|
||||
}
|
||||
}
|
|
@ -1,37 +0,0 @@
|
|||
package datadog.trace.agent.test;
|
||||
|
||||
import static java.util.Collections.singletonMap;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.named;
|
||||
|
||||
import com.google.auto.service.AutoService;
|
||||
import datadog.trace.agent.tooling.Instrumenter;
|
||||
import java.util.Map;
|
||||
import net.bytebuddy.asm.Advice;
|
||||
import net.bytebuddy.description.method.MethodDescription;
|
||||
import net.bytebuddy.description.type.TypeDescription;
|
||||
import net.bytebuddy.matcher.ElementMatcher;
|
||||
|
||||
@AutoService(Instrumenter.class)
|
||||
public class GoodInstrumentation extends Instrumenter.Default {
|
||||
|
||||
public GoodInstrumentation() {
|
||||
super("good-test-instrumentation");
|
||||
}
|
||||
|
||||
@Override
|
||||
public ElementMatcher<? super TypeDescription> typeMatcher() {
|
||||
return named(TestClass.class.getName());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<? extends ElementMatcher<? super MethodDescription>, String> transformers() {
|
||||
return singletonMap(named("doSomething"), GoodInstrumentationAdvice.class.getName());
|
||||
}
|
||||
|
||||
public static class GoodInstrumentationAdvice {
|
||||
@Advice.OnMethodExit
|
||||
public static void changeReturn(@Advice.Return(readOnly = false) String originalValue) {
|
||||
originalValue = "overridden value";
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,7 +0,0 @@
|
|||
package datadog.trace.agent.test;
|
||||
|
||||
public class TestClass {
|
||||
public String doSomething() {
|
||||
return "original value";
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue