diff options
author | Duarte Meneses <duarte.meneses@sonarsource.com> | 2015-09-30 11:54:28 +0200 |
---|---|---|
committer | Duarte Meneses <duarte.meneses@sonarsource.com> | 2015-09-30 16:28:09 +0200 |
commit | f7eb2f52db5155e72d81f74adfea3e2af7b41725 (patch) | |
tree | 86cfcdefa5c2d35a5c8e049ee1028e3f8fea4e41 /sonar-batch/src/test | |
parent | e0110b8cf875d491d10e3fdf71f0990e543e2dac (diff) | |
download | sonarqube-f7eb2f52db5155e72d81f74adfea3e2af7b41725.tar.gz sonarqube-f7eb2f52db5155e72d81f74adfea3e2af7b41725.zip |
SONAR-6818 Split batch/project WS in several simpler WS
Diffstat (limited to 'sonar-batch/src/test')
9 files changed, 91 insertions, 193 deletions
diff --git a/sonar-batch/src/test/java/org/sonar/batch/cache/NonAssociatedCacheSynchronizerTest.java b/sonar-batch/src/test/java/org/sonar/batch/cache/NonAssociatedCacheSynchronizerTest.java index 4181b2f16b2..7934c0fed45 100644 --- a/sonar-batch/src/test/java/org/sonar/batch/cache/NonAssociatedCacheSynchronizerTest.java +++ b/sonar-batch/src/test/java/org/sonar/batch/cache/NonAssociatedCacheSynchronizerTest.java @@ -19,23 +19,21 @@ */ package org.sonar.batch.cache; -import static org.mockito.Mockito.when; - -import org.sonarqube.ws.Rules.Rule; - -import org.sonarqube.ws.QualityProfiles.WsSearchResponse.QualityProfile; import com.google.common.collect.ImmutableList; +import org.junit.Before; import org.junit.Test; +import org.mockito.Mock; +import org.mockito.MockitoAnnotations; +import org.sonar.batch.repository.QualityProfileLoader; +import org.sonar.batch.rule.ActiveRulesLoader; +import org.sonar.batch.rule.LoadedActiveRule; +import org.sonarqube.ws.QualityProfiles.WsSearchResponse.QualityProfile; import java.util.Date; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.verifyNoMoreInteractions; -import org.mockito.MockitoAnnotations; -import org.junit.Before; -import org.mockito.Mock; -import org.sonar.batch.rule.ActiveRulesLoader; -import org.sonar.batch.repository.QualityProfileLoader; +import static org.mockito.Mockito.when; public class NonAssociatedCacheSynchronizerTest { private NonAssociatedCacheSynchronizer synchronizer; @@ -52,7 +50,7 @@ public class NonAssociatedCacheSynchronizerTest { MockitoAnnotations.initMocks(this); QualityProfile pf = QualityProfile.newBuilder().setKey("profile").setName("profile").setLanguage("lang").build(); - Rule ar = Rule.newBuilder().build(); + LoadedActiveRule ar = new LoadedActiveRule(); when(qualityProfileLoader.loadDefault(null)).thenReturn(ImmutableList.of(pf)); when(activeRulesLoader.load("profile", null)).thenReturn(ImmutableList.of(ar)); diff --git a/sonar-batch/src/test/java/org/sonar/batch/cache/ProjectCacheSynchronizerTest.java b/sonar-batch/src/test/java/org/sonar/batch/cache/ProjectCacheSynchronizerTest.java index 0d46388d01c..548e6124313 100644 --- a/sonar-batch/src/test/java/org/sonar/batch/cache/ProjectCacheSynchronizerTest.java +++ b/sonar-batch/src/test/java/org/sonar/batch/cache/ProjectCacheSynchronizerTest.java @@ -19,6 +19,8 @@ */ package org.sonar.batch.cache; +import org.sonar.batch.rule.LoadedActiveRule; + import com.google.common.base.Function; import com.google.common.collect.ImmutableList; import org.apache.commons.lang.mutable.MutableBoolean; @@ -49,7 +51,6 @@ import java.util.Date; import java.util.HashMap; import static org.mockito.Matchers.anyBoolean; - import static org.mockito.Matchers.any; import static org.mockito.Matchers.anyString; import static org.mockito.Matchers.eq; @@ -97,7 +98,7 @@ public class ProjectCacheSynchronizerTest { projectRepositoriesLoader = mock(DefaultProjectRepositoriesLoader.class); QualityProfile pf = QualityProfile.newBuilder().setKey("profile").setName("profile").setLanguage("lang").build(); - org.sonarqube.ws.Rules.Rule ar = org.sonarqube.ws.Rules.Rule.newBuilder().build(); + LoadedActiveRule ar = new LoadedActiveRule(); ProjectRepositories repo = mock(ProjectRepositories.class); when(qualityProfileLoader.load(PROJECT_KEY, null, null)).thenReturn(ImmutableList.of(pf)); diff --git a/sonar-batch/src/test/java/org/sonar/batch/mediumtest/BatchMediumTester.java b/sonar-batch/src/test/java/org/sonar/batch/mediumtest/BatchMediumTester.java index f488d8bfe65..ab8ee270983 100644 --- a/sonar-batch/src/test/java/org/sonar/batch/mediumtest/BatchMediumTester.java +++ b/sonar-batch/src/test/java/org/sonar/batch/mediumtest/BatchMediumTester.java @@ -19,8 +19,10 @@ */ package org.sonar.batch.mediumtest; -import org.sonar.batch.repository.FileData; +import org.sonar.api.rule.RuleKey; +import org.sonar.batch.rule.LoadedActiveRule; +import org.sonar.batch.repository.FileData; import org.sonar.api.utils.DateUtils; import com.google.common.collect.Table; import com.google.common.collect.HashBasedTable; @@ -217,33 +219,23 @@ public class BatchMediumTester { return this; } - public BatchMediumTesterBuilder activateRule(org.sonarqube.ws.Rules.Rule activeRule) { + public BatchMediumTesterBuilder activateRule(LoadedActiveRule activeRule) { activeRules.addActiveRule(activeRule); return this; } public BatchMediumTesterBuilder addActiveRule(String repositoryKey, String ruleKey, @Nullable String templateRuleKey, String name, @Nullable String severity, @Nullable String internalKey, @Nullable String languag) { - - org.sonarqube.ws.Rules.Rule.Builder builder = org.sonarqube.ws.Rules.Rule.newBuilder(); - builder.setRepo(repositoryKey); - if (internalKey != null) { - builder.setInternalKey(internalKey); - } - builder.setKey(repositoryKey + ":" + ruleKey); - builder.setName(name); - - if (templateRuleKey != null) { - builder.setTemplateKey(templateRuleKey); - } - if (languag != null) { - builder.setLang(languag); - } - if (severity != null) { - builder.setSeverity(severity); - } - - activeRules.addActiveRule(builder.build()); + LoadedActiveRule r = new LoadedActiveRule(); + + r.setInternalKey(internalKey); + r.setRuleKey(RuleKey.of(repositoryKey, ruleKey)); + r.setName(name); + r.setTemplateRuleKey(templateRuleKey); + r.setLanguage(languag); + r.setSeverity(severity); + + activeRules.addActiveRule(r); return this; } @@ -379,14 +371,14 @@ public class BatchMediumTester { } private static class FakeActiveRulesLoader implements ActiveRulesLoader { - private List<org.sonarqube.ws.Rules.Rule> activeRules = new LinkedList<>(); + private List<LoadedActiveRule> activeRules = new LinkedList<>(); - public void addActiveRule(org.sonarqube.ws.Rules.Rule activeRule) { + public void addActiveRule(LoadedActiveRule activeRule) { this.activeRules.add(activeRule); } @Override - public List<org.sonarqube.ws.Rules.Rule> load(String qualityProfileKey, MutableBoolean fromCache) { + public List<LoadedActiveRule> load(String qualityProfileKey, MutableBoolean fromCache) { return activeRules; } } diff --git a/sonar-batch/src/test/java/org/sonar/batch/mediumtest/issues/ChecksMediumTest.java b/sonar-batch/src/test/java/org/sonar/batch/mediumtest/issues/ChecksMediumTest.java index 29531f3e537..4c58eb3eb68 100644 --- a/sonar-batch/src/test/java/org/sonar/batch/mediumtest/issues/ChecksMediumTest.java +++ b/sonar-batch/src/test/java/org/sonar/batch/mediumtest/issues/ChecksMediumTest.java @@ -19,28 +19,28 @@ */ package org.sonar.batch.mediumtest.issues; -import org.sonarqube.ws.Rules.Rule.Param; - -import org.sonarqube.ws.Rules.Rule.Params; - -import javax.annotation.Nullable; - import com.google.common.collect.ImmutableMap; - -import java.io.File; -import java.io.IOException; -import java.util.List; - import org.apache.commons.io.FileUtils; import org.junit.After; import org.junit.Before; import org.junit.Test; import org.junit.rules.TemporaryFolder; +import org.sonar.api.rule.RuleKey; import org.sonar.batch.mediumtest.BatchMediumTester; import org.sonar.batch.mediumtest.TaskResult; import org.sonar.batch.protocol.output.BatchReport.Issue; +import org.sonar.batch.rule.LoadedActiveRule; import org.sonar.xoo.XooPlugin; import org.sonar.xoo.rule.XooRulesDefinition; + +import javax.annotation.Nullable; + +import java.io.File; +import java.io.IOException; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + import static org.assertj.core.api.Assertions.assertThat; public class ChecksMediumTest { @@ -109,29 +109,21 @@ public class ChecksMediumTest { assertThat(foundIssueAtLine2).isTrue(); } - private org.sonarqube.ws.Rules.Rule createActiveRuleWithParam(String repositoryKey, String ruleKey, @Nullable String templateRuleKey, String name, @Nullable String severity, + private LoadedActiveRule createActiveRuleWithParam(String repositoryKey, String ruleKey, @Nullable String templateRuleKey, String name, @Nullable String severity, @Nullable String internalKey, @Nullable String languag, String paramKey, String paramValue) { - org.sonarqube.ws.Rules.Rule.Builder builder = org.sonarqube.ws.Rules.Rule.newBuilder(); - builder.setRepo(repositoryKey); - builder.setKey(repositoryKey + ":" + ruleKey); - if (templateRuleKey != null) { - builder.setTemplateKey(templateRuleKey); - } - if (languag != null) { - builder.setLang(languag); - } - if (internalKey != null) { - builder.setInternalKey(internalKey); - } - if (severity != null) { - builder.setSeverity(severity); - } - builder.setName(name); - - Param param = Param.newBuilder().setKey(paramKey).setDefaultValue(paramValue).build(); - Params params = Params.newBuilder().addParams(param).build(); - builder.setParams(params); - return builder.build(); + LoadedActiveRule r = new LoadedActiveRule(); + + r.setInternalKey(internalKey); + r.setRuleKey(RuleKey.of(repositoryKey, ruleKey)); + r.setName(name); + r.setTemplateRuleKey(templateRuleKey); + r.setLanguage(languag); + r.setSeverity(severity); + + Map<String, String> params = new HashMap<>(); + params.put(paramKey, paramValue); + r.setParams(params); + return r; } } diff --git a/sonar-batch/src/test/java/org/sonar/batch/rule/ActiveRulesProviderTest.java b/sonar-batch/src/test/java/org/sonar/batch/rule/ActiveRulesProviderTest.java index 76a5cf1b07d..f459a341341 100644 --- a/sonar-batch/src/test/java/org/sonar/batch/rule/ActiveRulesProviderTest.java +++ b/sonar-batch/src/test/java/org/sonar/batch/rule/ActiveRulesProviderTest.java @@ -28,7 +28,6 @@ import org.mockito.Mock; import org.mockito.MockitoAnnotations; import org.sonar.api.batch.rule.ActiveRules; import org.sonar.api.rule.RuleKey; -import org.sonarqube.ws.Rules.Rule; import java.util.LinkedList; import java.util.List; @@ -52,13 +51,13 @@ public class ActiveRulesProviderTest { @Test public void testCombinationOfRules() { - Rule r1 = mockRule("rule1"); - Rule r2 = mockRule("rule2"); - Rule r3 = mockRule("rule3"); + LoadedActiveRule r1 = mockRule("rule1"); + LoadedActiveRule r2 = mockRule("rule2"); + LoadedActiveRule r3 = mockRule("rule3"); - List<Rule> qp1Rules = ImmutableList.of(r1, r2); - List<Rule> qp2Rules = ImmutableList.of(r2, r3); - List<Rule> qp3Rules = ImmutableList.of(r1, r3); + List<LoadedActiveRule> qp1Rules = ImmutableList.of(r1, r2); + List<LoadedActiveRule> qp2Rules = ImmutableList.of(r2, r3); + List<LoadedActiveRule> qp3Rules = ImmutableList.of(r1, r3); when(loader.load("qp1", null)).thenReturn(qp1Rules); when(loader.load("qp2", null)).thenReturn(qp2Rules); @@ -88,7 +87,10 @@ public class ActiveRulesProviderTest { return new ModuleQProfiles(profiles); } - private static Rule mockRule(String name) { - return Rule.newBuilder().setName(name).setRepo(name).setKey(name + ":" + name).build(); + private static LoadedActiveRule mockRule(String name) { + LoadedActiveRule r = new LoadedActiveRule(); + r.setName(name); + r.setRuleKey(RuleKey.of(name, name)); + return r; } } diff --git a/sonar-batch/src/test/java/org/sonar/batch/rule/DefaultActiveRulesLoaderTest.java b/sonar-batch/src/test/java/org/sonar/batch/rule/DefaultActiveRulesLoaderTest.java index 9e96042319f..6c63d0545dc 100644 --- a/sonar-batch/src/test/java/org/sonar/batch/rule/DefaultActiveRulesLoaderTest.java +++ b/sonar-batch/src/test/java/org/sonar/batch/rule/DefaultActiveRulesLoaderTest.java @@ -19,7 +19,8 @@ */ package org.sonar.batch.rule; -import org.sonarqube.ws.Rules.Rule; +import org.sonar.api.rule.RuleKey; + import org.sonar.batch.cache.WSLoaderResult; import org.sonar.batch.cache.WSLoader; import com.google.common.io.Resources; @@ -30,8 +31,6 @@ import java.io.InputStream; import java.util.Collection; import static org.mockito.Mockito.verify; - -import static org.mockito.Matchers.anyString; import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.verifyNoMoreInteractions; @@ -50,14 +49,33 @@ public class DefaultActiveRulesLoaderTest { @Test public void feed_real_response() throws IOException { - InputStream response = loadResource("active_rule_search.protobuf"); - when(ws.loadStream(anyString())).thenReturn(new WSLoaderResult<InputStream>(response, false)); - Collection<Rule> activeRules = loader.load("java-sonar-way-26368", null); - assertThat(activeRules).hasSize(100); + InputStream response1 = loadResource("active_rule_search1.protobuf"); + InputStream response2 = loadResource("active_rule_search2.protobuf"); + + String req1 = "/api/rules/search.protobuf?f=repo,name,severity,lang,internalKey,templateKey,params,actives&activation=true&qprofile=java-sonar-way-26368&p=1&ps=500"; + String req2 = "/api/rules/search.protobuf?f=repo,name,severity,lang,internalKey,templateKey,params,actives&activation=true&qprofile=java-sonar-way-26368&p=2&ps=500"; + when(ws.loadStream(req1)).thenReturn(new WSLoaderResult<InputStream>(response1, false)); + when(ws.loadStream(req2)).thenReturn(new WSLoaderResult<InputStream>(response2, false)); - verify(ws).loadStream("/api/rules/search.protobuf?ps=500&f=repo,name,severity,lang,internalKey,templateKey,params&activation=true&qprofile=java-sonar-way-26368"); + Collection<LoadedActiveRule> activeRules = loader.load("java-sonar-way-26368", null); + assertThat(activeRules).hasSize(226); + assertActiveRule(activeRules); + + verify(ws).loadStream(req1); + verify(ws).loadStream(req2); verifyNoMoreInteractions(ws); + } + + private static void assertActiveRule(Collection<LoadedActiveRule> activeRules) { + RuleKey key = RuleKey.of("squid", "S3008"); + for (LoadedActiveRule r : activeRules) { + if (!r.getRuleKey().equals(key)) { + continue; + } + assertThat(r.getParams().get("format")).isEqualTo("^[a-z][a-zA-Z0-9]*$"); + assertThat(r.getSeverity()).isEqualTo("MINOR"); + } } private InputStream loadResource(String name) throws IOException { diff --git a/sonar-batch/src/test/resources/org/sonar/batch/rule/DefaultActiveRulesLoaderTest/active_rule_search.protobuf b/sonar-batch/src/test/resources/org/sonar/batch/rule/DefaultActiveRulesLoaderTest/active_rule_search.protobuf deleted file mode 100644 index 18d0a1284a8..00000000000 --- a/sonar-batch/src/test/resources/org/sonar/batch/rule/DefaultActiveRulesLoaderTest/active_rule_search.protobuf +++ /dev/null @@ -1,105 +0,0 @@ -¾d"Z -squid:S1194squid("java.lang.Error" should not be extendedRMAJORbS1194šjava¢Java"× -4squid:ObjectFinalizeOverridenCallsSuperFinalizeChecksquidQsuper.finalize() should be called at the end of Object.finalize() implementationsRBLOCKERb.ObjectFinalizeOverridenCallsSuperFinalizeCheckšjava¢Java"f -squid:S2078squid1Values passed to LDAP queries should be sanitizedRCRITICALbS2078šjava¢Java"~ -squid:S1195squidLArray designators "[]" should be located after the type in method signaturesRMINORbS1195šjava¢Java"k - -squid:S106squid;Standard ouputs should not be used directly to log anythingRMAJORbS106šjava¢Java"Z -squid:S1192squid(String literals should not be duplicatedRMINORbS1192šjava¢Java"P - -squid:S109squid Magic numbers should not be usedRMINORbS109šjava¢Java"f -squid:S2077squid1Values passed to SQL commands should be sanitizedRCRITICALbS2077šjava¢Java"e -squid:S2076squid0Values passed to OS commands should be sanitizedRCRITICALbS2076šjava¢Java"y -squid:S1193squidGException types should not be tested using "instanceof" in catch blocksRMAJORbS1193šjava¢Java"] -squid:S1190squid+Future keywords should not be used as namesRMAJORbS1190šjava¢Java"b -squid:S1191squid0Classes from "sun.*" packages should not be usedRMAJORbS1191šjava¢Java"6 -squid:S1444squid:RCRITICALbS1444šjava¢Java"x -squid:S2864squidF"entrySet()" should be iterated when both the key and value are neededRMAJORbS2864šjava¢Java"¢ -#squid:RightCurlyBraceStartLineChecksquid@A close curly brace should be located at the beginning of a lineRMINORbRightCurlyBraceStartLineCheckšjava¢Java"p -squid:S2070squid;SHA-1 and Message-Digest hash algorithms should not be usedRCRITICALbS2070šjava¢Java"j -squid:S1849squid6"Iterator.hasNext()" should not call "Iterator.next()"RBLOCKERbS1849šjava¢Java"f -squid:S2301squid4Public methods should not contain selector argumentsRMAJORbS2301šjava¢Java" -squid:S1848squidJObjects should not be created to be dropped immediately without being usedRCRITICALbS1848šjava¢Java"W -squid:S1199squid%Nested code blocks should not be usedRMAJORbS1199šjava¢Java"ž -squid:S1844squidj"Object.wait(...)" should never be called on objects that implement "java.util.concurrent.locks.Condition"RBLOCKERbS1844šjava¢Java"p -squid:S1197squid>Array designators "[]" should be on the type, not the variableRMINORbS1197šjava¢Java"€ -squid:S2066squidK"Serializable" inner classes of non-serializable classes should be "static"RCRITICALbS2066šjava¢Java"n -squid:S2065squid<Fields in non-serializable classes should not be "transient"RMINORbS2065šjava¢Java"R -squid:S2970squidAssertions should be completeRCRITICALbS2970šjava¢Java"Y -squid:S2068squid$Credentials should not be hard-codedRCRITICALbS2068šjava¢Java"i -squid:S2974squid7Classes without "public" constructors should be "final"RMAJORbS2974šjava¢Java"s -squid:S2976squid>"File.createTempFile" should not be used to create a directoryRCRITICALbS2976šjava¢Java"Y -squid:S1068squid'Unused private fields should be removedRMAJORbS1068šjava¢Java"Q -squid:S1065squidUnused labels should be removedRMAJORbS1065šjava¢Java"} - squid:MethodCyclomaticComplexitysquid!Methods should not be too complexRMAJORbMethodCyclomaticComplexityšjava¢Java"z -squid:EmptyStatementUsageChecksquid"Empty statements should be removedRMINORbEmptyStatementUsageCheckšjava¢Java"W -squid:S1067squid%Expressions should not be too complexRMAJORbS1067šjava¢Java"^ -squid:S1066squid,Collapsible "if" statements should be mergedRMAJORbS1066šjava¢Java"t -squid:S2061squid?Custom serialization method signatures should meet requirementsRCRITICALbS2061šjava¢Java"Þ --squid:RightCurlyBraceSameLineAsNextBlockChecksquidhClose curly brace and the next "else", "catch" and "finally" keywords should be located on the same lineRMINORb'RightCurlyBraceSameLineAsNextBlockCheckšjava¢Java"V -squid:S2063squid$Comparators should be "Serializable"RMAJORbS2063šjava¢Java"i -squid:S2701squid7Literal boolean values should not be used in assertionsRMAJORbS2701šjava¢Java"y -squid:S2059squidG"Serializable" inner classes of "Serializable" classes should be staticRMAJORbS2059šjava¢Java"a -squid:S2057squid/"Serializable" classes should have a version idRMAJORbS2057šjava¢Java"® -squid:S1596squid|Collections.emptyList(), emptyMap() and emptySet() should be used instead of Collections.EMPTY_LIST, EMPTY_MAP and EMPTY_SETRMAJORbS1596šjava¢Java"“ -squid:S2055squid^The non-serializable super class of a "Serializable" class must have a no-argument constructorRCRITICALbS2055šjava¢Java"h -squid:S1598squid6Package declaration should match source file directoryRMAJORbS1598šjava¢Java"S -squid:ParsingErrorsquidJava parser failureRMAJORbParsingErroršjava¢Java"• - -squid:S881squideIncrement (++) and decrement (--) operators should not be mixed with other operators in an expressionRMAJORbS881šjava¢Java"v -squid:S1724squidDDeprecated classes and interfaces should not be extended/implementedRMAJORbS1724šjava¢Java"w -squid:S1862squidBRelated "if/else if" statements should not have the same conditionRCRITICALbS1862šjava¢Java"v -squid:S1860squidBSynchronization should not be based on Strings or boxed primitivesRBLOCKERbS1860šjava¢Java"€ -squid:S1317squidN"StringBuilder" and "StringBuffer" should not be instantiated with a characterRMAJORbS1317šjava¢Java"Q -squid:S1314squidOctal values should not be usedRMAJORbS1314šjava¢Java"j -squid:S1315squid8"CHECKSTYLE:OFF" suppression comments should not be usedRMINORbS1315šjava¢Java"} -squid:S2718squidH"DateUtils.truncate" from Apache Commons Lang library should not be usedRCRITICALbS2718šjava¢Java"s -squid:IndentationChecksquid+Source code should be indented consistentlyRMINORbIndentationCheckšjava¢Java"c -squid:S1451squid/Copyright and license headers should be definedRBLOCKERbS1451šjava¢Java"p -squid:S1452squid>Generic wildcard types should not be used in return parametersRMAJORbS1452šjava¢Java"u -squid:S1318squid@"object == null" should be used instead of "object.equals(null)"RCRITICALbS1318šjava¢Java"µ -squid:S1319squid‚Declarations should use Java collection interfaces such as "List" rather than specific implementation classes such as "LinkedList"RMAJORbS1319šjava¢Java" -squid:S1312squidMLoggers should be "private static final" and should share a naming conventionRMINORbS1312šjava¢Java"V -squid:S1313squid$IP addresses should not be hardcodedRMAJORbS1313šjava¢Java" - -squid:S864squidOLimited dependence should be placed on operator precedence rules in expressionsRMAJORbS864šjava¢Java"a -squid:S1310squid/"NOPMD" suppression comments should not be usedRMINORbS1310šjava¢Java"h -squid:S2447squid3Null should not be returned from a "Boolean" methodRCRITICALbS2447šjava¢Java" -squid:S1850squidM"instanceof" operators that always return "true" or "false" should be removedRMAJORbS1850šjava¢Java"z -squid:S2583squidFConditions should not unconditionally evaluate to "TRUE" or to "FALSE"RBLOCKERbS2583šjava¢Java"^ -squid:S1710squid,Annotation repetitions should not be wrappedRMAJORbS1710šjava¢Java"o -squid:S2440squid=Classes with only "static" methods should not be instantiatedRMAJORbS2440šjava¢Java"t -squid:S2441squid?Non-serializable objects should not be stored in "HttpSessions"RCRITICALbS2441šjava¢Java"_ -squid:S2442squid+"Lock" objects should not be "synchronized"RBLOCKERbS2442šjava¢Java"— -"squid:ObjectFinalizeOverridenChecksquid4The Object.finalize() method should not be overridenRCRITICALbObjectFinalizeOverridenCheckšjava¢Java"h -squid:S1858squid6"toString()" should never be called on a String objectRMAJORbS1858šjava¢Java"t -squid:S2444squid?Lazy initialization of "static" fields should be "synchronized"RCRITICALbS2444šjava¢Java" -squid:S2445squid[Blocks synchronized on fields should not contain assignments of new objects to those fieldsRBLOCKERbS2445šjava¢Java"O -squid:S2446squid"notifyAll" should be usedRCRITICALbS2446šjava¢Java"k -squid:S1301squid9"switch" statements should have at least 3 "case" clausesRMINORbS1301šjava¢Java"f -squid:S1607squid4Skipped unit tests should be either removed or fixedRMAJORbS1607šjava¢Java"d -squid:S1309squid3The @SuppressWarnings annotation should not be usedRINFObS1309šjava¢Java"z -squid:S1604squidHAnonymous inner classes containing only one method should become lambdasRMAJORbS1604šjava¢Java" -squid:S1602squidOLamdbas containing only one statement should not nest this statement in a blockRMAJORbS1602šjava¢Java"{ -squid:ClassCyclomaticComplexitysquid!Classes should not be too complexRMAJORbClassCyclomaticComplexityšjava¢Java"‹ -squid:S1200squidYClasses should not be coupled to too many other classes (Single Responsibility Principle)RMAJORbS1200šjava¢Java"q -squid:S1201squid<Methods named "equals" should override Object.equals(Object)RCRITICALbS1201šjava¢Java"f -squid:S1701squid4Fields and methods should not have conflicting namesRMAJORbS1701šjava¢Java"w -squid:S1206squidC"equals(Object obj)" and "hashCode()" should be overridden in pairsRBLOCKERbS1206šjava¢Java"o -squid:S1700squid=A field should not duplicate the name of its containing classRMAJORbS1700šjava¢Java"k -squid:S2178squid6Short-circuit logic should be used in boolean contextsRCRITICALbS2178šjava¢Java"j -squid:S2176squid8Class names should not shadow interfaces or superclassesRMAJORbS2176šjava¢Java"Š - squid:ForLoopCounterChangedChecksquid."for" loop stop conditions should be invariantRMAJORbForLoopCounterChangedCheckšjava¢Java"h -squid:S2175squid3Inappropriate "Collection" calls should not be madeRCRITICALbS2175šjava¢Java"e -squid:S2160squid3Subclasses that add fields should override "equals"RMAJORbS2160šjava¢Java"q -squid:S2162squid<"equals" methods should be symmetric and work for subclassesRCRITICALbS2162šjava¢Java"“ -%squid:RedundantThrowsDeclarationChecksquid-Throws declarations should not be superfluousRMINORbRedundantThrowsDeclarationCheckšjava¢Java"‘ -squid:S1994squid\"for" loop incrementers should modify the variable being tested in the loop's stop conditionRCRITICALbS1994šjava¢Java"\ -squid:S2165squid*"finalize" should not set fields to "null"RMAJORbS2165šjava¢Java"[ -squid:S2164squid&Math should not be performed on floatsRCRITICALbS2164šjava¢Java"f -squid:S2167squid1"compareTo" should not return "Integer.MIN_VALUE"RCRITICALbS2167šjava¢Java"x -squid:S2166squidFClasses named like "Exception" should extend "Exception" or a subclassRMAJORbS2166šjava¢Java"g -squid:S2885squid2"Calendars" and "DateFormats" should not be staticRCRITICALbS2885šjava¢Java"~ -squid:S2694squidLInner classes which do not reference their owning classes should be "static"RMAJORbS2694šjava¢Java"ƒ -squid:S2695squidO"PreparedStatement" and "ResultSet" methods should be called with valid indicesRBLOCKERbS2695šjava¢Java"h -squid:S2692squid3"indexOf" checks should not be for positive numbersRCRITICALbS2692šjava¢Java
\ No newline at end of file diff --git a/sonar-batch/src/test/resources/org/sonar/batch/rule/DefaultActiveRulesLoaderTest/active_rule_search1.protobuf b/sonar-batch/src/test/resources/org/sonar/batch/rule/DefaultActiveRulesLoaderTest/active_rule_search1.protobuf Binary files differnew file mode 100644 index 00000000000..5544968df4b --- /dev/null +++ b/sonar-batch/src/test/resources/org/sonar/batch/rule/DefaultActiveRulesLoaderTest/active_rule_search1.protobuf diff --git a/sonar-batch/src/test/resources/org/sonar/batch/rule/DefaultActiveRulesLoaderTest/active_rule_search2.protobuf b/sonar-batch/src/test/resources/org/sonar/batch/rule/DefaultActiveRulesLoaderTest/active_rule_search2.protobuf Binary files differnew file mode 100644 index 00000000000..a23bd1d5d81 --- /dev/null +++ b/sonar-batch/src/test/resources/org/sonar/batch/rule/DefaultActiveRulesLoaderTest/active_rule_search2.protobuf |