private Map<String, ScannerPlugin> loadPlugins(InstalledPlugin[] remotePlugins) {
Map<String, ScannerPlugin> infosByKey = new HashMap<>(remotePlugins.length);
- Profiler profiler = Profiler.create(LOG).startDebug("Load plugins");
+ Profiler profiler = Profiler.create(LOG).startInfo("Load/download plugins");
for (InstalledPlugin installedPlugin : remotePlugins) {
if (pluginPredicate.apply(installedPlugin.key)) {
infosByKey.put(info.getKey(), new ScannerPlugin(installedPlugin.key, installedPlugin.updatedAt, info));
}
}
-
- profiler.stopDebug();
+ profiler.stopInfo();
return infosByKey;
}
public void download(String filename, File toFile) throws IOException {
String url = format("/deploy/plugins/%s/%s", key, filename);
if (LOG.isDebugEnabled()) {
- LOG.debug("Download plugin {} to {}", filename, toFile);
+ LOG.debug("Download plugin '{}' to '{}'", filename, toFile);
} else {
- LOG.info("Download {}", filename);
+ LOG.debug("Download '{}'", filename);
}
WsResponse response = wsClient.call(new GetRequest(url));
int cachedFiles = FileUtils.listFiles(cache, new String[]{"jar"}, true).size();
assertThat(cachedFiles).isGreaterThan(5);
assertThat(result.getLogs()).contains("User cache: " + cache.getAbsolutePath());
- assertThat(result.getLogs()).contains("Download sonar-xoo-plugin-");
result = scan("shared/xoo-sample",
"sonar.userHome", userHome.getAbsolutePath());
- assertThat(cachedFiles).isEqualTo(cachedFiles);
+ int cachedFiles2 = FileUtils.listFiles(cache, new String[]{"jar"}, true).size();
+ assertThat(cachedFiles).isEqualTo(cachedFiles2);
assertThat(result.getLogs()).contains("User cache: " + cache.getAbsolutePath());
- assertThat(result.getLogs()).doesNotContain("Download sonar-xoo-plugin-");
}
@Test