Fix failing tests
Add TracingAgent to list of bootstrap class Fix renaming tests Fix JMXFetch path splitting
This commit is contained in:
parent
c275143eae
commit
c41536cbe2
|
@ -105,7 +105,7 @@ public class DatadogClassLoader extends URLClassLoader {
|
|||
}
|
||||
|
||||
public BootstrapClassLoaderProxy(final URL[] urls) {
|
||||
super(urls);
|
||||
super(urls, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -155,7 +155,15 @@ public class JMXFetch {
|
|||
integrationName.add(config.replace(".yaml", ""));
|
||||
if (Config.get().isJmxFetchIntegrationEnabled(integrationName, false)) {
|
||||
final URL resource = JMXFetch.class.getResource("metricconfigs/" + config);
|
||||
result.add(resource.getPath().split("\\.jar!/")[1]);
|
||||
|
||||
// jar!/ means a file internal to a jar, only add the part after if it exists
|
||||
final String path = resource.getPath();
|
||||
final int filenameIndex = path.indexOf("jar!/");
|
||||
if (filenameIndex != -1) {
|
||||
result.add(path.substring(filenameIndex + 5));
|
||||
} else {
|
||||
result.add(path.substring(1));
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
|
|
|
@ -14,6 +14,7 @@ public final class Constants {
|
|||
*/
|
||||
public static final String[] BOOTSTRAP_PACKAGE_PREFIXES = {
|
||||
"datadog.slf4j",
|
||||
"datadog.trace.agent.TracingAgent",
|
||||
"datadog.trace.api",
|
||||
"datadog.trace.bootstrap",
|
||||
"datadog.trace.context",
|
||||
|
|
|
@ -14,23 +14,23 @@ class ShadowPackageRenamingTest extends Specification {
|
|||
final Class<?> ddClass =
|
||||
IntegrationTestUtils.getAgentClassLoader()
|
||||
.loadClass("datadog.trace.agent.tooling.AgentInstaller")
|
||||
final String userGuava =
|
||||
MapMaker.getProtectionDomain().getCodeSource().getLocation().getFile()
|
||||
final String agentGuavaDep =
|
||||
final URL userGuava =
|
||||
MapMaker.getProtectionDomain().getCodeSource().getLocation()
|
||||
final URL agentGuavaDep =
|
||||
ddClass
|
||||
.getClassLoader()
|
||||
.loadClass("com.google.common.collect.MapMaker")
|
||||
.getProtectionDomain()
|
||||
.getCodeSource()
|
||||
.getLocation()
|
||||
.getFile()
|
||||
final String agentSource =
|
||||
ddClass.getProtectionDomain().getCodeSource().getLocation().getFile()
|
||||
final URL agentSource =
|
||||
ddClass.getProtectionDomain().getCodeSource().getLocation()
|
||||
|
||||
expect:
|
||||
agentSource.matches(".*/agent-tooling-and-instrumentation[^/]*.jar")
|
||||
agentSource.getFile() == "/"
|
||||
agentSource.getProtocol() == "x-internal-jar"
|
||||
agentSource == agentGuavaDep
|
||||
agentSource != userGuava
|
||||
agentSource.getFile() != userGuava.getFile()
|
||||
}
|
||||
|
||||
def "java getLogger rewritten to safe logger"() {
|
||||
|
|
Loading…
Reference in New Issue