aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/timemachine/ReferenceAnalysis.java3
-rw-r--r--plugins/sonar-core-plugin/src/test/resources/org/sonar/plugins/core/timemachine/ViolationPersisterDecoratorTest/shared.xml4
-rw-r--r--plugins/sonar-core-plugin/src/test/resources/org/sonar/plugins/core/timemachine/ViolationPersisterDecoratorTest/shouldCopyPermanentIdFromReferenceViolation-result.xml4
-rw-r--r--plugins/sonar-core-plugin/src/test/resources/org/sonar/plugins/core/timemachine/ViolationPersisterDecoratorTest/shouldSaveViolations-result.xml4
-rw-r--r--plugins/sonar-dbcleaner-plugin/src/main/java/org/sonar/plugins/dbcleaner/purges/PurgeDependencies.java2
-rw-r--r--plugins/sonar-dbcleaner-plugin/src/main/java/org/sonar/plugins/dbcleaner/purges/PurgeDeprecatedLast.java3
-rw-r--r--plugins/sonar-dbcleaner-plugin/src/main/java/org/sonar/plugins/dbcleaner/purges/PurgeDisabledResources.java6
-rw-r--r--plugins/sonar-dbcleaner-plugin/src/main/java/org/sonar/plugins/dbcleaner/purges/PurgeEntities.java7
-rw-r--r--plugins/sonar-dbcleaner-plugin/src/main/java/org/sonar/plugins/dbcleaner/purges/PurgeEventOrphans.java5
-rw-r--r--plugins/sonar-dbcleaner-plugin/src/main/java/org/sonar/plugins/dbcleaner/purges/PurgeUnprocessed.java3
-rw-r--r--plugins/sonar-dbcleaner-plugin/src/test/resources/org/sonar/plugins/dbcleaner/api/PurgeUtilsTest/purgeSnapshots-result.xml2
-rw-r--r--plugins/sonar-dbcleaner-plugin/src/test/resources/org/sonar/plugins/dbcleaner/api/PurgeUtilsTest/purgeSnapshots.xml2
-rw-r--r--plugins/sonar-dbcleaner-plugin/src/test/resources/org/sonar/plugins/dbcleaner/purges/PurgeDeletedResourcesTest/sharedFixture.xml2
-rw-r--r--plugins/sonar-dbcleaner-plugin/src/test/resources/org/sonar/plugins/dbcleaner/purges/PurgeDeprecatedLastTest/sharedFixture.xml2
-rw-r--r--plugins/sonar-dbcleaner-plugin/src/test/resources/org/sonar/plugins/dbcleaner/purges/PurgeDisabledResourcesTest/sharedFixture.xml2
-rw-r--r--plugins/sonar-dbcleaner-plugin/src/test/resources/org/sonar/plugins/dbcleaner/purges/PurgeEntitiesTest/sharedFixture.xml2
-rw-r--r--plugins/sonar-dbcleaner-plugin/src/test/resources/org/sonar/plugins/dbcleaner/purges/PurgeRuleMeasuresTest/sharedFixture.xml2
-rw-r--r--plugins/sonar-dbcleaner-plugin/src/test/resources/org/sonar/plugins/dbcleaner/purges/PurgeUnprocessedTest/sharedFixture.xml2
-rw-r--r--sonar-batch/src/main/java/org/sonar/batch/index/DefaultResourcePersister.java3
-rw-r--r--sonar-batch/src/test/resources/org/sonar/batch/components/PastMeasuresLoaderTest/shared.xml4
-rw-r--r--sonar-batch/src/test/resources/org/sonar/batch/phases/UpdateStatusJobTest/sharedFixture.xml2
-rw-r--r--sonar-core/src/test/java/org/sonar/jpa/dao/ProfilesDaoTest.java4
-rw-r--r--sonar-core/src/test/java/org/sonar/jpa/session/DatabaseSessionTest.java6
-rw-r--r--sonar-core/src/test/resources/org/sonar/core/components/CacheRuleFinderTest/shared.xml2
-rw-r--r--sonar-core/src/test/resources/org/sonar/core/components/DefaultRuleFinderTest/shared.xml2
-rw-r--r--sonar-core/src/test/resources/org/sonar/core/components/ModelTest/saveModelAndCharacteristics.xml4
-rw-r--r--sonar-core/src/test/resources/org/sonar/core/components/ModelTest/testGraphOfCharacteristics.xml8
-rw-r--r--sonar-core/src/test/resources/org/sonar/core/components/ModelTest/testTreeOfCharacteristics.xml5
-rw-r--r--sonar-core/src/test/resources/org/sonar/core/notifications/DefaultNotificationManagerTest/fixture.xml2
-rw-r--r--sonar-core/src/test/resources/org/sonar/jpa/dao/RulesDaoTest/shouldCountNumberOfRulesOfACategoryForGivenPlugins.xml4
-rw-r--r--sonar-core/src/test/resources/org/sonar/jpa/dao/RulesDaoTest/shouldDeleteActiveRuleParametersFromARuleParameter-result.xml2
-rw-r--r--sonar-core/src/test/resources/org/sonar/jpa/dao/RulesDaoTest/shouldDeleteActiveRuleParametersFromARuleParameter.xml2
-rw-r--r--sonar-core/src/test/resources/org/sonar/jpa/dao/RulesDaoTest/shouldDeleteActiveRules-result.xml2
-rw-r--r--sonar-core/src/test/resources/org/sonar/jpa/dao/RulesDaoTest/shouldDeleteActiveRules.xml2
-rw-r--r--sonar-core/src/test/resources/org/sonar/jpa/dao/RulesDaoTest/shouldGetActiveRules.xml2
-rw-r--r--sonar-core/src/test/resources/org/sonar/jpa/dao/RulesDaoTest/shouldGetRuleParams.xml2
-rw-r--r--sonar-core/src/test/resources/org/sonar/jpa/dao/RulesDaoTest/shouldGetRuleWithRuleKeyAndPluginKey.xml2
-rw-r--r--sonar-core/src/test/resources/org/sonar/jpa/dao/RulesDaoTest/shouldGetRules.xml2
-rw-r--r--sonar-core/src/test/resources/org/sonar/persistence/dao/RuleDaoTest/selectAll.xml2
-rw-r--r--sonar-core/src/test/resources/org/sonar/persistence/dao/RuleDaoTest/selectById.xml4
-rw-r--r--sonar-server/src/main/java/org/sonar/server/startup/EnableProfiles.java4
-rw-r--r--sonar-server/src/main/java/org/sonar/server/startup/RegisterMetrics.java4
-rw-r--r--sonar-server/src/test/resources/org/sonar/server/startup/RegisterRulesTest/disableDeprecatedActiveRuleParameters.xml2
-rw-r--r--sonar-server/src/test/resources/org/sonar/server/startup/RegisterRulesTest/updadeRuleFields.xml2
-rw-r--r--sonar-server/src/test/resources/org/sonar/server/startup/RegisterRulesTest/updateRuleParameters.xml2
45 files changed, 63 insertions, 76 deletions
diff --git a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/timemachine/ReferenceAnalysis.java b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/timemachine/ReferenceAnalysis.java
index 4a04c1ec810..2f8b31baae5 100644
--- a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/timemachine/ReferenceAnalysis.java
+++ b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/timemachine/ReferenceAnalysis.java
@@ -47,9 +47,10 @@ public class ReferenceAnalysis implements BatchExtension {
}
Snapshot getSnapshot(Resource resource) {
- Query query = session.createQuery("from " + Snapshot.class.getSimpleName() + " s where s.last=true and s.resourceId=(select r.id from "
+ Query query = session.createQuery("from " + Snapshot.class.getSimpleName() + " s where s.last=:last and s.resourceId=(select r.id from "
+ ResourceModel.class.getSimpleName() + " r where r.key=:key)");
query.setParameter("key", resource.getEffectiveKey());
+ query.setParameter("last", Boolean.TRUE);
return session.getSingleResult(query, null);
}
}
diff --git a/plugins/sonar-core-plugin/src/test/resources/org/sonar/plugins/core/timemachine/ViolationPersisterDecoratorTest/shared.xml b/plugins/sonar-core-plugin/src/test/resources/org/sonar/plugins/core/timemachine/ViolationPersisterDecoratorTest/shared.xml
index 90a3f202297..db1849bc7a7 100644
--- a/plugins/sonar-core-plugin/src/test/resources/org/sonar/plugins/core/timemachine/ViolationPersisterDecoratorTest/shared.xml
+++ b/plugins/sonar-core-plugin/src/test/resources/org/sonar/plugins/core/timemachine/ViolationPersisterDecoratorTest/shared.xml
@@ -1,7 +1,7 @@
<dataset>
- <rules_categories id="1" name="Efficiency" description="[null]"/>
- <rules_categories id="6" name="Usability" description="[null]"/>
+ <rules_categories id="1" name="Efficiency" description="Efficiency"/>
+ <rules_categories id="6" name="Usability" description="Usability"/>
<rules id="30" name="Check Header" plugin_rule_key="com.puppycrawl.tools.checkstyle.checks.header.HeaderCheck"
plugin_config_key="Checker/Treewalker/HeaderCheck" plugin_name="checkstyle" description="[null]" priority="4" enabled="true"
diff --git a/plugins/sonar-core-plugin/src/test/resources/org/sonar/plugins/core/timemachine/ViolationPersisterDecoratorTest/shouldCopyPermanentIdFromReferenceViolation-result.xml b/plugins/sonar-core-plugin/src/test/resources/org/sonar/plugins/core/timemachine/ViolationPersisterDecoratorTest/shouldCopyPermanentIdFromReferenceViolation-result.xml
index fc52aa2bd62..1366055ebce 100644
--- a/plugins/sonar-core-plugin/src/test/resources/org/sonar/plugins/core/timemachine/ViolationPersisterDecoratorTest/shouldCopyPermanentIdFromReferenceViolation-result.xml
+++ b/plugins/sonar-core-plugin/src/test/resources/org/sonar/plugins/core/timemachine/ViolationPersisterDecoratorTest/shouldCopyPermanentIdFromReferenceViolation-result.xml
@@ -1,7 +1,7 @@
<dataset>
- <rules_categories id="1" name="Efficiency" description="[null]"/>
- <rules_categories id="6" name="Usability" description="[null]"/>
+ <rules_categories id="1" name="Efficiency" description="Efficiency"/>
+ <rules_categories id="6" name="Usability" description="Usability"/>
<rules id="30" name="Check Header" plugin_rule_key="com.puppycrawl.tools.checkstyle.checks.header.HeaderCheck"
plugin_config_key="Checker/Treewalker/HeaderCheck" plugin_name="checkstyle" description="[null]" priority="4" enabled="true"
diff --git a/plugins/sonar-core-plugin/src/test/resources/org/sonar/plugins/core/timemachine/ViolationPersisterDecoratorTest/shouldSaveViolations-result.xml b/plugins/sonar-core-plugin/src/test/resources/org/sonar/plugins/core/timemachine/ViolationPersisterDecoratorTest/shouldSaveViolations-result.xml
index 726b925bf12..cdb569bd223 100644
--- a/plugins/sonar-core-plugin/src/test/resources/org/sonar/plugins/core/timemachine/ViolationPersisterDecoratorTest/shouldSaveViolations-result.xml
+++ b/plugins/sonar-core-plugin/src/test/resources/org/sonar/plugins/core/timemachine/ViolationPersisterDecoratorTest/shouldSaveViolations-result.xml
@@ -1,6 +1,6 @@
<dataset>
- <rules_categories id="1" name="Efficiency" description="[null]"/>
- <rules_categories id="6" name="Usability" description="[null]"/>
+ <rules_categories id="1" name="Efficiency" description="Efficiency"/>
+ <rules_categories id="6" name="Usability" description="Usability"/>
<rules id="30" name="Check Header" plugin_rule_key="com.puppycrawl.tools.checkstyle.checks.header.HeaderCheck"
plugin_config_key="Checker/Treewalker/HeaderCheck" plugin_name="checkstyle" description="[null]" priority="4" enabled="true"
diff --git a/plugins/sonar-dbcleaner-plugin/src/main/java/org/sonar/plugins/dbcleaner/purges/PurgeDependencies.java b/plugins/sonar-dbcleaner-plugin/src/main/java/org/sonar/plugins/dbcleaner/purges/PurgeDependencies.java
index 65792f152aa..430e4c6ffd2 100644
--- a/plugins/sonar-dbcleaner-plugin/src/main/java/org/sonar/plugins/dbcleaner/purges/PurgeDependencies.java
+++ b/plugins/sonar-dbcleaner-plugin/src/main/java/org/sonar/plugins/dbcleaner/purges/PurgeDependencies.java
@@ -38,7 +38,7 @@ public final class PurgeDependencies extends Purge {
public void purge(PurgeContext context) {
Query query = getSession().createQuery("SELECT d.projectSnapshotId FROM " + DependencyDto.class.getSimpleName() +
" d WHERE EXISTS(FROM " + Snapshot.class.getSimpleName() + " s WHERE s.id=d.projectSnapshotId AND s.last=:last and s.status=:status)");
- query.setParameter("last", false);
+ query.setParameter("last", Boolean.FALSE);
query.setParameter("status", Snapshot.STATUS_PROCESSED);
final List<Integer> projectSnapshotIds = query.getResultList();
diff --git a/plugins/sonar-dbcleaner-plugin/src/main/java/org/sonar/plugins/dbcleaner/purges/PurgeDeprecatedLast.java b/plugins/sonar-dbcleaner-plugin/src/main/java/org/sonar/plugins/dbcleaner/purges/PurgeDeprecatedLast.java
index fc84d52a2de..6246551cca4 100644
--- a/plugins/sonar-dbcleaner-plugin/src/main/java/org/sonar/plugins/dbcleaner/purges/PurgeDeprecatedLast.java
+++ b/plugins/sonar-dbcleaner-plugin/src/main/java/org/sonar/plugins/dbcleaner/purges/PurgeDeprecatedLast.java
@@ -40,7 +40,8 @@ public final class PurgeDeprecatedLast extends Purge {
public void purge(PurgeContext context) {
Query query = getSession().createQuery("SELECT s.id FROM " + Snapshot.class.getSimpleName() +
- " s WHERE s.last=true AND s.rootId IS NOT NULL AND NOT EXISTS(FROM " + Snapshot.class.getSimpleName() + " s2 WHERE s2.id=s.rootId AND s2.last=true)");
+ " s WHERE s.last=last AND s.rootId IS NOT NULL AND NOT EXISTS(FROM " + Snapshot.class.getSimpleName() + " s2 WHERE s2.id=s.rootId AND s2.last=true)");
+ query.setParameter("last", Boolean.TRUE);
List<Integer> snapshotIds = query.getResultList();
PurgeUtils.deleteSnapshotsData(getSession(), snapshotIds);
diff --git a/plugins/sonar-dbcleaner-plugin/src/main/java/org/sonar/plugins/dbcleaner/purges/PurgeDisabledResources.java b/plugins/sonar-dbcleaner-plugin/src/main/java/org/sonar/plugins/dbcleaner/purges/PurgeDisabledResources.java
index 4a0895fea0c..267876d0928 100644
--- a/plugins/sonar-dbcleaner-plugin/src/main/java/org/sonar/plugins/dbcleaner/purges/PurgeDisabledResources.java
+++ b/plugins/sonar-dbcleaner-plugin/src/main/java/org/sonar/plugins/dbcleaner/purges/PurgeDisabledResources.java
@@ -53,13 +53,15 @@ public final class PurgeDisabledResources extends Purge {
}
private List<Integer> getResourceIds() {
- Query query = getSession().createQuery("SELECT r.id FROM " + ResourceModel.class.getSimpleName() + " r WHERE r.enabled=false");
+ Query query = getSession().createQuery("SELECT r.id FROM " + ResourceModel.class.getSimpleName() + " r WHERE r.enabled=:enabled");
+ query.setParameter("enabled", Boolean.FALSE);
return query.getResultList();
}
private List<Integer> getSnapshotIds() {
Query query = getSession().createQuery("SELECT s.id FROM " + Snapshot.class.getSimpleName() + " s WHERE " +
- " EXISTS (FROM " + ResourceModel.class.getSimpleName() + " r WHERE r.id=s.resourceId AND r.enabled=false)");
+ " EXISTS (FROM " + ResourceModel.class.getSimpleName() + " r WHERE r.id=s.resourceId AND r.enabled=:enabled)");
+ query.setParameter("enabled", Boolean.FALSE);
return query.getResultList();
}
}
diff --git a/plugins/sonar-dbcleaner-plugin/src/main/java/org/sonar/plugins/dbcleaner/purges/PurgeEntities.java b/plugins/sonar-dbcleaner-plugin/src/main/java/org/sonar/plugins/dbcleaner/purges/PurgeEntities.java
index a074cb9a6bb..ac33e6f6e0f 100644
--- a/plugins/sonar-dbcleaner-plugin/src/main/java/org/sonar/plugins/dbcleaner/purges/PurgeEntities.java
+++ b/plugins/sonar-dbcleaner-plugin/src/main/java/org/sonar/plugins/dbcleaner/purges/PurgeEntities.java
@@ -23,7 +23,7 @@ import org.apache.commons.configuration.Configuration;
import org.apache.commons.lang.time.DateUtils;
import org.sonar.api.database.DatabaseSession;
import org.sonar.api.database.model.Snapshot;
-import org.sonar.api.resources.Resource;
+import org.sonar.api.resources.Scopes;
import org.sonar.api.utils.Logs;
import org.sonar.plugins.dbcleaner.api.Purge;
import org.sonar.plugins.dbcleaner.api.PurgeContext;
@@ -50,9 +50,10 @@ public final class PurgeEntities extends Purge {
final Date beforeDate = DateUtils.addHours(new Date(), -minimumPeriodInHours);
Logs.INFO.info("Deleting files data before " + beforeDate);
- Query query = getSession().createQuery("SELECT s.id FROM " + Snapshot.class.getSimpleName() + " s WHERE s.last=false AND scope=:scope AND s.createdAt<:date");
- query.setParameter("scope", Resource.SCOPE_ENTITY);
+ Query query = getSession().createQuery("SELECT s.id FROM " + Snapshot.class.getSimpleName() + " s WHERE s.last=:last AND scope=:scope AND s.createdAt<:date");
+ query.setParameter("scope", Scopes.FILE);
query.setParameter("date", beforeDate);
+ query.setParameter("last", Boolean.FALSE);
List<Integer> snapshotIds = query.getResultList();
PurgeUtils.deleteSnapshotsData(getSession(), snapshotIds);
diff --git a/plugins/sonar-dbcleaner-plugin/src/main/java/org/sonar/plugins/dbcleaner/purges/PurgeEventOrphans.java b/plugins/sonar-dbcleaner-plugin/src/main/java/org/sonar/plugins/dbcleaner/purges/PurgeEventOrphans.java
index 1b55504f1c6..5a5ebf4c259 100644
--- a/plugins/sonar-dbcleaner-plugin/src/main/java/org/sonar/plugins/dbcleaner/purges/PurgeEventOrphans.java
+++ b/plugins/sonar-dbcleaner-plugin/src/main/java/org/sonar/plugins/dbcleaner/purges/PurgeEventOrphans.java
@@ -22,15 +22,12 @@ package org.sonar.plugins.dbcleaner.purges;
import org.sonar.api.batch.Event;
import org.sonar.api.database.DatabaseSession;
import org.sonar.api.database.model.ResourceModel;
-import org.sonar.api.database.model.Snapshot;
-import org.sonar.api.database.model.SnapshotSource;
import org.sonar.plugins.dbcleaner.api.Purge;
import org.sonar.plugins.dbcleaner.api.PurgeContext;
import org.sonar.plugins.dbcleaner.api.PurgeUtils;
-import java.util.List;
-
import javax.persistence.Query;
+import java.util.List;
public final class PurgeEventOrphans extends Purge {
diff --git a/plugins/sonar-dbcleaner-plugin/src/main/java/org/sonar/plugins/dbcleaner/purges/PurgeUnprocessed.java b/plugins/sonar-dbcleaner-plugin/src/main/java/org/sonar/plugins/dbcleaner/purges/PurgeUnprocessed.java
index 21b7b67bb26..9e7ffe2aa3a 100644
--- a/plugins/sonar-dbcleaner-plugin/src/main/java/org/sonar/plugins/dbcleaner/purges/PurgeUnprocessed.java
+++ b/plugins/sonar-dbcleaner-plugin/src/main/java/org/sonar/plugins/dbcleaner/purges/PurgeUnprocessed.java
@@ -49,9 +49,10 @@ public final class PurgeUnprocessed extends Purge {
final Date beforeDate = DateUtils.addHours(new Date(), -minimumPeriodInHours);
Logs.INFO.info("Deleting unprocessed data before " + beforeDate);
- Query query = getSession().createQuery("SELECT s.id FROM " + Snapshot.class.getSimpleName() + " s WHERE s.last=false AND status=:status AND s.createdAt<:date");
+ Query query = getSession().createQuery("SELECT s.id FROM " + Snapshot.class.getSimpleName() + " s WHERE s.last=:last AND status=:status AND s.createdAt<:date");
query.setParameter("status", Snapshot.STATUS_UNPROCESSED);
query.setParameter("date", beforeDate);
+ query.setParameter("last", Boolean.FALSE);
List<Integer> snapshotIds = query.getResultList();
PurgeUtils.deleteSnapshotsData(getSession(), snapshotIds);
diff --git a/plugins/sonar-dbcleaner-plugin/src/test/resources/org/sonar/plugins/dbcleaner/api/PurgeUtilsTest/purgeSnapshots-result.xml b/plugins/sonar-dbcleaner-plugin/src/test/resources/org/sonar/plugins/dbcleaner/api/PurgeUtilsTest/purgeSnapshots-result.xml
index 942c65bc81e..f3237cc3c84 100644
--- a/plugins/sonar-dbcleaner-plugin/src/test/resources/org/sonar/plugins/dbcleaner/api/PurgeUtilsTest/purgeSnapshots-result.xml
+++ b/plugins/sonar-dbcleaner-plugin/src/test/resources/org/sonar/plugins/dbcleaner/api/PurgeUtilsTest/purgeSnapshots-result.xml
@@ -1,5 +1,5 @@
<dataset>
- <rules_categories id="1" name="category one" description="[null]"/>
+ <rules_categories id="1" name="category one" description="one"/>
<rules id="1" name="foo" plugin_config_key="checker/foo" plugin_rule_key="checkstyle.rule1"
plugin_name="maven-checkstyle-plugin" description="description" cardinality="SINGLE" parent_id="[null]" />
diff --git a/plugins/sonar-dbcleaner-plugin/src/test/resources/org/sonar/plugins/dbcleaner/api/PurgeUtilsTest/purgeSnapshots.xml b/plugins/sonar-dbcleaner-plugin/src/test/resources/org/sonar/plugins/dbcleaner/api/PurgeUtilsTest/purgeSnapshots.xml
index 4f75f336d60..f8b8bdee5e2 100644
--- a/plugins/sonar-dbcleaner-plugin/src/test/resources/org/sonar/plugins/dbcleaner/api/PurgeUtilsTest/purgeSnapshots.xml
+++ b/plugins/sonar-dbcleaner-plugin/src/test/resources/org/sonar/plugins/dbcleaner/api/PurgeUtilsTest/purgeSnapshots.xml
@@ -1,5 +1,5 @@
<dataset>
- <rules_categories id="1" name="category one" description="[null]"/>
+ <rules_categories id="1" name="category one" description="one"/>
<rules id="1" name="foo" plugin_config_key="checker/foo" plugin_rule_key="checkstyle.rule1"
plugin_name="maven-checkstyle-plugin" description="description" cardinality="SINGLE" parent_id="[null]"/>
diff --git a/plugins/sonar-dbcleaner-plugin/src/test/resources/org/sonar/plugins/dbcleaner/purges/PurgeDeletedResourcesTest/sharedFixture.xml b/plugins/sonar-dbcleaner-plugin/src/test/resources/org/sonar/plugins/dbcleaner/purges/PurgeDeletedResourcesTest/sharedFixture.xml
index d11bd33fdd1..d2031ec398f 100644
--- a/plugins/sonar-dbcleaner-plugin/src/test/resources/org/sonar/plugins/dbcleaner/purges/PurgeDeletedResourcesTest/sharedFixture.xml
+++ b/plugins/sonar-dbcleaner-plugin/src/test/resources/org/sonar/plugins/dbcleaner/purges/PurgeDeletedResourcesTest/sharedFixture.xml
@@ -1,5 +1,5 @@
<dataset>
- <rules_categories id="1" name="category one" description="[null]"/>
+ <rules_categories id="1" name="category one" description="one"/>
<rules id="1" name="foo" plugin_config_key="checker/foo" plugin_rule_key="checkstyle.rule1"
plugin_name="maven-checkstyle-plugin" description="description" cardinality="SINGLE" parent_id="[null]"/>
diff --git a/plugins/sonar-dbcleaner-plugin/src/test/resources/org/sonar/plugins/dbcleaner/purges/PurgeDeprecatedLastTest/sharedFixture.xml b/plugins/sonar-dbcleaner-plugin/src/test/resources/org/sonar/plugins/dbcleaner/purges/PurgeDeprecatedLastTest/sharedFixture.xml
index d11bd33fdd1..d2031ec398f 100644
--- a/plugins/sonar-dbcleaner-plugin/src/test/resources/org/sonar/plugins/dbcleaner/purges/PurgeDeprecatedLastTest/sharedFixture.xml
+++ b/plugins/sonar-dbcleaner-plugin/src/test/resources/org/sonar/plugins/dbcleaner/purges/PurgeDeprecatedLastTest/sharedFixture.xml
@@ -1,5 +1,5 @@
<dataset>
- <rules_categories id="1" name="category one" description="[null]"/>
+ <rules_categories id="1" name="category one" description="one"/>
<rules id="1" name="foo" plugin_config_key="checker/foo" plugin_rule_key="checkstyle.rule1"
plugin_name="maven-checkstyle-plugin" description="description" cardinality="SINGLE" parent_id="[null]"/>
diff --git a/plugins/sonar-dbcleaner-plugin/src/test/resources/org/sonar/plugins/dbcleaner/purges/PurgeDisabledResourcesTest/sharedFixture.xml b/plugins/sonar-dbcleaner-plugin/src/test/resources/org/sonar/plugins/dbcleaner/purges/PurgeDisabledResourcesTest/sharedFixture.xml
index d79d906a17d..6ee23b42083 100644
--- a/plugins/sonar-dbcleaner-plugin/src/test/resources/org/sonar/plugins/dbcleaner/purges/PurgeDisabledResourcesTest/sharedFixture.xml
+++ b/plugins/sonar-dbcleaner-plugin/src/test/resources/org/sonar/plugins/dbcleaner/purges/PurgeDisabledResourcesTest/sharedFixture.xml
@@ -1,5 +1,5 @@
<dataset>
- <rules_categories id="1" name="category one" description="[null]"/>
+ <rules_categories id="1" name="category one" description="one"/>
<rules id="1" name="foo" plugin_config_key="checker/foo" plugin_rule_key="checkstyle.rule1"
plugin_name="maven-checkstyle-plugin" description="description" cardinality="SINGLE" parent_id="[null]"/>
diff --git a/plugins/sonar-dbcleaner-plugin/src/test/resources/org/sonar/plugins/dbcleaner/purges/PurgeEntitiesTest/sharedFixture.xml b/plugins/sonar-dbcleaner-plugin/src/test/resources/org/sonar/plugins/dbcleaner/purges/PurgeEntitiesTest/sharedFixture.xml
index d11bd33fdd1..d2031ec398f 100644
--- a/plugins/sonar-dbcleaner-plugin/src/test/resources/org/sonar/plugins/dbcleaner/purges/PurgeEntitiesTest/sharedFixture.xml
+++ b/plugins/sonar-dbcleaner-plugin/src/test/resources/org/sonar/plugins/dbcleaner/purges/PurgeEntitiesTest/sharedFixture.xml
@@ -1,5 +1,5 @@
<dataset>
- <rules_categories id="1" name="category one" description="[null]"/>
+ <rules_categories id="1" name="category one" description="one"/>
<rules id="1" name="foo" plugin_config_key="checker/foo" plugin_rule_key="checkstyle.rule1"
plugin_name="maven-checkstyle-plugin" description="description" cardinality="SINGLE" parent_id="[null]"/>
diff --git a/plugins/sonar-dbcleaner-plugin/src/test/resources/org/sonar/plugins/dbcleaner/purges/PurgeRuleMeasuresTest/sharedFixture.xml b/plugins/sonar-dbcleaner-plugin/src/test/resources/org/sonar/plugins/dbcleaner/purges/PurgeRuleMeasuresTest/sharedFixture.xml
index d65258e2be5..46b5a77133b 100644
--- a/plugins/sonar-dbcleaner-plugin/src/test/resources/org/sonar/plugins/dbcleaner/purges/PurgeRuleMeasuresTest/sharedFixture.xml
+++ b/plugins/sonar-dbcleaner-plugin/src/test/resources/org/sonar/plugins/dbcleaner/purges/PurgeRuleMeasuresTest/sharedFixture.xml
@@ -1,5 +1,5 @@
<dataset>
- <rules_categories id="1" name="category one" description="[null]"/>
+ <rules_categories id="1" name="category one" description="one"/>
<rules id="1" name="foo" plugin_config_key="checker/foo" plugin_rule_key="checkstyle.rule1"
plugin_name="maven-checkstyle-plugin" description="description" cardinality="SINGLE" parent_id="[null]"/>
diff --git a/plugins/sonar-dbcleaner-plugin/src/test/resources/org/sonar/plugins/dbcleaner/purges/PurgeUnprocessedTest/sharedFixture.xml b/plugins/sonar-dbcleaner-plugin/src/test/resources/org/sonar/plugins/dbcleaner/purges/PurgeUnprocessedTest/sharedFixture.xml
index d11bd33fdd1..d2031ec398f 100644
--- a/plugins/sonar-dbcleaner-plugin/src/test/resources/org/sonar/plugins/dbcleaner/purges/PurgeUnprocessedTest/sharedFixture.xml
+++ b/plugins/sonar-dbcleaner-plugin/src/test/resources/org/sonar/plugins/dbcleaner/purges/PurgeUnprocessedTest/sharedFixture.xml
@@ -1,5 +1,5 @@
<dataset>
- <rules_categories id="1" name="category one" description="[null]"/>
+ <rules_categories id="1" name="category one" description="one"/>
<rules id="1" name="foo" plugin_config_key="checker/foo" plugin_rule_key="checkstyle.rule1"
plugin_name="maven-checkstyle-plugin" description="description" cardinality="SINGLE" parent_id="[null]"/>
diff --git a/sonar-batch/src/main/java/org/sonar/batch/index/DefaultResourcePersister.java b/sonar-batch/src/main/java/org/sonar/batch/index/DefaultResourcePersister.java
index 157867cbe2a..dd8bf85d196 100644
--- a/sonar-batch/src/main/java/org/sonar/batch/index/DefaultResourcePersister.java
+++ b/sonar-batch/src/main/java/org/sonar/batch/index/DefaultResourcePersister.java
@@ -193,11 +193,12 @@ public final class DefaultResourcePersister implements ResourcePersister {
}
public Snapshot getLastSnapshot(Snapshot snapshot, boolean onlyOlder) {
- String hql = "SELECT s FROM " + Snapshot.class.getSimpleName() + " s WHERE s.last=true AND s.resourceId=:resourceId";
+ String hql = "SELECT s FROM " + Snapshot.class.getSimpleName() + " s WHERE s.last=:last AND s.resourceId=:resourceId";
if (onlyOlder) {
hql += " AND s.createdAt<:date";
}
Query query = session.createQuery(hql);
+ query.setParameter("last", true);
query.setParameter("resourceId", snapshot.getResourceId());
if (onlyOlder) {
query.setParameter("date", snapshot.getCreatedAt());
diff --git a/sonar-batch/src/test/resources/org/sonar/batch/components/PastMeasuresLoaderTest/shared.xml b/sonar-batch/src/test/resources/org/sonar/batch/components/PastMeasuresLoaderTest/shared.xml
index bcde5f6100f..79218a9e46d 100644
--- a/sonar-batch/src/test/resources/org/sonar/batch/components/PastMeasuresLoaderTest/shared.xml
+++ b/sonar-batch/src/test/resources/org/sonar/batch/components/PastMeasuresLoaderTest/shared.xml
@@ -6,8 +6,8 @@
enabled="true" worst_value="0" optimized_best_value="true" best_value="100" direction="1" hidden="false"/>
- <rules_categories id="1" name="Efficiency" description="[null]"/>
- <rules_categories id="6" name="Usability" description="[null]"/>
+ <rules_categories id="1" name="Efficiency" description="Efficiency"/>
+ <rules_categories id="6" name="Usability" description="Usability"/>
<rules id="30" name="Check Header" plugin_rule_key="com.puppycrawl.tools.checkstyle.checks.header.HeaderCheck"
plugin_config_key="Checker/Treewalker/HeaderCheck" plugin_name="checkstyle" description="[null]" priority="4" enabled="true"
diff --git a/sonar-batch/src/test/resources/org/sonar/batch/phases/UpdateStatusJobTest/sharedFixture.xml b/sonar-batch/src/test/resources/org/sonar/batch/phases/UpdateStatusJobTest/sharedFixture.xml
index 48565e5fbdf..262433c5fc5 100644
--- a/sonar-batch/src/test/resources/org/sonar/batch/phases/UpdateStatusJobTest/sharedFixture.xml
+++ b/sonar-batch/src/test/resources/org/sonar/batch/phases/UpdateStatusJobTest/sharedFixture.xml
@@ -1,5 +1,5 @@
<dataset>
- <rules_categories id="1" name="category one" description="[null]"/>
+ <rules_categories id="1" name="category one" description="One"/>
<rules id="1" name="foo" plugin_config_key="checker/foo" plugin_rule_key="checkstyle.rule1"
plugin_name="maven-checkstyle-plugin" description="description" cardinality="SINGLE" parent_id="[null]"/>
diff --git a/sonar-core/src/test/java/org/sonar/jpa/dao/ProfilesDaoTest.java b/sonar-core/src/test/java/org/sonar/jpa/dao/ProfilesDaoTest.java
index 38049f3416c..e9841cf5535 100644
--- a/sonar-core/src/test/java/org/sonar/jpa/dao/ProfilesDaoTest.java
+++ b/sonar-core/src/test/java/org/sonar/jpa/dao/ProfilesDaoTest.java
@@ -44,9 +44,9 @@ public class ProfilesDaoTest extends AbstractDbUnitTestCase {
RulesProfile testProfile = new RulesProfile("not default", "java", false, false);
getSession().save(testDefaultProfile, testProfile);
- ResourceModel testResourceWithProfile = new ResourceModel(ResourceModel.SCOPE_PROJECT, "withProfile", "qual", null, "test");
+ ResourceModel testResourceWithProfile = new ResourceModel(ResourceModel.SCOPE_PROJECT, "withProfile", "TRK", null, "test");
testResourceWithProfile.setRulesProfile(testProfile);
- ResourceModel testResourceWithNoProfile = new ResourceModel(ResourceModel.SCOPE_PROJECT, "withoutProfile", "qual", null, "test");
+ ResourceModel testResourceWithNoProfile = new ResourceModel(ResourceModel.SCOPE_PROJECT, "withoutProfile", "TRK", null, "test");
getSession().save(testResourceWithProfile, testResourceWithNoProfile);
assertNull(profilesDao.getActiveProfile("wrongLanguage", "withoutProfile"));
diff --git a/sonar-core/src/test/java/org/sonar/jpa/session/DatabaseSessionTest.java b/sonar-core/src/test/java/org/sonar/jpa/session/DatabaseSessionTest.java
index 014a7054f6b..34f2853b122 100644
--- a/sonar-core/src/test/java/org/sonar/jpa/session/DatabaseSessionTest.java
+++ b/sonar-core/src/test/java/org/sonar/jpa/session/DatabaseSessionTest.java
@@ -51,9 +51,9 @@ public class DatabaseSessionTest extends AbstractDbUnitTestCase {
@Test
public void performaceTestOnBatchInserts() throws Exception {
-
+ getSession().save(project1);
Snapshot snapshot = new Snapshot(project1, true, "", new Date(1));
- getSession().save(project1, snapshot);
+ getSession().save(snapshot);
getSession().save(CoreMetrics.CLASSES);
getSession().commit();
@@ -110,7 +110,7 @@ public class DatabaseSessionTest extends AbstractDbUnitTestCase {
@Test
public void testGetResultsWithMultipleResults() {
- ResourceModel project3 = new ResourceModel(ResourceModel.SCOPE_PROJECT, "mygroup:myartifact3", "TEST", null, "my name 3");
+ ResourceModel project3 = new ResourceModel(ResourceModel.SCOPE_PROJECT, "mygroup:myartifact3", "BRC", null, "my name 3");
getSession().save(project1, project2, project3);
List<ResourceModel> hits = getSession().getResults(ResourceModel.class, "qualifier", "JAV");
diff --git a/sonar-core/src/test/resources/org/sonar/core/components/CacheRuleFinderTest/shared.xml b/sonar-core/src/test/resources/org/sonar/core/components/CacheRuleFinderTest/shared.xml
index de08ce13d22..fc4fcd733aa 100644
--- a/sonar-core/src/test/resources/org/sonar/core/components/CacheRuleFinderTest/shared.xml
+++ b/sonar-core/src/test/resources/org/sonar/core/components/CacheRuleFinderTest/shared.xml
@@ -1,5 +1,5 @@
<dataset>
- <rules_categories id="6" name="Efficiency" description="[null]" />
+ <rules_categories id="6" name="Efficiency" description="Efficiency" />
<!-- CHECKSTYLE -->
diff --git a/sonar-core/src/test/resources/org/sonar/core/components/DefaultRuleFinderTest/shared.xml b/sonar-core/src/test/resources/org/sonar/core/components/DefaultRuleFinderTest/shared.xml
index de08ce13d22..fc4fcd733aa 100644
--- a/sonar-core/src/test/resources/org/sonar/core/components/DefaultRuleFinderTest/shared.xml
+++ b/sonar-core/src/test/resources/org/sonar/core/components/DefaultRuleFinderTest/shared.xml
@@ -1,5 +1,5 @@
<dataset>
- <rules_categories id="6" name="Efficiency" description="[null]" />
+ <rules_categories id="6" name="Efficiency" description="Efficiency" />
<!-- CHECKSTYLE -->
diff --git a/sonar-core/src/test/resources/org/sonar/core/components/ModelTest/saveModelAndCharacteristics.xml b/sonar-core/src/test/resources/org/sonar/core/components/ModelTest/saveModelAndCharacteristics.xml
deleted file mode 100644
index cd0705734b2..00000000000
--- a/sonar-core/src/test/resources/org/sonar/core/components/ModelTest/saveModelAndCharacteristics.xml
+++ /dev/null
@@ -1,4 +0,0 @@
-<dataset>
- <quality_models id="1" name="initial" />
- <characteristics id="1" kee="FAKE" name="fake" quality_model_id="1" rule_id="[null]" characteristic_order="1" depth="1" description="[null]" enabled="true" />
-</dataset> \ No newline at end of file
diff --git a/sonar-core/src/test/resources/org/sonar/core/components/ModelTest/testGraphOfCharacteristics.xml b/sonar-core/src/test/resources/org/sonar/core/components/ModelTest/testGraphOfCharacteristics.xml
deleted file mode 100644
index ee6e959b85b..00000000000
--- a/sonar-core/src/test/resources/org/sonar/core/components/ModelTest/testGraphOfCharacteristics.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<dataset>
- <quality_models id="1" name="initial" />
-
- <characteristics id="1" kee="FAKE1" name="fake1" quality_model_id="1" rule_id="[null]" characteristic_order="1" depth="1" description="[null]" enabled="true"/>
- <characteristics id="2" kee="FAKE2" name="fake2" quality_model_id="1" rule_id="[null]" characteristic_order="2" depth="1" description="[null]" enabled="true" />
-
- <characteristic_edges child_id="2" parent_id="1"/>
-</dataset> \ No newline at end of file
diff --git a/sonar-core/src/test/resources/org/sonar/core/components/ModelTest/testTreeOfCharacteristics.xml b/sonar-core/src/test/resources/org/sonar/core/components/ModelTest/testTreeOfCharacteristics.xml
deleted file mode 100644
index ef3d9a58680..00000000000
--- a/sonar-core/src/test/resources/org/sonar/core/components/ModelTest/testTreeOfCharacteristics.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-<dataset>
- <quality_models id="1" name="initial" />
- <characteristics id="1" kee="FAKE" name="fake" quality_model_id="1" rule_id="[null]" characteristic_order="1" depth="1" description="[null]" enabled="true" />
- <characteristic_edges child_id="1" parent_id="1"/>
-</dataset> \ No newline at end of file
diff --git a/sonar-core/src/test/resources/org/sonar/core/notifications/DefaultNotificationManagerTest/fixture.xml b/sonar-core/src/test/resources/org/sonar/core/notifications/DefaultNotificationManagerTest/fixture.xml
index 7933d24446d..acae954e294 100644
--- a/sonar-core/src/test/resources/org/sonar/core/notifications/DefaultNotificationManagerTest/fixture.xml
+++ b/sonar-core/src/test/resources/org/sonar/core/notifications/DefaultNotificationManagerTest/fixture.xml
@@ -3,6 +3,6 @@
<users id="1" login="simon" />
<users id="2" login="godin" />
- <properties user_id="1" prop_key="notification.CommentOnReviewAssignedToMe.email" text_value="true"/>
+ <properties id="1" user_id="1" prop_key="notification.CommentOnReviewAssignedToMe.email" text_value="true" resource_id="[null]"/>
</dataset> \ No newline at end of file
diff --git a/sonar-core/src/test/resources/org/sonar/jpa/dao/RulesDaoTest/shouldCountNumberOfRulesOfACategoryForGivenPlugins.xml b/sonar-core/src/test/resources/org/sonar/jpa/dao/RulesDaoTest/shouldCountNumberOfRulesOfACategoryForGivenPlugins.xml
index 86c8d928eee..beb32a48647 100644
--- a/sonar-core/src/test/resources/org/sonar/jpa/dao/RulesDaoTest/shouldCountNumberOfRulesOfACategoryForGivenPlugins.xml
+++ b/sonar-core/src/test/resources/org/sonar/jpa/dao/RulesDaoTest/shouldCountNumberOfRulesOfACategoryForGivenPlugins.xml
@@ -1,7 +1,7 @@
<dataset>
- <rules_categories id="1" name="category one" description="[null]"/>
- <rules_categories id="2" name="category two" description="[null]"/>
+ <rules_categories id="1" name="category one" description="one"/>
+ <rules_categories id="2" name="category two" description="two"/>
<rules id="1" name="rule one" description="desc" plugin_config_key="config"
plugin_rule_key="rule_one" plugin_name="plugin1" enabled="true" cardinality="SINGLE" parent_id="[null]"/>
diff --git a/sonar-core/src/test/resources/org/sonar/jpa/dao/RulesDaoTest/shouldDeleteActiveRuleParametersFromARuleParameter-result.xml b/sonar-core/src/test/resources/org/sonar/jpa/dao/RulesDaoTest/shouldDeleteActiveRuleParametersFromARuleParameter-result.xml
index be6be226a56..c7505dab4df 100644
--- a/sonar-core/src/test/resources/org/sonar/jpa/dao/RulesDaoTest/shouldDeleteActiveRuleParametersFromARuleParameter-result.xml
+++ b/sonar-core/src/test/resources/org/sonar/jpa/dao/RulesDaoTest/shouldDeleteActiveRuleParametersFromARuleParameter-result.xml
@@ -1,6 +1,6 @@
<dataset>
- <rules_categories id="1" name="category one" description="[null]"/>
+ <rules_categories id="1" name="category one" description="one"/>
<rules id="1" name="rule1" description="desc" plugin_config_key="config"
plugin_rule_key="key1" plugin_name="plugin" enabled="true" cardinality="SINGLE" parent_id="[null]"/>
diff --git a/sonar-core/src/test/resources/org/sonar/jpa/dao/RulesDaoTest/shouldDeleteActiveRuleParametersFromARuleParameter.xml b/sonar-core/src/test/resources/org/sonar/jpa/dao/RulesDaoTest/shouldDeleteActiveRuleParametersFromARuleParameter.xml
index f19937676d1..c8822914314 100644
--- a/sonar-core/src/test/resources/org/sonar/jpa/dao/RulesDaoTest/shouldDeleteActiveRuleParametersFromARuleParameter.xml
+++ b/sonar-core/src/test/resources/org/sonar/jpa/dao/RulesDaoTest/shouldDeleteActiveRuleParametersFromARuleParameter.xml
@@ -1,6 +1,6 @@
<dataset>
- <rules_categories id="1" name="category one" description="[null]"/>
+ <rules_categories id="1" name="category one" description="one"/>
<rules id="1" name="rule1" description="desc" plugin_config_key="config"
plugin_rule_key="key1" plugin_name="plugin" enabled="true" cardinality="SINGLE" parent_id="[null]"/>
diff --git a/sonar-core/src/test/resources/org/sonar/jpa/dao/RulesDaoTest/shouldDeleteActiveRules-result.xml b/sonar-core/src/test/resources/org/sonar/jpa/dao/RulesDaoTest/shouldDeleteActiveRules-result.xml
index c749a99827e..b8eeab6cd24 100644
--- a/sonar-core/src/test/resources/org/sonar/jpa/dao/RulesDaoTest/shouldDeleteActiveRules-result.xml
+++ b/sonar-core/src/test/resources/org/sonar/jpa/dao/RulesDaoTest/shouldDeleteActiveRules-result.xml
@@ -1,6 +1,6 @@
<dataset>
- <rules_categories id="1" name="category one" description="[null]"/>
+ <rules_categories id="1" name="category one" description="one"/>
<rules_profiles id="1" provided="true" name="profile one" default_profile="1" language="java" enabled="true"/>
<rules_profiles id="2" provided="true" name="profile two" default_profile="0" language="java" enabled="true"/>
diff --git a/sonar-core/src/test/resources/org/sonar/jpa/dao/RulesDaoTest/shouldDeleteActiveRules.xml b/sonar-core/src/test/resources/org/sonar/jpa/dao/RulesDaoTest/shouldDeleteActiveRules.xml
index 428fe6d8b44..21ba79e615a 100644
--- a/sonar-core/src/test/resources/org/sonar/jpa/dao/RulesDaoTest/shouldDeleteActiveRules.xml
+++ b/sonar-core/src/test/resources/org/sonar/jpa/dao/RulesDaoTest/shouldDeleteActiveRules.xml
@@ -1,6 +1,6 @@
<dataset>
- <rules_categories id="1" name="category one" description="[null]"/>
+ <rules_categories id="1" name="category one" description="one"/>
<rules_profiles id="1" provided="true" name="profile one" default_profile="1" language="java" enabled="true"/>
<rules_profiles id="2" provided="true" name="profile two" default_profile="0" language="java" enabled="true"/>
diff --git a/sonar-core/src/test/resources/org/sonar/jpa/dao/RulesDaoTest/shouldGetActiveRules.xml b/sonar-core/src/test/resources/org/sonar/jpa/dao/RulesDaoTest/shouldGetActiveRules.xml
index c749a99827e..b8eeab6cd24 100644
--- a/sonar-core/src/test/resources/org/sonar/jpa/dao/RulesDaoTest/shouldGetActiveRules.xml
+++ b/sonar-core/src/test/resources/org/sonar/jpa/dao/RulesDaoTest/shouldGetActiveRules.xml
@@ -1,6 +1,6 @@
<dataset>
- <rules_categories id="1" name="category one" description="[null]"/>
+ <rules_categories id="1" name="category one" description="one"/>
<rules_profiles id="1" provided="true" name="profile one" default_profile="1" language="java" enabled="true"/>
<rules_profiles id="2" provided="true" name="profile two" default_profile="0" language="java" enabled="true"/>
diff --git a/sonar-core/src/test/resources/org/sonar/jpa/dao/RulesDaoTest/shouldGetRuleParams.xml b/sonar-core/src/test/resources/org/sonar/jpa/dao/RulesDaoTest/shouldGetRuleParams.xml
index 97861d8b3f5..c398ce6e150 100644
--- a/sonar-core/src/test/resources/org/sonar/jpa/dao/RulesDaoTest/shouldGetRuleParams.xml
+++ b/sonar-core/src/test/resources/org/sonar/jpa/dao/RulesDaoTest/shouldGetRuleParams.xml
@@ -1,6 +1,6 @@
<dataset>
- <rules_categories id="1" name="category one" description="[null]"/>
+ <rules_categories id="1" name="category one" description="one"/>
<!-- Rules -->
<rules id="1" name="new1" description="test1" plugin_config_key="checker/new1"
diff --git a/sonar-core/src/test/resources/org/sonar/jpa/dao/RulesDaoTest/shouldGetRuleWithRuleKeyAndPluginKey.xml b/sonar-core/src/test/resources/org/sonar/jpa/dao/RulesDaoTest/shouldGetRuleWithRuleKeyAndPluginKey.xml
index 3ecb39c8d8d..d993d31f910 100644
--- a/sonar-core/src/test/resources/org/sonar/jpa/dao/RulesDaoTest/shouldGetRuleWithRuleKeyAndPluginKey.xml
+++ b/sonar-core/src/test/resources/org/sonar/jpa/dao/RulesDaoTest/shouldGetRuleWithRuleKeyAndPluginKey.xml
@@ -1,6 +1,6 @@
<dataset>
- <rules_categories id="1" name="category one" description="[null]"/>
+ <rules_categories id="1" name="category one" description="one"/>
<rules id="1" name="foo" description="test" plugin_config_key="checker/foo"
plugin_rule_key="checkstyle.rule1" plugin_name="plugin" enabled="true" cardinality="SINGLE" parent_id="[null]"/>
diff --git a/sonar-core/src/test/resources/org/sonar/jpa/dao/RulesDaoTest/shouldGetRules.xml b/sonar-core/src/test/resources/org/sonar/jpa/dao/RulesDaoTest/shouldGetRules.xml
index 303865ba8fb..9c435f0ff62 100644
--- a/sonar-core/src/test/resources/org/sonar/jpa/dao/RulesDaoTest/shouldGetRules.xml
+++ b/sonar-core/src/test/resources/org/sonar/jpa/dao/RulesDaoTest/shouldGetRules.xml
@@ -1,6 +1,6 @@
<dataset>
- <rules_categories id="1" name="category one" description="[null]"/>
+ <rules_categories id="1" name="category one" description="one"/>
<rules id="1" name="rule one" description="desc" plugin_config_key="other config"
plugin_rule_key="rule_one" plugin_name="plugin" enabled="true" cardinality="SINGLE" parent_id="[null]"/>
diff --git a/sonar-core/src/test/resources/org/sonar/persistence/dao/RuleDaoTest/selectAll.xml b/sonar-core/src/test/resources/org/sonar/persistence/dao/RuleDaoTest/selectAll.xml
index cb8db141d81..0852b9432ad 100644
--- a/sonar-core/src/test/resources/org/sonar/persistence/dao/RuleDaoTest/selectAll.xml
+++ b/sonar-core/src/test/resources/org/sonar/persistence/dao/RuleDaoTest/selectAll.xml
@@ -1,5 +1,5 @@
<dataset>
- <RULES id="1" plugin_rule_key="AvoidNull" plugin_name="checkstyle" name="Avoid Null" description="Should avoid NULL" enabled="1" />
+ <RULES id="1" plugin_rule_key="AvoidNull" plugin_name="checkstyle" name="Avoid Null" description="Should avoid NULL" enabled="true" />
</dataset> \ No newline at end of file
diff --git a/sonar-core/src/test/resources/org/sonar/persistence/dao/RuleDaoTest/selectById.xml b/sonar-core/src/test/resources/org/sonar/persistence/dao/RuleDaoTest/selectById.xml
index 217d08e8c80..3e52055289b 100644
--- a/sonar-core/src/test/resources/org/sonar/persistence/dao/RuleDaoTest/selectById.xml
+++ b/sonar-core/src/test/resources/org/sonar/persistence/dao/RuleDaoTest/selectById.xml
@@ -1,6 +1,6 @@
<dataset>
- <RULES id="1" plugin_rule_key="AvoidComparison" plugin_name="checkstyle" name="Avoid Comparison" description="Should avoid ==" enabled="1" />
- <RULES id="2" plugin_rule_key="AvoidNull" plugin_name="checkstyle" name="Avoid Null" description="Should avoid NULL" enabled="1" />
+ <RULES id="1" plugin_rule_key="AvoidComparison" plugin_name="checkstyle" name="Avoid Comparison" description="Should avoid ==" enabled="true" />
+ <RULES id="2" plugin_rule_key="AvoidNull" plugin_name="checkstyle" name="Avoid Null" description="Should avoid NULL" enabled="true" />
</dataset> \ No newline at end of file
diff --git a/sonar-server/src/main/java/org/sonar/server/startup/EnableProfiles.java b/sonar-server/src/main/java/org/sonar/server/startup/EnableProfiles.java
index 64bdab89615..75184134fb0 100644
--- a/sonar-server/src/main/java/org/sonar/server/startup/EnableProfiles.java
+++ b/sonar-server/src/main/java/org/sonar/server/startup/EnableProfiles.java
@@ -57,14 +57,14 @@ public final class EnableProfiles {
private void enableProfilesOnKnownLanguages(Set<String> languages, DatabaseSession session) {
Query query = session.createQuery("update " + RulesProfile.class.getSimpleName() + " set enabled=:enabled where language in (:languages)");
- query.setParameter("enabled", true);
+ query.setParameter("enabled", Boolean.TRUE);
query.setParameter("languages", languages);
query.executeUpdate();
}
private void disableProfilesOnMissingLanguages(Set<String> languages, DatabaseSession session) {
Query query = session.createQuery("update " + RulesProfile.class.getSimpleName() + " set enabled=:enabled where language not in (:languages)");
- query.setParameter("enabled", false);
+ query.setParameter("enabled", Boolean.FALSE);
query.setParameter("languages", languages);
query.executeUpdate();
}
diff --git a/sonar-server/src/main/java/org/sonar/server/startup/RegisterMetrics.java b/sonar-server/src/main/java/org/sonar/server/startup/RegisterMetrics.java
index 7d25cc57208..43cc7ccc162 100644
--- a/sonar-server/src/main/java/org/sonar/server/startup/RegisterMetrics.java
+++ b/sonar-server/src/main/java/org/sonar/server/startup/RegisterMetrics.java
@@ -32,7 +32,6 @@ import org.sonar.jpa.dao.MeasuresDao;
import org.sonar.server.platform.ServerStartException;
import javax.persistence.Query;
-
import java.util.List;
import java.util.Map;
@@ -86,7 +85,8 @@ public class RegisterMetrics {
Query query = session.createQuery("delete from " + Alert.class.getSimpleName() + " a where NOT EXISTS(FROM Metric m WHERE m=a.metric))");
query.executeUpdate();
- query = session.createQuery("delete from " + Alert.class.getSimpleName() + " a where NOT EXISTS(FROM Metric m WHERE m=a.metric and m.enabled=true))");
+ query = session.createQuery("delete from " + Alert.class.getSimpleName() + " a where NOT EXISTS(FROM Metric m WHERE m=a.metric and m.enabled=:enabled))");
+ query.setParameter("enabled", Boolean.TRUE);
query.executeUpdate();
session.commit();
}
diff --git a/sonar-server/src/test/resources/org/sonar/server/startup/RegisterRulesTest/disableDeprecatedActiveRuleParameters.xml b/sonar-server/src/test/resources/org/sonar/server/startup/RegisterRulesTest/disableDeprecatedActiveRuleParameters.xml
index e85839686b3..3194d9dd51b 100644
--- a/sonar-server/src/test/resources/org/sonar/server/startup/RegisterRulesTest/disableDeprecatedActiveRuleParameters.xml
+++ b/sonar-server/src/test/resources/org/sonar/server/startup/RegisterRulesTest/disableDeprecatedActiveRuleParameters.xml
@@ -1,6 +1,6 @@
<dataset>
- <rules_categories id="1" name="Efficiency" description="[null]"/>
+ <rules_categories id="1" name="Efficiency" description="Efficiency"/>
<rules id="1" plugin_rule_key="rule1" plugin_name="fake" plugin_config_key="old_config_key" name="old name" description="old description"
enabled="true" priority="2" cardinality="SINGLE" parent_id="[null]" />
diff --git a/sonar-server/src/test/resources/org/sonar/server/startup/RegisterRulesTest/updadeRuleFields.xml b/sonar-server/src/test/resources/org/sonar/server/startup/RegisterRulesTest/updadeRuleFields.xml
index cd931c60c73..476d3ca0262 100644
--- a/sonar-server/src/test/resources/org/sonar/server/startup/RegisterRulesTest/updadeRuleFields.xml
+++ b/sonar-server/src/test/resources/org/sonar/server/startup/RegisterRulesTest/updadeRuleFields.xml
@@ -1,6 +1,6 @@
<dataset>
- <rules_categories id="1" name="Efficiency" description="[null]"/>
+ <rules_categories id="1" name="Efficiency" description="Efficiency"/>
<rules id="1" plugin_rule_key="rule1" plugin_name="fake" plugin_config_key="old_config_key" name="old name" description="old description"
enabled="true" priority="2" cardinality="SINGLE" parent_id="[null]"/>
diff --git a/sonar-server/src/test/resources/org/sonar/server/startup/RegisterRulesTest/updateRuleParameters.xml b/sonar-server/src/test/resources/org/sonar/server/startup/RegisterRulesTest/updateRuleParameters.xml
index fca8cf64b12..448089b94bf 100644
--- a/sonar-server/src/test/resources/org/sonar/server/startup/RegisterRulesTest/updateRuleParameters.xml
+++ b/sonar-server/src/test/resources/org/sonar/server/startup/RegisterRulesTest/updateRuleParameters.xml
@@ -1,6 +1,6 @@
<dataset>
- <rules_categories id="1" name="Efficiency" description="[null]"/>
+ <rules_categories id="1" name="Efficiency" description="Efficiency"/>
<rules id="1" plugin_rule_key="rule1" plugin_name="fake" plugin_config_key="old_config_key" name="old name" description="old description"
enabled="true" priority="2" cardinality="SINGLE" parent_id="[null]"/>