]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-5058 Remove default configuration for global test exclusions
authorJean-Baptiste Lievremont <jean-baptiste.lievremont@sonarsource.com>
Wed, 12 Feb 2014 11:10:52 +0000 (12:10 +0100)
committerJean-Baptiste Lievremont <jean-baptiste.lievremont@sonarsource.com>
Wed, 12 Feb 2014 15:56:33 +0000 (16:56 +0100)
plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/ExclusionProperties.java
sonar-plugin-api/src/main/java/org/sonar/api/CoreProperties.java
sonar-plugin-api/src/main/java/org/sonar/api/resources/Project.java
sonar-plugin-api/src/test/java/org/sonar/api/resources/ProjectTest.java

index 5a036041a684a020aed524cc589f040ca2b0f747..c93a25336d90e43ce9799020d015653b2e524da1 100644 (file)
@@ -62,7 +62,6 @@ class ExclusionProperties {
         .multiValues(true)
         .category(CoreProperties.CATEGORY_EXCLUSIONS)
         .subCategory(CoreProperties.SUBCATEGORY_FILES_EXCLUSIONS)
-        .defaultValue(CoreProperties.GLOBAL_TEST_EXCLUSIONS_DEFAULT)
         .index(1)
         .build(),
       PropertyDefinition.builder(CoreProperties.PROJECT_EXCLUSIONS_PROPERTY)
index 5e0795830d02850e1d2b4ee35c6127024188f684..7c84dbfbf063bf8438009f18f4f55b4e7922d5a4 100644 (file)
@@ -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
index 2119c04a1f26671c77a84a71841eab8a07d5c2d0..bb752c16980ce33a7c9a0a60c8464142c7aab2ef 100644 (file)
@@ -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
index fe81cbf4035134995b76c93ed29befa5427c37f8..9b96949564fe0577f7076eebe8c3b38fb7b3f84a 100644 (file)
@@ -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