aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sonar-core/src/main/java/org/sonar/core/persistence/DryRunDatabaseFactory.java3
-rw-r--r--sonar-core/src/test/java/org/sonar/core/persistence/DryRunDatabaseFactoryTest.java1
-rw-r--r--sonar-core/src/test/resources/org/sonar/core/persistence/DryRunDatabaseFactoryTest/should_create_database.xml4
3 files changed, 6 insertions, 2 deletions
diff --git a/sonar-core/src/main/java/org/sonar/core/persistence/DryRunDatabaseFactory.java b/sonar-core/src/main/java/org/sonar/core/persistence/DryRunDatabaseFactory.java
index dcf0231c742..b6cd161d28f 100644
--- a/sonar-core/src/main/java/org/sonar/core/persistence/DryRunDatabaseFactory.java
+++ b/sonar-core/src/main/java/org/sonar/core/persistence/DryRunDatabaseFactory.java
@@ -74,7 +74,8 @@ public class DryRunDatabaseFactory implements ServerComponent {
.copyTable(source, dest, "quality_models")
.copyTable(source, dest, "rules")
.copyTable(source, dest, "rules_parameters")
- .copyTable(source, dest, "rules_profiles");
+ .copyTable(source, dest, "rules_profiles")
+ .copyTable(source, dest, "alerts");
if (projectId != null) {
String snapshotCondition = "islast=" + database.getDialect().getTrueSqlValue() + " and (project_id=" + projectId + " or root_project_id=" + projectId + ")";
template.copyTable(source, dest, "projects", "id in (select project_id from snapshots where " + snapshotCondition + ") or (id=" + projectId + " or root_id=" + projectId + ")");
diff --git a/sonar-core/src/test/java/org/sonar/core/persistence/DryRunDatabaseFactoryTest.java b/sonar-core/src/test/java/org/sonar/core/persistence/DryRunDatabaseFactoryTest.java
index fda04beb553..11b35e77c97 100644
--- a/sonar-core/src/test/java/org/sonar/core/persistence/DryRunDatabaseFactoryTest.java
+++ b/sonar-core/src/test/java/org/sonar/core/persistence/DryRunDatabaseFactoryTest.java
@@ -69,6 +69,7 @@ public class DryRunDatabaseFactoryTest extends AbstractDaoTestCase {
assertThat(rowCount("metrics")).isEqualTo(2);
assertThat(rowCount("projects")).isZero();
+ assertThat(rowCount("alerts")).isEqualTo(1);
}
@Test
diff --git a/sonar-core/src/test/resources/org/sonar/core/persistence/DryRunDatabaseFactoryTest/should_create_database.xml b/sonar-core/src/test/resources/org/sonar/core/persistence/DryRunDatabaseFactoryTest/should_create_database.xml
index 5dc8035b8e0..1958f492aaa 100644
--- a/sonar-core/src/test/resources/org/sonar/core/persistence/DryRunDatabaseFactoryTest/should_create_database.xml
+++ b/sonar-core/src/test/resources/org/sonar/core/persistence/DryRunDatabaseFactoryTest/should_create_database.xml
@@ -21,4 +21,6 @@
created_at="2013-01-25 02:04:06.00" build_date="2013-01-25 02:04:06.00"
version="1.0" status="P" islast="[true]"/>
-</dataset> \ No newline at end of file
+ <alerts id="1" profile_id="1" metric_id="1" operator="lt" value_error="5" value_warning="" period="[null]"/>
+
+</dataset>