diff options
author | Jean-Baptiste Lievremont <jean-baptiste.lievremont@sonarsource.com> | 2014-02-12 12:10:52 +0100 |
---|---|---|
committer | Jean-Baptiste Lievremont <jean-baptiste.lievremont@sonarsource.com> | 2014-02-12 16:56:33 +0100 |
commit | b15bf44407e922b40e3af9180192e6f416b6528d (patch) | |
tree | e32aa986302deb9006f1c2bb7f519633f0c7b5fa /sonar-plugin-api/src | |
parent | 24904fbbf735aaaec1389f7cc9d07ca77c436634 (diff) | |
download | sonarqube-b15bf44407e922b40e3af9180192e6f416b6528d.tar.gz sonarqube-b15bf44407e922b40e3af9180192e6f416b6528d.zip |
SONAR-5058 Remove default configuration for global test exclusions
Diffstat (limited to 'sonar-plugin-api/src')
3 files changed, 6 insertions, 8 deletions
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/CoreProperties.java b/sonar-plugin-api/src/main/java/org/sonar/api/CoreProperties.java index 5e0795830d0..7c84dbfbf06 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/CoreProperties.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/CoreProperties.java @@ -176,7 +176,10 @@ public interface CoreProperties { String PROJECT_TEST_EXCLUSIONS_PROPERTY = "sonar.test.exclusions"; String GLOBAL_EXCLUSIONS_PROPERTY = "sonar.global.exclusions"; String GLOBAL_TEST_EXCLUSIONS_PROPERTY = "sonar.global.test.exclusions"; - String GLOBAL_TEST_EXCLUSIONS_DEFAULT = "**/package-info.java"; + /** + * @deprecated since 4.2. See http://jira.codehaus.org/browse/SONAR-5058 + */ + String GLOBAL_TEST_EXCLUSIONS_DEFAULT = ""; /** * @deprecated since 2.5. See discussion from http://jira.codehaus.org/browse/SONAR-1873 diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/resources/Project.java b/sonar-plugin-api/src/main/java/org/sonar/api/resources/Project.java index 2119c04a1f2..bb752c16980 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/resources/Project.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/resources/Project.java @@ -380,14 +380,9 @@ public class Project extends Resource implements Component { */ @Deprecated public String[] getTestExclusionPatterns() { - String[] globalTestExclusions = configuration.getStringArray(CoreProperties.GLOBAL_TEST_EXCLUSIONS_PROPERTY); - if (globalTestExclusions.length == 0) { - globalTestExclusions = new String[] {CoreProperties.GLOBAL_TEST_EXCLUSIONS_DEFAULT}; - } - return trimExclusions(ImmutableList.<String>builder() .add(configuration.getStringArray(CoreProperties.PROJECT_TEST_EXCLUSIONS_PROPERTY)) - .add(globalTestExclusions).build()); + .add(configuration.getStringArray(CoreProperties.GLOBAL_TEST_EXCLUSIONS_PROPERTY)).build()); } // http://jira.codehaus.org/browse/SONAR-2261 - exclusion must be trimmed diff --git a/sonar-plugin-api/src/test/java/org/sonar/api/resources/ProjectTest.java b/sonar-plugin-api/src/test/java/org/sonar/api/resources/ProjectTest.java index fe81cbf4035..9b96949564f 100644 --- a/sonar-plugin-api/src/test/java/org/sonar/api/resources/ProjectTest.java +++ b/sonar-plugin-api/src/test/java/org/sonar/api/resources/ProjectTest.java @@ -72,7 +72,7 @@ public class ProjectTest { Project project = new Project("key").setConfiguration(conf); assertThat(project.getExclusionPatterns()).isEmpty(); - assertThat(project.getTestExclusionPatterns()).containsOnly("**/package-info.java"); + assertThat(project.getTestExclusionPatterns()).isEmpty(); } @Test |