aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-db-dao
diff options
context:
space:
mode:
authorJulien HENRY <julien.henry@sonarsource.com>2017-09-25 16:33:31 +0200
committerJulien HENRY <julien.henry@sonarsource.com>2017-09-27 14:50:52 +0200
commite7868aa03dc555ac4839d0a7c96c7708deb6d6de (patch)
tree392a2b901ebbabbdec5723b9707173d8ae758ccb /server/sonar-db-dao
parent489725dae8e137b669d596a9c9a53e86e6eee2ac (diff)
downloadsonarqube-e7868aa03dc555ac4839d0a7c96c7708deb6d6de.tar.gz
sonarqube-e7868aa03dc555ac4839d0a7c96c7708deb6d6de.zip
SONAR-9575 Revert all changes made to support incremental mode
Diffstat (limited to 'server/sonar-db-dao')
-rw-r--r--server/sonar-db-dao/src/main/java/org/sonar/db/ce/CeTaskCharacteristicDto.java1
-rw-r--r--server/sonar-db-dao/src/main/java/org/sonar/db/component/SnapshotDto.java10
-rw-r--r--server/sonar-db-dao/src/main/resources/org/sonar/db/component/SnapshotMapper.xml9
-rw-r--r--server/sonar-db-dao/src/test/java/org/sonar/db/component/SnapshotDaoTest.java8
-rw-r--r--server/sonar-db-dao/src/test/java/org/sonar/db/component/SnapshotDtoTest.java2
-rw-r--r--server/sonar-db-dao/src/test/resources/org/sonar/db/purge/PurgeCommandsTest/shouldPurgeAnalysis-result.xml2
-rw-r--r--server/sonar-db-dao/src/test/resources/org/sonar/db/purge/PurgeCommandsTest/shouldPurgeAnalysis.xml2
-rw-r--r--server/sonar-db-dao/src/test/resources/org/sonar/db/purge/PurgeDaoTest/close_issues_clean_index_and_files_sources_of_specified_components-result.xml1
-rw-r--r--server/sonar-db-dao/src/test/resources/org/sonar/db/purge/PurgeDaoTest/close_issues_clean_index_and_files_sources_of_specified_components.xml1
-rw-r--r--server/sonar-db-dao/src/test/resources/org/sonar/db/purge/PurgeDaoTest/shouldDeleteAbortedBuilds-result.xml2
-rw-r--r--server/sonar-db-dao/src/test/resources/org/sonar/db/purge/PurgeDaoTest/shouldDeleteAbortedBuilds.xml3
-rw-r--r--server/sonar-db-dao/src/test/resources/org/sonar/db/purge/PurgeDaoTest/shouldDeleteAnalyses-result.xml2
-rw-r--r--server/sonar-db-dao/src/test/resources/org/sonar/db/purge/PurgeDaoTest/shouldDeleteAnalyses.xml3
-rw-r--r--server/sonar-db-dao/src/test/resources/org/sonar/db/purge/PurgeDaoTest/shouldDeleteHistoricalDataOfDirectoriesAndFiles-result.xml2
-rw-r--r--server/sonar-db-dao/src/test/resources/org/sonar/db/purge/PurgeDaoTest/shouldDeleteHistoricalDataOfDirectoriesAndFiles.xml2
-rw-r--r--server/sonar-db-dao/src/test/resources/org/sonar/db/purge/PurgeDaoTest/shouldPurgeProject-result.xml3
-rw-r--r--server/sonar-db-dao/src/test/resources/org/sonar/db/purge/PurgeDaoTest/shouldPurgeProject.xml3
17 files changed, 4 insertions, 52 deletions
diff --git a/server/sonar-db-dao/src/main/java/org/sonar/db/ce/CeTaskCharacteristicDto.java b/server/sonar-db-dao/src/main/java/org/sonar/db/ce/CeTaskCharacteristicDto.java
index 7a60a07f986..9d757ceb077 100644
--- a/server/sonar-db-dao/src/main/java/org/sonar/db/ce/CeTaskCharacteristicDto.java
+++ b/server/sonar-db-dao/src/main/java/org/sonar/db/ce/CeTaskCharacteristicDto.java
@@ -21,7 +21,6 @@ package org.sonar.db.ce;
public class CeTaskCharacteristicDto {
- public static final String INCREMENTAL_KEY = "incremental";
public static final String BRANCH_KEY = "branch";
public static final String BRANCH_TYPE_KEY = "branchType";
diff --git a/server/sonar-db-dao/src/main/java/org/sonar/db/component/SnapshotDto.java b/server/sonar-db-dao/src/main/java/org/sonar/db/component/SnapshotDto.java
index e2bb957ea7f..e326b4da511 100644
--- a/server/sonar-db-dao/src/main/java/org/sonar/db/component/SnapshotDto.java
+++ b/server/sonar-db-dao/src/main/java/org/sonar/db/component/SnapshotDto.java
@@ -42,7 +42,6 @@ public final class SnapshotDto {
private String periodMode;
private String periodParam;
private Long periodDate;
- private boolean incremental = false;
public Long getId() {
return id;
@@ -156,15 +155,6 @@ public final class SnapshotDto {
return this;
}
- public boolean getIncremental() {
- return incremental;
- }
-
- public SnapshotDto setIncremental(boolean incremental) {
- this.incremental = incremental;
- return this;
- }
-
/**
* @return analysis date
*/
diff --git a/server/sonar-db-dao/src/main/resources/org/sonar/db/component/SnapshotMapper.xml b/server/sonar-db-dao/src/main/resources/org/sonar/db/component/SnapshotMapper.xml
index b838cf23afe..8060e105448 100644
--- a/server/sonar-db-dao/src/main/resources/org/sonar/db/component/SnapshotMapper.xml
+++ b/server/sonar-db-dao/src/main/resources/org/sonar/db/component/SnapshotMapper.xml
@@ -14,8 +14,7 @@
s.version as version,
s.period1_mode as periodMode,
s.period1_param as periodParam,
- s.period1_date as periodDate,
- s.incremental as incremental
+ s.period1_date as periodDate
</sql>
<sql id="viewsSnapshotColumns">
@@ -181,8 +180,7 @@
version,
period1_mode,
period1_param,
- period1_date,
- incremental)
+ period1_date)
values (
#{uuid, jdbcType=VARCHAR},
#{componentUuid, jdbcType=VARCHAR},
@@ -194,8 +192,7 @@
#{version, jdbcType=VARCHAR},
#{periodMode, jdbcType=VARCHAR},
#{periodParam, jdbcType=VARCHAR},
- #{periodDate, jdbcType=BIGINT},
- #{incremental, jdbcType=BOOLEAN})
+ #{periodDate, jdbcType=BIGINT})
</insert>
</mapper>
diff --git a/server/sonar-db-dao/src/test/java/org/sonar/db/component/SnapshotDaoTest.java b/server/sonar-db-dao/src/test/java/org/sonar/db/component/SnapshotDaoTest.java
index 291143024b4..46c5bb93ab1 100644
--- a/server/sonar-db-dao/src/test/java/org/sonar/db/component/SnapshotDaoTest.java
+++ b/server/sonar-db-dao/src/test/java/org/sonar/db/component/SnapshotDaoTest.java
@@ -73,7 +73,6 @@ public class SnapshotDaoTest {
.setPeriodParam("30")
.setPeriodDate(1500000000001L)
.setVersion("2.1-SNAPSHOT")
- .setIncremental(false)
.setBuildDate(1500000000006L)
.setCreatedAt(1403042400000L));
@@ -91,8 +90,6 @@ public class SnapshotDaoTest {
assertThat(result.getBuildDate()).isEqualTo(1500000000006L);
assertThat(result.getCreatedAt()).isEqualTo(1403042400000L);
assertThat(result.getVersion()).isEqualTo("2.1-SNAPSHOT");
- assertThat(result.getIncremental()).isFalse();
-
assertThat(underTest.selectByUuid(db.getSession(), "DOES_NOT_EXIST").isPresent()).isFalse();
}
@@ -269,7 +266,6 @@ public class SnapshotDaoTest {
.setPeriodDate(1500000000001L)
.setVersion("2.1-SNAPSHOT")
.setBuildDate(1500000000006L)
- .setIncremental(true)
.setCreatedAt(1403042400000L));
assertThat(dto.getId()).isNotNull();
@@ -284,7 +280,6 @@ public class SnapshotDaoTest {
assertThat(dto.getBuildDate()).isEqualTo(1500000000006L);
assertThat(dto.getCreatedAt()).isEqualTo(1403042400000L);
assertThat(dto.getVersion()).isEqualTo("2.1-SNAPSHOT");
- assertThat(dto.getIncremental()).isTrue();
}
@@ -393,8 +388,7 @@ public class SnapshotDaoTest {
.setPeriodMode("days1")
.setPeriodParam("30")
.setPeriodDate(1_500_000_000_001L)
- .setBuildDate(1_500_000_000_006L)
- .setIncremental(false);
+ .setBuildDate(1_500_000_000_006L);
}
private CeActivityDto insertActivity(SnapshotDto analysis, CeActivityDto.Status status) {
diff --git a/server/sonar-db-dao/src/test/java/org/sonar/db/component/SnapshotDtoTest.java b/server/sonar-db-dao/src/test/java/org/sonar/db/component/SnapshotDtoTest.java
index 04ad4267454..4b8dd3e26af 100644
--- a/server/sonar-db-dao/src/test/java/org/sonar/db/component/SnapshotDtoTest.java
+++ b/server/sonar-db-dao/src/test/java/org/sonar/db/component/SnapshotDtoTest.java
@@ -36,7 +36,6 @@ public class SnapshotDtoTest {
.setVersion("1.0")
.setPeriodMode("mode1")
.setPeriodParam("param1")
- .setIncremental(true)
.setPeriodDate(parseDate("2014-06-01").getTime());
assertThat(snapshotDto.getId()).isEqualTo(10L);
@@ -46,7 +45,6 @@ public class SnapshotDtoTest {
assertThat(snapshotDto.getVersion()).isEqualTo("1.0");
assertThat(snapshotDto.getPeriodMode()).isEqualTo("mode1");
assertThat(snapshotDto.getPeriodModeParameter()).isEqualTo("param1");
- assertThat(snapshotDto.getIncremental()).isTrue();
assertThat(snapshotDto.getPeriodDate()).isEqualTo(parseDate("2014-06-01").getTime());
}
diff --git a/server/sonar-db-dao/src/test/resources/org/sonar/db/purge/PurgeCommandsTest/shouldPurgeAnalysis-result.xml b/server/sonar-db-dao/src/test/resources/org/sonar/db/purge/PurgeCommandsTest/shouldPurgeAnalysis-result.xml
index ef080fd3f64..6cb45a58538 100644
--- a/server/sonar-db-dao/src/test/resources/org/sonar/db/purge/PurgeCommandsTest/shouldPurgeAnalysis-result.xml
+++ b/server/sonar-db-dao/src/test/resources/org/sonar/db/purge/PurgeCommandsTest/shouldPurgeAnalysis-result.xml
@@ -32,7 +32,6 @@ Note that measures, events and reviews are not deleted.
created_at="1228222680000"
build_date="1228222680000"
version="[null]"
- incremental="[false]"
/>
<!--switched_off="[null]" permanent_id="[null]" FAILURE_LEVEL="2"-->
@@ -97,7 +96,6 @@ Note that measures, events and reviews are not deleted.
created_at="1228222680000"
build_date="1228222680000"
version="[null]"
- incremental="[false]"
/>
diff --git a/server/sonar-db-dao/src/test/resources/org/sonar/db/purge/PurgeCommandsTest/shouldPurgeAnalysis.xml b/server/sonar-db-dao/src/test/resources/org/sonar/db/purge/PurgeCommandsTest/shouldPurgeAnalysis.xml
index 15104619310..d086021a151 100644
--- a/server/sonar-db-dao/src/test/resources/org/sonar/db/purge/PurgeCommandsTest/shouldPurgeAnalysis.xml
+++ b/server/sonar-db-dao/src/test/resources/org/sonar/db/purge/PurgeCommandsTest/shouldPurgeAnalysis.xml
@@ -24,7 +24,6 @@
created_at="1228222680000"
build_date="1228222680000"
version="[null]"
- incremental="[false]"
/>
<project_measures ID="1"
@@ -89,7 +88,6 @@
created_at="1228222680000"
build_date="1228222680000"
version="[null]"
- incremental="[false]"
/>
<project_measures ID="2"
diff --git a/server/sonar-db-dao/src/test/resources/org/sonar/db/purge/PurgeDaoTest/close_issues_clean_index_and_files_sources_of_specified_components-result.xml b/server/sonar-db-dao/src/test/resources/org/sonar/db/purge/PurgeDaoTest/close_issues_clean_index_and_files_sources_of_specified_components-result.xml
index 00ee6f678a8..287f41e23de 100644
--- a/server/sonar-db-dao/src/test/resources/org/sonar/db/purge/PurgeDaoTest/close_issues_clean_index_and_files_sources_of_specified_components-result.xml
+++ b/server/sonar-db-dao/src/test/resources/org/sonar/db/purge/PurgeDaoTest/close_issues_clean_index_and_files_sources_of_specified_components-result.xml
@@ -149,7 +149,6 @@ What has been changed :
created_at="1228222680000"
build_date="1228222680000"
version="[null]"
- incremental="[false]"
/>
<!-- Open issue on file -->
diff --git a/server/sonar-db-dao/src/test/resources/org/sonar/db/purge/PurgeDaoTest/close_issues_clean_index_and_files_sources_of_specified_components.xml b/server/sonar-db-dao/src/test/resources/org/sonar/db/purge/PurgeDaoTest/close_issues_clean_index_and_files_sources_of_specified_components.xml
index 4e7905239df..40c2ae8f4f7 100644
--- a/server/sonar-db-dao/src/test/resources/org/sonar/db/purge/PurgeDaoTest/close_issues_clean_index_and_files_sources_of_specified_components.xml
+++ b/server/sonar-db-dao/src/test/resources/org/sonar/db/purge/PurgeDaoTest/close_issues_clean_index_and_files_sources_of_specified_components.xml
@@ -138,7 +138,6 @@
created_at="1228222680000"
build_date="1228222680000"
version="[null]"
- incremental="[false]"
/>
<!-- Open issue on file -->
diff --git a/server/sonar-db-dao/src/test/resources/org/sonar/db/purge/PurgeDaoTest/shouldDeleteAbortedBuilds-result.xml b/server/sonar-db-dao/src/test/resources/org/sonar/db/purge/PurgeDaoTest/shouldDeleteAbortedBuilds-result.xml
index dd294d38bf2..e5c679bf4c5 100644
--- a/server/sonar-db-dao/src/test/resources/org/sonar/db/purge/PurgeDaoTest/shouldDeleteAbortedBuilds-result.xml
+++ b/server/sonar-db-dao/src/test/resources/org/sonar/db/purge/PurgeDaoTest/shouldDeleteAbortedBuilds-result.xml
@@ -50,7 +50,6 @@ Snapshot 2 has been deleted
created_at="1228222680000"
build_date="1228222680000"
version="[null]"
- incremental="[false]"
/>
<!-- snapshot with status "processed" and flagged as "last" -> do not purge and do not delete -->
@@ -78,7 +77,6 @@ Snapshot 2 has been deleted
created_at="1228222680000"
build_date="1228222680000"
version="[null]"
- incremental="[false]"
/>
</dataset>
diff --git a/server/sonar-db-dao/src/test/resources/org/sonar/db/purge/PurgeDaoTest/shouldDeleteAbortedBuilds.xml b/server/sonar-db-dao/src/test/resources/org/sonar/db/purge/PurgeDaoTest/shouldDeleteAbortedBuilds.xml
index 3f493acd7eb..9acb701f9e9 100644
--- a/server/sonar-db-dao/src/test/resources/org/sonar/db/purge/PurgeDaoTest/shouldDeleteAbortedBuilds.xml
+++ b/server/sonar-db-dao/src/test/resources/org/sonar/db/purge/PurgeDaoTest/shouldDeleteAbortedBuilds.xml
@@ -45,7 +45,6 @@
created_at="1228222680000"
build_date="1228222680000"
version="[null]"
- incremental="[false]"
/>
<!-- snapshot with status "unprocessed" -> to be deleted -->
@@ -73,7 +72,6 @@
created_at="1228222680000"
build_date="1228222680000"
version="[null]"
- incremental="[false]"
/>
<!-- snapshot with status "processed" and flagged as "last" -> do not purge and do not delete -->
@@ -101,7 +99,6 @@
created_at="1228222680000"
build_date="1228222680000"
version="[null]"
- incremental="[false]"
/>
</dataset>
diff --git a/server/sonar-db-dao/src/test/resources/org/sonar/db/purge/PurgeDaoTest/shouldDeleteAnalyses-result.xml b/server/sonar-db-dao/src/test/resources/org/sonar/db/purge/PurgeDaoTest/shouldDeleteAnalyses-result.xml
index d5393b6756a..878595a3c80 100644
--- a/server/sonar-db-dao/src/test/resources/org/sonar/db/purge/PurgeDaoTest/shouldDeleteAnalyses-result.xml
+++ b/server/sonar-db-dao/src/test/resources/org/sonar/db/purge/PurgeDaoTest/shouldDeleteAnalyses-result.xml
@@ -25,7 +25,6 @@
created_at="1228222680000"
build_date="1228222680000"
version="[null]"
- incremental="[false]"
/>
<!-- delete only resource 1 -->
@@ -53,7 +52,6 @@
created_at="1228222680000"
build_date="1228222680000"
version="[null]"
- incremental="[false]"
/>
</dataset>
diff --git a/server/sonar-db-dao/src/test/resources/org/sonar/db/purge/PurgeDaoTest/shouldDeleteAnalyses.xml b/server/sonar-db-dao/src/test/resources/org/sonar/db/purge/PurgeDaoTest/shouldDeleteAnalyses.xml
index 9d351499f2a..d4cdd256532 100644
--- a/server/sonar-db-dao/src/test/resources/org/sonar/db/purge/PurgeDaoTest/shouldDeleteAnalyses.xml
+++ b/server/sonar-db-dao/src/test/resources/org/sonar/db/purge/PurgeDaoTest/shouldDeleteAnalyses.xml
@@ -25,7 +25,6 @@
created_at="1228222680000"
build_date="1228222680000"
version="[null]"
- incremental="[false]"
/>
<!-- delete only resource 1 -->
@@ -53,7 +52,6 @@
created_at="1228222680000"
build_date="1228222680000"
version="[null]"
- incremental="[false]"
/>
<!-- to be deleted -->
@@ -81,7 +79,6 @@
created_at="1228222680000"
build_date="1228222680000"
version="[null]"
- incremental="[false]"
/>
</dataset>
diff --git a/server/sonar-db-dao/src/test/resources/org/sonar/db/purge/PurgeDaoTest/shouldDeleteHistoricalDataOfDirectoriesAndFiles-result.xml b/server/sonar-db-dao/src/test/resources/org/sonar/db/purge/PurgeDaoTest/shouldDeleteHistoricalDataOfDirectoriesAndFiles-result.xml
index e32aeb548d0..3e6532b606a 100644
--- a/server/sonar-db-dao/src/test/resources/org/sonar/db/purge/PurgeDaoTest/shouldDeleteHistoricalDataOfDirectoriesAndFiles-result.xml
+++ b/server/sonar-db-dao/src/test/resources/org/sonar/db/purge/PurgeDaoTest/shouldDeleteHistoricalDataOfDirectoriesAndFiles-result.xml
@@ -151,7 +151,6 @@ What has been changed : purge_status=1 on snapshot 4 (PRJ) and snapshots 5 and 6
created_at="1228222680000"
build_date="1228222680000"
version="[null]"
- incremental="[false]"
/>
<!-- snapshots to be purged -->
@@ -179,7 +178,6 @@ What has been changed : purge_status=1 on snapshot 4 (PRJ) and snapshots 5 and 6
created_at="1228222680000"
build_date="1228222680000"
version="[null]"
- incremental="[false]"
/>
</dataset>
diff --git a/server/sonar-db-dao/src/test/resources/org/sonar/db/purge/PurgeDaoTest/shouldDeleteHistoricalDataOfDirectoriesAndFiles.xml b/server/sonar-db-dao/src/test/resources/org/sonar/db/purge/PurgeDaoTest/shouldDeleteHistoricalDataOfDirectoriesAndFiles.xml
index eef613afa84..c6f8da44917 100644
--- a/server/sonar-db-dao/src/test/resources/org/sonar/db/purge/PurgeDaoTest/shouldDeleteHistoricalDataOfDirectoriesAndFiles.xml
+++ b/server/sonar-db-dao/src/test/resources/org/sonar/db/purge/PurgeDaoTest/shouldDeleteHistoricalDataOfDirectoriesAndFiles.xml
@@ -139,7 +139,6 @@
created_at="1228222680000"
build_date="1228222680000"
version="[null]"
- incremental="[false]"
/>
<!-- snapshots to be purged -->
@@ -167,7 +166,6 @@
created_at="1228222680000"
build_date="1228222680000"
version="[null]"
- incremental="[false]"
/>
</dataset>
diff --git a/server/sonar-db-dao/src/test/resources/org/sonar/db/purge/PurgeDaoTest/shouldPurgeProject-result.xml b/server/sonar-db-dao/src/test/resources/org/sonar/db/purge/PurgeDaoTest/shouldPurgeProject-result.xml
index 0ce2b40b57e..5de7ce994c7 100644
--- a/server/sonar-db-dao/src/test/resources/org/sonar/db/purge/PurgeDaoTest/shouldPurgeProject-result.xml
+++ b/server/sonar-db-dao/src/test/resources/org/sonar/db/purge/PurgeDaoTest/shouldPurgeProject-result.xml
@@ -66,7 +66,6 @@
created_at="1228222680000"
build_date="1228222680000"
version="[null]"
- incremental="[false]"
/>
@@ -95,7 +94,6 @@
created_at="1228222680000"
build_date="1228222680000"
version="[null]"
- incremental="[false]"
/>
<!-- snapshot to be purged -->
@@ -123,7 +121,6 @@
created_at="1228222680000"
build_date="1228222680000"
version="[null]"
- incremental="[false]"
/>
</dataset>
diff --git a/server/sonar-db-dao/src/test/resources/org/sonar/db/purge/PurgeDaoTest/shouldPurgeProject.xml b/server/sonar-db-dao/src/test/resources/org/sonar/db/purge/PurgeDaoTest/shouldPurgeProject.xml
index 69fb0fd3418..4590dc6260b 100644
--- a/server/sonar-db-dao/src/test/resources/org/sonar/db/purge/PurgeDaoTest/shouldPurgeProject.xml
+++ b/server/sonar-db-dao/src/test/resources/org/sonar/db/purge/PurgeDaoTest/shouldPurgeProject.xml
@@ -65,7 +65,6 @@
created_at="1228222680000"
build_date="1228222680000"
version="[null]"
- incremental="[false]"
/>
@@ -94,7 +93,6 @@
created_at="1228222680000"
build_date="1228222680000"
version="[null]"
- incremental="[false]"
/>
<!-- snapshot to be purged -->
@@ -122,7 +120,6 @@
created_at="1228222680000"
build_date="1228222680000"
version="[null]"
- incremental="[false]"
/>
</dataset>