Search in sources :

Example 1 with ChildFirstClassLoader

use of com.navercorp.pinpoint.test.plugin.util.ChildFirstClassLoader in project pinpoint by naver.

the class SharedPinpointPluginTest method execute.

public void execute() throws Exception {
    logTestInformation();
    ClassLoader mavenDependencyResolverClassLoader = new ChildFirstClassLoader(URLUtils.fileToUrls(mavenDependencyResolverClassPaths));
    File testClazzLocation = new File(testLocation);
    List<TestInfo> testInfos = newTestCaseInfo(testParameters, testClazzLocation, repositoryUrls, mavenDependencyResolverClassLoader);
    executes(testInfos);
}
Also used : ChildFirstClassLoader(com.navercorp.pinpoint.test.plugin.util.ChildFirstClassLoader) ChildFirstClassLoader(com.navercorp.pinpoint.test.plugin.util.ChildFirstClassLoader) File(java.io.File)

Example 2 with ChildFirstClassLoader

use of com.navercorp.pinpoint.test.plugin.util.ChildFirstClassLoader in project pinpoint by naver.

the class SharedPinpointPluginTest method createTestClassLoader.

private ClassLoader createTestClassLoader(TestInfo testInfo) {
    List<File> dependencyFileList = testInfo.getDependencyFileList();
    if (logger.isDebugEnabled()) {
        for (File dependency : dependencyFileList) {
            logger.debug("testcase cl lib :{}", dependency);
        }
    }
    URL[] urls = URLUtils.fileToUrls(dependencyFileList);
    final ClassLoader testClassLoader = new ChildFirstClassLoader(urls, ProfilerClass.PINPOINT_PROFILER_CLASS);
    return testClassLoader;
}
Also used : ChildFirstClassLoader(com.navercorp.pinpoint.test.plugin.util.ChildFirstClassLoader) ChildFirstClassLoader(com.navercorp.pinpoint.test.plugin.util.ChildFirstClassLoader) File(java.io.File) URL(java.net.URL)

Example 3 with ChildFirstClassLoader

use of com.navercorp.pinpoint.test.plugin.util.ChildFirstClassLoader in project pinpoint by pinpoint-apm.

the class SharedPinpointPluginTest method createTestClassLoader.

private ClassLoader createTestClassLoader(TestInfo testInfo) {
    List<File> dependencyFileList = testInfo.getDependencyFileList();
    if (logger.isDebugEnabled()) {
        for (File dependency : dependencyFileList) {
            logger.debug("testcase cl lib :{}", dependency);
        }
    }
    URL[] urls = URLUtils.fileToUrls(dependencyFileList);
    final ClassLoader testClassLoader = new ChildFirstClassLoader(urls, ProfilerClass.PINPOINT_PROFILER_CLASS);
    return testClassLoader;
}
Also used : ChildFirstClassLoader(com.navercorp.pinpoint.test.plugin.util.ChildFirstClassLoader) ChildFirstClassLoader(com.navercorp.pinpoint.test.plugin.util.ChildFirstClassLoader) File(java.io.File) URL(java.net.URL)

Example 4 with ChildFirstClassLoader

use of com.navercorp.pinpoint.test.plugin.util.ChildFirstClassLoader in project pinpoint by naver.

the class ForkedPinpointPluginTest method getClassLoader.

private static ClassLoader getClassLoader(String agentType) throws IOException {
    if (agentType.startsWith(CHILD_CLASS_PATH_PREFIX)) {
        String jars = agentType.substring(CHILD_CLASS_PATH_PREFIX.length());
        final URL[] urls = getJarUrls(jars);
        for (URL url : urls) {
            if (logger.isDebugEnabled()) {
                logger.debug("child-runner lib:{}", url);
            }
        }
        logger.debug("ChildFirstClassLoader");
        return new ChildFirstClassLoader(urls, ClassLoader.getSystemClassLoader());
    }
    logger.debug("SystemClassloader");
    return ClassLoader.getSystemClassLoader();
}
Also used : ChildFirstClassLoader(com.navercorp.pinpoint.test.plugin.util.ChildFirstClassLoader) URL(java.net.URL)

Example 5 with ChildFirstClassLoader

use of com.navercorp.pinpoint.test.plugin.util.ChildFirstClassLoader in project pinpoint by pinpoint-apm.

the class ForkedPinpointPluginTest method getClassLoader.

private static ClassLoader getClassLoader(String agentType) throws IOException {
    if (agentType.startsWith(CHILD_CLASS_PATH_PREFIX)) {
        String jars = agentType.substring(CHILD_CLASS_PATH_PREFIX.length());
        final URL[] urls = getJarUrls(jars);
        for (URL url : urls) {
            if (logger.isDebugEnabled()) {
                logger.debug("child-runner lib:{}", url);
            }
        }
        logger.debug("ChildFirstClassLoader");
        return new ChildFirstClassLoader(urls, ClassLoader.getSystemClassLoader());
    }
    logger.debug("SystemClassloader");
    return ClassLoader.getSystemClassLoader();
}
Also used : ChildFirstClassLoader(com.navercorp.pinpoint.test.plugin.util.ChildFirstClassLoader) URL(java.net.URL)

Aggregations

ChildFirstClassLoader (com.navercorp.pinpoint.test.plugin.util.ChildFirstClassLoader)6 File (java.io.File)4 URL (java.net.URL)4