use of com.navercorp.pinpoint.test.plugin.shared.SharedProcessManager in project pinpoint by naver.
the class PinpointPluginTestSuite method createSharedCasesWithDependencies.
private List<PinpointPluginTestInstance> createSharedCasesWithDependencies(PluginTestContext context) throws ArtifactResolutionException, DependencyResolutionException {
DependencyResolver resolver = getDependencyResolver(this.repositories);
Map<String, List<Artifact>> dependencyMap = resolver.resolveDependencySets(dependencies);
if (logger.isDebugEnabled()) {
for (Map.Entry<String, List<Artifact>> entry : dependencyMap.entrySet()) {
logger.debug("{} {}", entry.getKey(), entry.getValue());
}
}
List<PinpointPluginTestInstance> cases = new ArrayList<>();
SharedProcessManager sharedProcessManager = new SharedProcessManager(context);
for (Map.Entry<String, List<Artifact>> artifactEntry : dependencyMap.entrySet()) {
final String testId = artifactEntry.getKey();
final List<Artifact> artifacts = artifactEntry.getValue();
List<String> libs = null;
try {
libs = resolveArtifactsAndDependencies(resolver, artifacts);
} catch (DependencyResolutionException e) {
// TODO Skip when running the test
logger.warn(e, "resolveArtifactsAndDependencies failed testId={}", testId);
continue;
}
PinpointPluginTestInstance testInstance = newSharedProcessPluginTestCase(context, testId, libs, sharedProcessManager);
cases.add(testInstance);
sharedProcessManager.registerTest(testInstance.getTestId(), artifacts);
}
return cases;
}
Aggregations