aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-scanner-engine/src/main/java/org/sonar/scanner/mediumtest/FakePluginInstaller.java
diff options
context:
space:
mode:
authorJulien HENRY <julien.henry@sonarsource.com>2017-08-08 15:23:15 +0200
committerJulien HENRY <julien.henry@sonarsource.com>2017-09-07 08:33:31 +0200
commit6f777618d0ec3283600bccaae820a8b8783356db (patch)
treee0045b4286c4c67b0bbff27fc83a10828f95dcf9 /sonar-scanner-engine/src/main/java/org/sonar/scanner/mediumtest/FakePluginInstaller.java
parente4ec4b3ee79847c5bbbdce748982e4f1f18f7753 (diff)
downloadsonarqube-6f777618d0ec3283600bccaae820a8b8783356db.tar.gz
sonarqube-6f777618d0ec3283600bccaae820a8b8783356db.zip
SONAR-9679 Add plugins and their updated_at date to the scanner report
Diffstat (limited to 'sonar-scanner-engine/src/main/java/org/sonar/scanner/mediumtest/FakePluginInstaller.java')
-rw-r--r--sonar-scanner-engine/src/main/java/org/sonar/scanner/mediumtest/FakePluginInstaller.java23
1 files changed, 13 insertions, 10 deletions
diff --git a/sonar-scanner-engine/src/main/java/org/sonar/scanner/mediumtest/FakePluginInstaller.java b/sonar-scanner-engine/src/main/java/org/sonar/scanner/mediumtest/FakePluginInstaller.java
index 123dfe19ec0..8ba0187aedb 100644
--- a/sonar-scanner-engine/src/main/java/org/sonar/scanner/mediumtest/FakePluginInstaller.java
+++ b/sonar-scanner-engine/src/main/java/org/sonar/scanner/mediumtest/FakePluginInstaller.java
@@ -20,34 +20,37 @@
package org.sonar.scanner.mediumtest;
import java.io.File;
+import java.util.ArrayList;
import java.util.HashMap;
+import java.util.List;
import java.util.Map;
import org.sonar.api.Plugin;
import org.sonar.core.platform.PluginInfo;
import org.sonar.scanner.bootstrap.PluginInstaller;
+import org.sonar.scanner.bootstrap.ScannerPlugin;
public class FakePluginInstaller implements PluginInstaller {
- private final Map<String, PluginInfo> infosByKeys = new HashMap<>();
- private final Map<String, Plugin> instancesByKeys = new HashMap<>();
+ private final Map<String, ScannerPlugin> pluginsByKeys = new HashMap<>();
+ private final List<Object[]> mediumTestPlugins = new ArrayList<>();
- public FakePluginInstaller add(String pluginKey, File jarFile) {
- infosByKeys.put(pluginKey, PluginInfo.create(jarFile));
+ public FakePluginInstaller add(String pluginKey, File jarFile, long lastUpdatedAt) {
+ pluginsByKeys.put(pluginKey, new ScannerPlugin(pluginKey, lastUpdatedAt, PluginInfo.create(jarFile)));
return this;
}
- public FakePluginInstaller add(String pluginKey, Plugin instance) {
- instancesByKeys.put(pluginKey, instance);
+ public FakePluginInstaller add(String pluginKey, Plugin instance, long lastUpdatedAt) {
+ mediumTestPlugins.add(new Object[] {pluginKey, instance, lastUpdatedAt});
return this;
}
@Override
- public Map<String, PluginInfo> installRemotes() {
- return infosByKeys;
+ public Map<String, ScannerPlugin> installRemotes() {
+ return pluginsByKeys;
}
@Override
- public Map<String, Plugin> installLocals() {
- return instancesByKeys;
+ public List<Object[]> installLocals() {
+ return mediumTestPlugins;
}
}