aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-core
diff options
context:
space:
mode:
authorTeryk Bellahsene <teryk.bellahsene@sonarsource.com>2015-04-09 11:55:55 +0200
committerTeryk Bellahsene <teryk.bellahsene@sonarsource.com>2015-04-16 11:47:58 +0200
commit598bce548a3420f88ab89e1dc6bc4b2ca24a808c (patch)
treed5520f1b8773d60fb9cc34519d6fdfc15607ef88 /sonar-core
parent8ad882a51708f79204b89cf8fb8b6406a49f04df (diff)
downloadsonarqube-598bce548a3420f88ab89e1dc6bc4b2ca24a808c.tar.gz
sonarqube-598bce548a3420f88ab89e1dc6bc4b2ca24a808c.zip
Move tests persistence from batch to compute - SONAR-6255
- define index and check the 3 use cases - define batch report format - create file_sources.test_data
Diffstat (limited to 'sonar-core')
-rw-r--r--sonar-core/src/main/resources/org/sonar/core/persistence/schema-h2.ddl1
-rw-r--r--sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/delete_file_sources_of_disabled_resources-result.xml2
-rw-r--r--sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/delete_file_sources_of_disabled_resources.xml4
-rw-r--r--sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/select_purgeable_file_uuids.xml4
-rw-r--r--sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/shouldDeleteProject.xml2
-rw-r--r--sonar-core/src/test/resources/org/sonar/core/source/db/FileSourceDaoTest/insert-result.xml2
-rw-r--r--sonar-core/src/test/resources/org/sonar/core/source/db/FileSourceDaoTest/shared.xml1
-rw-r--r--sonar-core/src/test/resources/org/sonar/core/source/db/FileSourceDaoTest/update-result.xml1
-rw-r--r--sonar-core/src/test/resources/org/sonar/core/source/db/FileSourceDaoTest/update_date_when_updated_date_is_zero-result.xml3
-rw-r--r--sonar-core/src/test/resources/org/sonar/core/source/db/FileSourceDaoTest/update_date_when_updated_date_is_zero.xml3
10 files changed, 17 insertions, 6 deletions
diff --git a/sonar-core/src/main/resources/org/sonar/core/persistence/schema-h2.ddl b/sonar-core/src/main/resources/org/sonar/core/persistence/schema-h2.ddl
index 5ebe86e0e1b..0e7b81d2a4c 100644
--- a/sonar-core/src/main/resources/org/sonar/core/persistence/schema-h2.ddl
+++ b/sonar-core/src/main/resources/org/sonar/core/persistence/schema-h2.ddl
@@ -562,6 +562,7 @@ CREATE TABLE "FILE_SOURCES" (
"FILE_UUID" VARCHAR(50) NOT NULL,
"LINE_HASHES" CLOB(2147483647),
"BINARY_DATA" BLOB(167772150),
+ "TEST_DATA" BLOB(167772150),
"DATA_HASH" VARCHAR(50) NOT NULL,
"SRC_HASH" VARCHAR(50) NULL,
"CREATED_AT" BIGINT NOT NULL,
diff --git a/sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/delete_file_sources_of_disabled_resources-result.xml b/sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/delete_file_sources_of_disabled_resources-result.xml
index 7caaa526513..b5e97717395 100644
--- a/sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/delete_file_sources_of_disabled_resources-result.xml
+++ b/sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/delete_file_sources_of_disabled_resources-result.xml
@@ -1,5 +1,5 @@
<dataset>
- <file_sources id="2" project_uuid="ABCD" file_uuid="KLMN" binary_data="[null]" line_hashes="[null]" data_hash="321654988"
+ <file_sources id="2" project_uuid="ABCD" file_uuid="KLMN" binary_data="[null]" test_data="[null]" line_hashes="[null]" data_hash="321654988"
created_at="123456789" updated_at="123456789" src_hash="123456"/>
</dataset>
diff --git a/sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/delete_file_sources_of_disabled_resources.xml b/sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/delete_file_sources_of_disabled_resources.xml
index aaae9915d98..05dc0c9015a 100644
--- a/sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/delete_file_sources_of_disabled_resources.xml
+++ b/sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/delete_file_sources_of_disabled_resources.xml
@@ -72,8 +72,8 @@
depth="[null]" scope="PRJ" qualifier="TRK" created_at="1228222680000"
build_date="1228222680000" version="[null]" path="[null]"/>
- <file_sources id="1" project_uuid="ABCD" file_uuid="GHIJ" binary_data="[null]" line_hashes="[null]" data_hash="321654987"
+ <file_sources id="1" project_uuid="ABCD" file_uuid="GHIJ" binary_data="[null]" test_data="[null]" line_hashes="[null]" data_hash="321654987"
created_at="123456789" updated_at="123456789" src_hash="12345"/>
- <file_sources id="2" project_uuid="ABCD" file_uuid="KLMN" binary_data="[null]" line_hashes="[null]" data_hash="321654988"
+ <file_sources id="2" project_uuid="ABCD" file_uuid="KLMN" binary_data="[null]" test_data="[null]" line_hashes="[null]" data_hash="321654988"
created_at="123456789" updated_at="123456789" src_hash="123456"/>
</dataset>
diff --git a/sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/select_purgeable_file_uuids.xml b/sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/select_purgeable_file_uuids.xml
index 5bbb5aa5891..469122aeb01 100644
--- a/sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/select_purgeable_file_uuids.xml
+++ b/sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/select_purgeable_file_uuids.xml
@@ -79,8 +79,8 @@
depth="[null]" scope="PRJ" qualifier="TRK" created_at="1228222680000"
build_date="1228222680000" version="[null]" path="[null]"/>
- <file_sources id="1" project_uuid="ABCD" file_uuid="GHIJ" binary_data="[null]" line_hashes="[null]" data_hash="321654987"
+ <file_sources id="1" project_uuid="ABCD" file_uuid="GHIJ" binary_data="[null]" test_data="[null]" line_hashes="[null]" data_hash="321654987"
created_at="123456789" updated_at="123456789"/>
- <file_sources id="2" project_uuid="ABCD" file_uuid="KLMN" binary_data="[null]" line_hashes="[null]" data_hash="321654988"
+ <file_sources id="2" project_uuid="ABCD" file_uuid="KLMN" binary_data="[null]" test_data="[null]" line_hashes="[null]" data_hash="321654988"
created_at="123456789" updated_at="123456789"/>
</dataset>
diff --git a/sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/shouldDeleteProject.xml b/sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/shouldDeleteProject.xml
index d50cc3926f5..9a1feb6e065 100644
--- a/sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/shouldDeleteProject.xml
+++ b/sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/shouldDeleteProject.xml
@@ -103,6 +103,6 @@
depth="[null]" scope="FIL" qualifier="FIL" created_at="1228222680000"
build_date="1228222680000"
version="[null]" path="[null]"/>
- <file_sources id="1" project_uuid="A" file_uuid="D" binary_data="[null]" line_hashes="[null]" data_hash="321654987"
+ <file_sources id="1" project_uuid="A" file_uuid="D" binary_data="[null]" test_data="[null]" line_hashes="[null]" data_hash="321654987"
created_at="123456789" updated_at="123456789"/>
</dataset>
diff --git a/sonar-core/src/test/resources/org/sonar/core/source/db/FileSourceDaoTest/insert-result.xml b/sonar-core/src/test/resources/org/sonar/core/source/db/FileSourceDaoTest/insert-result.xml
index 74bca5ec788..67fb0ae86e7 100644
--- a/sonar-core/src/test/resources/org/sonar/core/source/db/FileSourceDaoTest/insert-result.xml
+++ b/sonar-core/src/test/resources/org/sonar/core/source/db/FileSourceDaoTest/insert-result.xml
@@ -2,6 +2,7 @@
<file_sources id="101" project_uuid="PRJ_UUID" file_uuid="FILE1_UUID"
binary_data="abcde" data_hash="hash"
+ test_data="[null]"
line_hashes="ABC\nDEF\nGHI"
src_hash="FILE_HASH"
created_at="1500000000000" updated_at="1500000000000" />
@@ -9,6 +10,7 @@
<file_sources id="102" project_uuid="PRJ_UUID" file_uuid="FILE2_UUID"
binary_data="[ignore]"
+ test_data="[null]"
data_hash="FILE2_DATA_HASH"
line_hashes="LINE1_HASH\nLINE2_HASH"
src_hash="FILE2_HASH"
diff --git a/sonar-core/src/test/resources/org/sonar/core/source/db/FileSourceDaoTest/shared.xml b/sonar-core/src/test/resources/org/sonar/core/source/db/FileSourceDaoTest/shared.xml
index 79a340f841d..c04c92d5c9b 100644
--- a/sonar-core/src/test/resources/org/sonar/core/source/db/FileSourceDaoTest/shared.xml
+++ b/sonar-core/src/test/resources/org/sonar/core/source/db/FileSourceDaoTest/shared.xml
@@ -2,6 +2,7 @@
<file_sources id="101" project_uuid="PRJ_UUID" file_uuid="FILE1_UUID"
binary_data="abcde" data_hash="hash"
+ test_data="[null]"
line_hashes="ABC\nDEF\nGHI"
src_hash="FILE_HASH"
created_at="1500000000000" updated_at="1500000000000" />
diff --git a/sonar-core/src/test/resources/org/sonar/core/source/db/FileSourceDaoTest/update-result.xml b/sonar-core/src/test/resources/org/sonar/core/source/db/FileSourceDaoTest/update-result.xml
index 40cbfa91a43..2d71f379cf2 100644
--- a/sonar-core/src/test/resources/org/sonar/core/source/db/FileSourceDaoTest/update-result.xml
+++ b/sonar-core/src/test/resources/org/sonar/core/source/db/FileSourceDaoTest/update-result.xml
@@ -2,6 +2,7 @@
<file_sources id="101" project_uuid="PRJ_UUID" file_uuid="FILE1_UUID"
binary_data="[ignore]"
+ test_data="[null]"
data_hash="NEW_DATA_HASH"
line_hashes="NEW_LINE_HASHES"
src_hash="NEW_FILE_HASH"
diff --git a/sonar-core/src/test/resources/org/sonar/core/source/db/FileSourceDaoTest/update_date_when_updated_date_is_zero-result.xml b/sonar-core/src/test/resources/org/sonar/core/source/db/FileSourceDaoTest/update_date_when_updated_date_is_zero-result.xml
index 931bab04e18..0450883e306 100644
--- a/sonar-core/src/test/resources/org/sonar/core/source/db/FileSourceDaoTest/update_date_when_updated_date_is_zero-result.xml
+++ b/sonar-core/src/test/resources/org/sonar/core/source/db/FileSourceDaoTest/update_date_when_updated_date_is_zero-result.xml
@@ -3,16 +3,19 @@
<!-- Updated -->
<file_sources id="101" project_uuid="ABCD" file_uuid="FILE1_UUID"
binary_data="abcde" data_hash="hash" line_hashes="ABC\nDEF\nGHI" src_hash="FILE_HASH"
+ test_data="[null]"
created_at="1500000000000" updated_at="1500000000002"/>
<!-- Not updated because updated_at is not null -->
<file_sources id="102" project_uuid="ABCD" file_uuid="FILE2_UUID"
binary_data="abcde" data_hash="hash" line_hashes="ABC\nDEF\nGHI" src_hash="FILE_HASH"
+ test_data="[null]"
created_at="1500000000000" updated_at="1500000000000"/>
<!-- Not updated because on another project -->
<file_sources id="103" project_uuid="BCDE" file_uuid="FILE3_UUID"
binary_data="abcde" data_hash="hash" line_hashes="ABC\nDEF\nGHI" src_hash="FILE_HASH"
+ test_data="[null]"
created_at="1500000000000" updated_at="0"/>
</dataset>
diff --git a/sonar-core/src/test/resources/org/sonar/core/source/db/FileSourceDaoTest/update_date_when_updated_date_is_zero.xml b/sonar-core/src/test/resources/org/sonar/core/source/db/FileSourceDaoTest/update_date_when_updated_date_is_zero.xml
index 9782d5c3837..5444e33435f 100644
--- a/sonar-core/src/test/resources/org/sonar/core/source/db/FileSourceDaoTest/update_date_when_updated_date_is_zero.xml
+++ b/sonar-core/src/test/resources/org/sonar/core/source/db/FileSourceDaoTest/update_date_when_updated_date_is_zero.xml
@@ -3,14 +3,17 @@
<!-- Only this source should be updated -->
<file_sources id="101" project_uuid="ABCD" file_uuid="FILE1_UUID"
binary_data="abcde" data_hash="hash" line_hashes="ABC\nDEF\nGHI" src_hash="FILE_HASH"
+ test_data="[null]"
created_at="1500000000000" updated_at="0"/>
<file_sources id="102" project_uuid="ABCD" file_uuid="FILE2_UUID"
binary_data="abcde" data_hash="hash" line_hashes="ABC\nDEF\nGHI" src_hash="FILE_HASH"
+ test_data="[null]"
created_at="1500000000000" updated_at="1500000000000"/>
<file_sources id="103" project_uuid="BCDE" file_uuid="FILE3_UUID"
binary_data="abcde" data_hash="hash" line_hashes="ABC\nDEF\nGHI" src_hash="FILE_HASH"
+ test_data="[null]"
created_at="1500000000000" updated_at="0"/>
</dataset>