]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-3644 Remove Constants interface
authorJean-Baptiste Lievremont <jean-baptiste.lievremont@sonarsource.com>
Wed, 11 Sep 2013 07:46:03 +0000 (09:46 +0200)
committerJean-Baptiste Lievremont <jean-baptiste.lievremont@sonarsource.com>
Wed, 11 Sep 2013 07:46:03 +0000 (09:46 +0200)
plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/issue/ignore/Constants.java [deleted file]
plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/issue/ignore/IgnoreIssuesConfiguration.java
plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/issue/ignore/pattern/PatternsInitializer.java
plugins/sonar-core-plugin/src/test/java/org/sonar/plugins/core/issue/ignore/pattern/PatternsInitializerTest.java

diff --git a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/issue/ignore/Constants.java b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/issue/ignore/Constants.java
deleted file mode 100644 (file)
index f325280..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2013 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-
-package org.sonar.plugins.core.issue.ignore;
-
-public interface Constants {
-  // New Properties
-  String SUB_CATEGORY_IGNORE_ISSUES = "Ignore Issues";
-
-  String CORE_KEY_PREFIX = "sonar.issue.ignore";
-
-  String MULTICRITERIA_SUFFIX = ".multicriteria";
-  String PATTERNS_MULTICRITERIA_KEY = CORE_KEY_PREFIX + MULTICRITERIA_SUFFIX;
-  String RESOURCE_KEY = "resourceKey";
-  String RULE_KEY = "ruleKey";
-  String LINE_RANGE_KEY = "lineRange";
-
-  String BLOCK_SUFFIX = ".block";
-  String PATTERNS_BLOCK_KEY = CORE_KEY_PREFIX + BLOCK_SUFFIX;
-  String BEGIN_BLOCK_REGEXP = "beginBlockRegexp";
-  String END_BLOCK_REGEXP = "endBlockRegexp";
-
-  String ALLFILE_SUFFIX = ".allfile";
-  String PATTERNS_ALLFILE_KEY = CORE_KEY_PREFIX + ALLFILE_SUFFIX;
-  String FILE_REGEXP = "fileRegexp";
-}
index 3122ab25da1eacff96aaa6554bef55352b7e996a..07637bf877142ef3e506d810884280aa73902e3b 100644 (file)
@@ -21,7 +21,6 @@
 package org.sonar.plugins.core.issue.ignore;
 
 import org.sonar.api.PropertyType;
-
 import org.sonar.api.config.PropertyFieldDefinition;
 import org.sonar.api.resources.Qualifiers;
 import org.sonar.api.CoreProperties;
