summaryrefslogtreecommitdiffstats
path: root/sonar-batch
diff options
context:
space:
mode:
authorFabrice Bellingard <bellingard@gmail.com>2012-06-22 08:44:44 +0200
committerFabrice Bellingard <bellingard@gmail.com>2012-06-22 08:44:44 +0200
commit60adc862836a9eae573587041ff35d090da55d38 (patch)
treea05ec62ca277f6beb04cad16fafff13ada6ca9d1 /sonar-batch
parentf31049a0eb4d20822344ac43788031b9aaac9b46 (diff)
downloadsonarqube-60adc862836a9eae573587041ff35d090da55d38.tar.gz
sonarqube-60adc862836a9eae573587041ff35d090da55d38.zip
SONAR-2989 The English Pack plugin should never be excluded
Diffstat (limited to 'sonar-batch')
-rw-r--r--sonar-batch/src/main/java/org/sonar/batch/bootstrap/BatchPluginRepository.java12
-rw-r--r--sonar-batch/src/test/java/org/sonar/batch/bootstrap/BatchPluginRepositoryTest.java9
2 files changed, 18 insertions, 3 deletions
diff --git a/sonar-batch/src/main/java/org/sonar/batch/bootstrap/BatchPluginRepository.java b/sonar-batch/src/main/java/org/sonar/batch/bootstrap/BatchPluginRepository.java
index 2df80b73090..4572355f661 100644
--- a/sonar-batch/src/main/java/org/sonar/batch/bootstrap/BatchPluginRepository.java
+++ b/sonar-batch/src/main/java/org/sonar/batch/bootstrap/BatchPluginRepository.java
@@ -37,12 +37,18 @@ import org.sonar.core.plugins.PluginInstaller;
import org.sonar.core.plugins.RemotePlugin;
import java.io.File;
-import java.util.*;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
public class BatchPluginRepository implements PluginRepository {
private static final Logger LOG = LoggerFactory.getLogger(BatchPluginRepository.class);
private static final String CORE_PLUGIN = "core";
+ private static final String ENGLISH_PACK_PLUGIN = "l10nen";
private ArtifactDownloader artifactDownloader;
private Map<String, Plugin> pluginsByKey;
@@ -124,7 +130,7 @@ public class BatchPluginRepository implements PluginRepository {
}
boolean isAccepted(String pluginKey) {
- if (CORE_PLUGIN.equals(pluginKey)) {
+ if (CORE_PLUGIN.equals(pluginKey) || ENGLISH_PACK_PLUGIN.equals(pluginKey)) {
return true;
}
if (whiteList != null) {
@@ -133,7 +139,7 @@ public class BatchPluginRepository implements PluginRepository {
return blackList == null || !blackList.contains(pluginKey);
}
- public Map<PluginMetadata,Plugin> getPluginsByMetadata() {
+ public Map<PluginMetadata, Plugin> getPluginsByMetadata() {
Map<PluginMetadata, Plugin> result = Maps.newHashMap();
for (Map.Entry<String, PluginMetadata> entry : metadataByKey.entrySet()) {
String pluginKey = entry.getKey();
diff --git a/sonar-batch/src/test/java/org/sonar/batch/bootstrap/BatchPluginRepositoryTest.java b/sonar-batch/src/test/java/org/sonar/batch/bootstrap/BatchPluginRepositoryTest.java
index 944eb90977e..be647dc89a9 100644
--- a/sonar-batch/src/test/java/org/sonar/batch/bootstrap/BatchPluginRepositoryTest.java
+++ b/sonar-batch/src/test/java/org/sonar/batch/bootstrap/BatchPluginRepositoryTest.java
@@ -173,6 +173,15 @@ public class BatchPluginRepositoryTest {
assertThat(repository.isAccepted("core"), Matchers.is(true));
}
+ // English Pack plugin should never be blacklisted as it is mandatory for the I18nManager on batch side
+ @Test
+ public void englishPackPluginShouldNeverBeInBlackList() {
+ Settings settings = new Settings();
+ settings.setProperty(CoreProperties.BATCH_EXCLUDE_PLUGINS, "l10nen,findbugs");
+ repository = new BatchPluginRepository(mock(ArtifactDownloader.class), settings);
+ assertThat(repository.isAccepted("l10nen"), Matchers.is(true));
+ }
+
@Test
public void shouldCheckWhitelist() {
Settings settings = new Settings();