@@ -32,6 +31,25 @@ import java.util.List;
 
 public final class IgnoreIssuesConfiguration {
 
+  public static String SUB_CATEGORY_IGNORE_ISSUES = "Ignore Issues";
+
+  public static String CORE_KEY_PREFIX = "sonar.issue.ignore";
+
+  public static String MULTICRITERIA_SUFFIX = ".multicriteria";
+  public static String PATTERNS_MULTICRITERIA_KEY = CORE_KEY_PREFIX + MULTICRITERIA_SUFFIX;
+  public static String RESOURCE_KEY = "resourceKey";
+  public static String RULE_KEY = "ruleKey";
+  public static String LINE_RANGE_KEY = "lineRange";
+
+  public static String BLOCK_SUFFIX = ".block";
+  public static String PATTERNS_BLOCK_KEY = CORE_KEY_PREFIX + BLOCK_SUFFIX;
+  public static String BEGIN_BLOCK_REGEXP = "beginBlockRegexp";
+  public static String END_BLOCK_REGEXP = "endBlockRegexp";
+
+  public static String ALLFILE_SUFFIX = ".allfile";
+  public static String PATTERNS_ALLFILE_KEY = CORE_KEY_PREFIX + ALLFILE_SUFFIX;
+  public static String FILE_REGEXP = "fileRegexp";
+
   private IgnoreIssuesConfiguration() {}
 
   static final int LARGE_SIZE = 20;
@@ -39,66 +57,66 @@ public final class IgnoreIssuesConfiguration {
 
   public static List<PropertyDefinition> getPropertyDefinitions() {
     return ImmutableList.of(
-      PropertyDefinition.builder(Constants.PATTERNS_MULTICRITERIA_KEY)
+      PropertyDefinition.builder(PATTERNS_MULTICRITERIA_KEY)
         .category(CoreProperties.CATEGORY_EXCLUSIONS)
-        .subCategory(Constants.SUB_CATEGORY_IGNORE_ISSUES)
+        .subCategory(SUB_CATEGORY_IGNORE_ISSUES)
         .name("File Path Pattern")
         .description("Patterns used to identify which violations to switch off.<br/>" +
           "More information on the <a href=\"http://docs.codehaus.org/display/SONAR/Project+Administration#ProjectAdministration-IgnoringIssues\">Project Administration page</a>.<br/>")
         .onQualifiers(Qualifiers.PROJECT)
         .index(3)
         .fields(
-          PropertyFieldDefinition.build(Constants.RESOURCE_KEY)
+          PropertyFieldDefinition.build(RESOURCE_KEY)
             .name("File Path Pattern")
             .description("Pattern used to match files which should be ignored")
             .type(PropertyType.STRING)
             .indicativeSize(LARGE_SIZE)
             .build(),
-          PropertyFieldDefinition.build(Constants.RULE_KEY)
+          PropertyFieldDefinition.build(RULE_KEY)
             .name("Rule Key Pattern")
             .description("Pattern used to match rules which should be ignored")
             .type(PropertyType.STRING)
             .indicativeSize(LARGE_SIZE)
             .build(),
-          PropertyFieldDefinition.build(Constants.LINE_RANGE_KEY)
+          PropertyFieldDefinition.build(LINE_RANGE_KEY)
             .name("Line Range")
             .description("Range of lines that should be ignored.")
             .type(PropertyType.STRING)
             .indicativeSize(SMALL_SIZE)
             .build())
         .build(),
-        PropertyDefinition.builder(Constants.PATTERNS_BLOCK_KEY)
+        PropertyDefinition.builder(PATTERNS_BLOCK_KEY)
         .category(CoreProperties.CATEGORY_EXCLUSIONS)
-        .subCategory(Constants.SUB_CATEGORY_IGNORE_ISSUES)
+        .subCategory(SUB_CATEGORY_IGNORE_ISSUES)
         .name("Block exclusion patterns")
         .description("Patterns used to identify blocks in which violations are switched off.<br/>" +
           "More information on the <a href=\"http://docs.codehaus.org/display/SONAR/Project+Administration#ProjectAdministration-IgnoringIssues\">Project Administration page</a>.<br/>")
         .onQualifiers(Qualifiers.PROJECT)
         .index(2)
         .fields(
-          PropertyFieldDefinition.build(Constants.BEGIN_BLOCK_REGEXP)
+          PropertyFieldDefinition.build(BEGIN_BLOCK_REGEXP)
             .name("Regular expression for start of block")
             .description("If this regular expression is found in a file, then following lines are ignored until end of block.")
             .type(PropertyType.STRING)
             .indicativeSize(LARGE_SIZE)
             .build(),
-          PropertyFieldDefinition.build(Constants.END_BLOCK_REGEXP)
+          PropertyFieldDefinition.build(END_BLOCK_REGEXP)
             .name("Regular expression for end of block")
             .description("If specified, this regular expression is used to determine the end of code blocks to ignore. If not, then block ends at the end of file.")
             .type(PropertyType.STRING)
             .indicativeSize(LARGE_SIZE)
             .build())
         .build(),
-        PropertyDefinition.builder(Constants.PATTERNS_ALLFILE_KEY)
+        PropertyDefinition.builder(PATTERNS_ALLFILE_KEY)
         .category(CoreProperties.CATEGORY_EXCLUSIONS)
-        .subCategory(Constants.SUB_CATEGORY_IGNORE_ISSUES)
+        .subCategory(SUB_CATEGORY_IGNORE_ISSUES)
         .name("File exclusion patterns")
         .description("Patterns used to identify files in which violations are switched off.<br/>" +
           "More information on the <a href=\"http://docs.codehaus.org/display/SONAR/Project+Administration#ProjectAdministration-IgnoringIssues\">Project Administration page</a>.<br/>")
         .onQualifiers(Qualifiers.PROJECT)
         .index(1)
         .fields(
-          PropertyFieldDefinition.build(Constants.FILE_REGEXP)
+          PropertyFieldDefinition.build(FILE_REGEXP)
             .name("Regular expression")
             .description("If this regular expression is found in a file, then following lines are ignored.")
             .type(PropertyType.STRING)
index 35bb21ad6095092bc951cb229a0b9225581a0381..43aedfddaeec0e0cd2b27309c321162bc8009049 100644 (file)
@@ -27,7 +27,7 @@ import com.google.common.collect.Maps;
 import org.apache.commons.lang.StringUtils;
 import org.sonar.api.BatchExtension;
 import org.sonar.api.config.Settings;
-import org.sonar.plugins.core.issue.ignore.Constants;
+import org.sonar.plugins.core.issue.ignore.IgnoreIssuesConfiguration;
 
 import java.util.List;
 import java.util.Map;
@@ -85,12 +85,12 @@ public class PatternsInitializer implements BatchExtension {
 
   private void loadPatternsFromNewProperties() {
     // Patterns Multicriteria
-    String patternConf = StringUtils.defaultIfBlank(settings.getString(Constants.PATTERNS_MULTICRITERIA_KEY), "");
+    String patternConf = StringUtils.defaultIfBlank(settings.getString(IgnoreIssuesConfiguration.PATTERNS_MULTICRITERIA_KEY), "");
     for (String id : StringUtils.split(patternConf, ',')) {
-      String propPrefix = Constants.PATTERNS_MULTICRITERIA_KEY + "." + id + ".";
-      String resourceKeyPattern = settings.getString(propPrefix + Constants.RESOURCE_KEY);
-      String ruleKeyPattern = settings.getString(propPrefix + Constants.RULE_KEY);
-      String lineRange = settings.getString(propPrefix + Constants.LINE_RANGE_KEY);
+      String propPrefix = IgnoreIssuesConfiguration.PATTERNS_MULTICRITERIA_KEY + "." + id + ".";
+      String resourceKeyPattern = settings.getString(propPrefix + IgnoreIssuesConfiguration.RESOURCE_KEY);
+      String ruleKeyPattern = settings.getString(propPrefix + IgnoreIssuesConfiguration.RULE_KEY);
+      String lineRange = settings.getString(propPrefix + IgnoreIssuesConfiguration.LINE_RANGE_KEY);
       String[] fields = new String[] { resourceKeyPattern, ruleKeyPattern, lineRange };
       PatternDecoder.checkRegularLineConstraints(StringUtils.join(fields, ","), fields);
       Pattern pattern = new Pattern(firstNonNull(resourceKeyPattern, "*"), firstNonNull(ruleKeyPattern, "*"));
@@ -99,11 +99,11 @@ public class PatternsInitializer implements BatchExtension {
     }
 
     // Patterns Block
-    patternConf = StringUtils.defaultIfBlank(settings.getString(Constants.PATTERNS_BLOCK_KEY), "");
+    patternConf = StringUtils.defaultIfBlank(settings.getString(IgnoreIssuesConfiguration.PATTERNS_BLOCK_KEY), "");
     for (String id : StringUtils.split(patternConf, ',')) {
-      String propPrefix = Constants.PATTERNS_BLOCK_KEY + "." + id + ".";
-      String beginBlockRegexp = settings.getString(propPrefix + Constants.BEGIN_BLOCK_REGEXP);
-      String endBlockRegexp = settings.getString(propPrefix + Constants.END_BLOCK_REGEXP);
+      String propPrefix = IgnoreIssuesConfiguration.PATTERNS_BLOCK_KEY + "." + id + ".";
+      String beginBlockRegexp = settings.getString(propPrefix + IgnoreIssuesConfiguration.BEGIN_BLOCK_REGEXP);
+      String endBlockRegexp = settings.getString(propPrefix + IgnoreIssuesConfiguration.END_BLOCK_REGEXP);
       String[] fields = new String[] { beginBlockRegexp, endBlockRegexp };
       PatternDecoder.checkDoubleRegexpLineConstraints(StringUtils.join(fields, ","), fields);
       Pattern pattern = new Pattern().setBeginBlockRegexp(nullToEmpty(beginBlockRegexp)).setEndBlockRegexp(nullToEmpty(endBlockRegexp));
@@ -111,10 +111,10 @@ public class PatternsInitializer implements BatchExtension {
     }
 
     // Patterns All File
-    patternConf = StringUtils.defaultIfBlank(settings.getString(Constants.PATTERNS_ALLFILE_KEY), "");
+    patternConf = StringUtils.defaultIfBlank(settings.getString(IgnoreIssuesConfiguration.PATTERNS_ALLFILE_KEY), "");
     for (String id : StringUtils.split(patternConf, ',')) {
-      String propPrefix = Constants.PATTERNS_ALLFILE_KEY + "." + id + ".";
-      String allFileRegexp = settings.getString(propPrefix + Constants.FILE_REGEXP);
+      String propPrefix = IgnoreIssuesConfiguration.PATTERNS_ALLFILE_KEY + "." + id + ".";
+      String allFileRegexp = settings.getString(propPrefix + IgnoreIssuesConfiguration.FILE_REGEXP);
       PatternDecoder.checkWholeFileRegexp(allFileRegexp);
       Pattern pattern = new Pattern().setAllFileRegexp(nullToEmpty(allFileRegexp));
       allFilePatterns.add(pattern);
index c87f4696b8e817a15bc2ec37d3c60b660f3c1575..da78f3c5b955347aad44beb0e682c371160c91d0 100644 (file)
@@ -27,7 +27,6 @@ import org.junit.Test;
 import org.sonar.api.config.PropertyDefinitions;
 import org.sonar.api.config.Settings;
 import org.sonar.api.utils.SonarException;
-import org.sonar.plugins.core.issue.ignore.Constants;
 import org.sonar.plugins.core.issue.ignore.IgnoreIssuesConfiguration;
 
 import java.util.Set;
@@ -79,13 +78,13 @@ public class PatternsInitializerTest {
 
   @Test
   public void shouldReturnMulticriteriaPattern() {
-    settings.setProperty(Constants.PATTERNS_MULTICRITERIA_KEY, "1,2");
-    settings.setProperty(Constants.PATTERNS_MULTICRITERIA_KEY + ".1." + Constants.RESOURCE_KEY, "org/foo/Bar.java");
-    settings.setProperty(Constants.PATTERNS_MULTICRITERIA_KEY + ".1." + Constants.RULE_KEY, "*");
-    settings.setProperty(Constants.PATTERNS_MULTICRITERIA_KEY + ".1." + Constants.LINE_RANGE_KEY, "*");
-    settings.setProperty(Constants.PATTERNS_MULTICRITERIA_KEY + ".2." + Constants.RESOURCE_KEY, "org/foo/Hello.java");
-    settings.setProperty(Constants.PATTERNS_MULTICRITERIA_KEY + ".2." + Constants.RULE_KEY, "checkstyle:MagicNumber");
-    settings.setProperty(Constants.PATTERNS_MULTICRITERIA_KEY + ".2." + Constants.LINE_RANGE_KEY, "[15-200]");
+    settings.setProperty(IgnoreIssuesConfiguration.PATTERNS_MULTICRITERIA_KEY, "1,2");
+    settings.setProperty(IgnoreIssuesConfiguration.PATTERNS_MULTICRITERIA_KEY + ".1." + IgnoreIssuesConfiguration.RESOURCE_KEY, "org/foo/Bar.java");
+    settings.setProperty(IgnoreIssuesConfiguration.PATTERNS_MULTICRITERIA_KEY + ".1." + IgnoreIssuesConfiguration.RULE_KEY, "*");
+    settings.setProperty(IgnoreIssuesConfiguration.PATTERNS_MULTICRITERIA_KEY + ".1." + IgnoreIssuesConfiguration.LINE_RANGE_KEY, "*");
+    settings.setProperty(IgnoreIssuesConfiguration.PATTERNS_MULTICRITERIA_KEY + ".2." + IgnoreIssuesConfiguration.RESOURCE_KEY, "org/foo/Hello.java");
+    settings.setProperty(IgnoreIssuesConfiguration.PATTERNS_MULTICRITERIA_KEY + ".2." + IgnoreIssuesConfiguration.RULE_KEY, "checkstyle:MagicNumber");
+    settings.setProperty(IgnoreIssuesConfiguration.PATTERNS_MULTICRITERIA_KEY + ".2." + IgnoreIssuesConfiguration.LINE_RANGE_KEY, "[15-200]");
     patternsInitializer.initPatterns();
 
     assertThat(patternsInitializer.hasConfiguredPatterns()).isTrue();
@@ -98,38 +97,38 @@ public class PatternsInitializerTest {
 
   @Test(expected = SonarException.class)
   public void shouldLogInvalidResourceKey() {
-    settings.setProperty(Constants.PATTERNS_MULTICRITERIA_KEY, "1");
-    settings.setProperty(Constants.PATTERNS_MULTICRITERIA_KEY + ".1." + Constants.RESOURCE_KEY, "");
-    settings.setProperty(Constants.PATTERNS_MULTICRITERIA_KEY + ".1." + Constants.RULE_KEY, "*");
-    settings.setProperty(Constants.PATTERNS_MULTICRITERIA_KEY + ".1." + Constants.LINE_RANGE_KEY, "*");
+    settings.setProperty(IgnoreIssuesConfiguration.PATTERNS_MULTICRITERIA_KEY, "1");
+    settings.setProperty(IgnoreIssuesConfiguration.PATTERNS_MULTICRITERIA_KEY + ".1." + IgnoreIssuesConfiguration.RESOURCE_KEY, "");
+    settings.setProperty(IgnoreIssuesConfiguration.PATTERNS_MULTICRITERIA_KEY + ".1." + IgnoreIssuesConfiguration.RULE_KEY, "*");
+    settings.setProperty(IgnoreIssuesConfiguration.PATTERNS_MULTICRITERIA_KEY + ".1." + IgnoreIssuesConfiguration.LINE_RANGE_KEY, "*");
     patternsInitializer.initPatterns();
   }
 
   @Test(expected = SonarException.class)
   public void shouldLogInvalidRuleKey() {
-    settings.setProperty(Constants.PATTERNS_MULTICRITERIA_KEY, "1");
-    settings.setProperty(Constants.PATTERNS_MULTICRITERIA_KEY + ".1." + Constants.RESOURCE_KEY, "*");
-    settings.setProperty(Constants.PATTERNS_MULTICRITERIA_KEY + ".1." + Constants.RULE_KEY, "");
-    settings.setProperty(Constants.PATTERNS_MULTICRITERIA_KEY + ".1." + Constants.LINE_RANGE_KEY, "*");
+    settings.setProperty(IgnoreIssuesConfiguration.PATTERNS_MULTICRITERIA_KEY, "1");
+    settings.setProperty(IgnoreIssuesConfiguration.PATTERNS_MULTICRITERIA_KEY + ".1." + IgnoreIssuesConfiguration.RESOURCE_KEY, "*");
+    settings.setProperty(IgnoreIssuesConfiguration.PATTERNS_MULTICRITERIA_KEY + ".1." + IgnoreIssuesConfiguration.RULE_KEY, "");
+    settings.setProperty(IgnoreIssuesConfiguration.PATTERNS_MULTICRITERIA_KEY + ".1." + IgnoreIssuesConfiguration.LINE_RANGE_KEY, "*");
     patternsInitializer.initPatterns();
   }
 
   @Test(expected = SonarException.class)
   public void shouldLogInvalidLineRange() {
-    settings.setProperty(Constants.PATTERNS_MULTICRITERIA_KEY, "1");
-    settings.setProperty(Constants.PATTERNS_MULTICRITERIA_KEY + ".1." + Constants.RESOURCE_KEY, "org/foo/Bar.java");
-    settings.setProperty(Constants.PATTERNS_MULTICRITERIA_KEY + ".1." + Constants.RULE_KEY, "*");
-    settings.setProperty(Constants.PATTERNS_MULTICRITERIA_KEY + ".1." + Constants.LINE_RANGE_KEY, "notALineRange");
+    settings.setProperty(IgnoreIssuesConfiguration.PATTERNS_MULTICRITERIA_KEY, "1");
+    settings.setProperty(IgnoreIssuesConfiguration.PATTERNS_MULTICRITERIA_KEY + ".1." + IgnoreIssuesConfiguration.RESOURCE_KEY, "org/foo/Bar.java");
+    settings.setProperty(IgnoreIssuesConfiguration.PATTERNS_MULTICRITERIA_KEY + ".1." + IgnoreIssuesConfiguration.RULE_KEY, "*");
+    settings.setProperty(IgnoreIssuesConfiguration.PATTERNS_MULTICRITERIA_KEY + ".1." + IgnoreIssuesConfiguration.LINE_RANGE_KEY, "notALineRange");
     patternsInitializer.initPatterns();
   }
 
   @Test
   public void shouldReturnBlockPattern() {
-    settings.setProperty(Constants.PATTERNS_BLOCK_KEY, "1,2");
-    settings.setProperty(Constants.PATTERNS_BLOCK_KEY + ".1." + Constants.BEGIN_BLOCK_REGEXP, "// SONAR-OFF");
-    settings.setProperty(Constants.PATTERNS_BLOCK_KEY + ".1." + Constants.END_BLOCK_REGEXP, "// SONAR-ON");
-    settings.setProperty(Constants.PATTERNS_BLOCK_KEY + ".2." + Constants.BEGIN_BLOCK_REGEXP, "// FOO-OFF");
-    settings.setProperty(Constants.PATTERNS_BLOCK_KEY + ".2." + Constants.END_BLOCK_REGEXP, "// FOO-ON");
+    settings.setProperty(IgnoreIssuesConfiguration.PATTERNS_BLOCK_KEY, "1,2");
+    settings.setProperty(IgnoreIssuesConfiguration.PATTERNS_BLOCK_KEY + ".1." + IgnoreIssuesConfiguration.BEGIN_BLOCK_REGEXP, "// SONAR-OFF");
+    settings.setProperty(IgnoreIssuesConfiguration.PATTERNS_BLOCK_KEY + ".1." + IgnoreIssuesConfiguration.END_BLOCK_REGEXP, "// SONAR-ON");
+    settings.setProperty(IgnoreIssuesConfiguration.PATTERNS_BLOCK_KEY + ".2." + IgnoreIssuesConfiguration.BEGIN_BLOCK_REGEXP, "// FOO-OFF");
+    settings.setProperty(IgnoreIssuesConfiguration.PATTERNS_BLOCK_KEY + ".2." + IgnoreIssuesConfiguration.END_BLOCK_REGEXP, "// FOO-ON");
     patternsInitializer.initPatterns();
 
     assertThat(patternsInitializer.hasConfiguredPatterns()).isTrue();
@@ -142,25 +141,25 @@ public class PatternsInitializerTest {
 
   @Test(expected = SonarException.class)
   public void shouldLogInvalidStartBlockPattern() {
-    settings.setProperty(Constants.PATTERNS_BLOCK_KEY, "1");
-    settings.setProperty(Constants.PATTERNS_BLOCK_KEY + ".1." + Constants.BEGIN_BLOCK_REGEXP, "");
-    settings.setProperty(Constants.PATTERNS_BLOCK_KEY + ".1." + Constants.END_BLOCK_REGEXP, "// SONAR-ON");
+    settings.setProperty(IgnoreIssuesConfiguration.PATTERNS_BLOCK_KEY, "1");
+    settings.setProperty(IgnoreIssuesConfiguration.PATTERNS_BLOCK_KEY + ".1." + IgnoreIssuesConfiguration.BEGIN_BLOCK_REGEXP, "");
+    settings.setProperty(IgnoreIssuesConfiguration.PATTERNS_BLOCK_KEY + ".1." + IgnoreIssuesConfiguration.END_BLOCK_REGEXP, "// SONAR-ON");
     patternsInitializer.initPatterns();
   }
 
   @Test(expected = SonarException.class)
   public void shouldLogInvalidEndBlockPattern() {
-    settings.setProperty(Constants.PATTERNS_BLOCK_KEY, "1");
-    settings.setProperty(Constants.PATTERNS_BLOCK_KEY + ".1." + Constants.BEGIN_BLOCK_REGEXP, "// SONAR-OFF");
-    settings.setProperty(Constants.PATTERNS_BLOCK_KEY + ".1." + Constants.END_BLOCK_REGEXP, "");
+    settings.setProperty(IgnoreIssuesConfiguration.PATTERNS_BLOCK_KEY, "1");
+    settings.setProperty(IgnoreIssuesConfiguration.PATTERNS_BLOCK_KEY + ".1." + IgnoreIssuesConfiguration.BEGIN_BLOCK_REGEXP, "// SONAR-OFF");
+    settings.setProperty(IgnoreIssuesConfiguration.PATTERNS_BLOCK_KEY + ".1." + IgnoreIssuesConfiguration.END_BLOCK_REGEXP, "");
     patternsInitializer.initPatterns();
   }
 
   @Test
   public void shouldReturnAllFilePattern() {
-    settings.setProperty(Constants.PATTERNS_ALLFILE_KEY, "1,2");
-    settings.setProperty(Constants.PATTERNS_ALLFILE_KEY + ".1." + Constants.FILE_REGEXP, "@SONAR-IGNORE-ALL");
-    settings.setProperty(Constants.PATTERNS_ALLFILE_KEY + ".2." + Constants.FILE_REGEXP, "//FOO-IGNORE-ALL");
+    settings.setProperty(IgnoreIssuesConfiguration.PATTERNS_ALLFILE_KEY, "1,2");
+    settings.setProperty(IgnoreIssuesConfiguration.PATTERNS_ALLFILE_KEY + ".1." + IgnoreIssuesConfiguration.FILE_REGEXP, "@SONAR-IGNORE-ALL");
+    settings.setProperty(IgnoreIssuesConfiguration.PATTERNS_ALLFILE_KEY + ".2." + IgnoreIssuesConfiguration.FILE_REGEXP, "//FOO-IGNORE-ALL");
     patternsInitializer.initPatterns();
 
     assertThat(patternsInitializer.hasConfiguredPatterns()).isTrue();
@@ -173,8 +172,8 @@ public class PatternsInitializerTest {
 
   @Test(expected = SonarException.class)
   public void shouldLogInvalidAllFilePattern() {
-    settings.setProperty(Constants.PATTERNS_ALLFILE_KEY, "1");
-    settings.setProperty(Constants.PATTERNS_ALLFILE_KEY + ".1." + Constants.FILE_REGEXP, "");
+    settings.setProperty(IgnoreIssuesConfiguration.PATTERNS_ALLFILE_KEY, "1");
+    settings.setProperty(IgnoreIssuesConfiguration.PATTERNS_ALLFILE_KEY + ".1." + IgnoreIssuesConfiguration.FILE_REGEXP, "");
     patternsInitializer.initPatterns();
   }