diff options
author | simonbrandhof <simon.brandhof@gmail.com> | 2010-11-26 07:24:54 +0000 |
---|---|---|
committer | simonbrandhof <simon.brandhof@gmail.com> | 2010-11-26 07:24:54 +0000 |
commit | c64d328afa303bf48724bab92c80fff31114ef24 (patch) | |
tree | 0cc4caf3c8c337affc1cd5e892d7f84a19dc4a73 /sonar-batch | |
parent | 19f841e8c13c6dc8ef2f6a68a5751fa5fba26062 (diff) | |
download | sonarqube-c64d328afa303bf48724bab92c80fff31114ef24.tar.gz sonarqube-c64d328afa303bf48724bab92c80fff31114ef24.zip |
forgot to commit some unit test files
Diffstat (limited to 'sonar-batch')
7 files changed, 542 insertions, 0 deletions
diff --git a/sonar-batch/src/test/resources/org/sonar/batch/phases/UpdateStatusJobTest/doNotFailIfNoPenultimateLast-result.xml b/sonar-batch/src/test/resources/org/sonar/batch/phases/UpdateStatusJobTest/doNotFailIfNoPenultimateLast-result.xml new file mode 100644 index 00000000000..a1b5dc5de93 --- /dev/null +++ b/sonar-batch/src/test/resources/org/sonar/batch/phases/UpdateStatusJobTest/doNotFailIfNoPenultimateLast-result.xml @@ -0,0 +1,22 @@ +<dataset> + <!-- currently processing snapshots --> + <snapshots depth="[null]" id="5" scope="PRJ" qualifier="TRK" created_at="2008-12-04 13:58:00.00" version="[null]" + project_id="1" + parent_snapshot_id="[null]" root_project_id="[null]" root_snapshot_id="[null]" status="P" islast="true" + path="[null]"/> + + <snapshots depth="[null]" id="6" scope="PRJ" qualifier="TRK" created_at="2008-12-04 13:58:00.00" version="[null]" + project_id="2" + parent_snapshot_id="5" root_project_id="[null]" root_snapshot_id="5" status="P" islast="true" + path="[null]"/> + + <snapshots depth="[null]" id="7" scope="DIR" qualifier="PAC" created_at="2008-12-04 13:58:00.00" version="[null]" + project_id="3" + parent_snapshot_id="6" root_project_id="[null]" root_snapshot_id="5" status="P" islast="true" + path="[null]"/> + + <snapshots depth="[null]" id="8" scope="FIL" qualifier="CLA" created_at="2008-12-04 13:58:00.00" version="[null]" + project_id="4" + parent_snapshot_id="7" root_project_id="[null]" root_snapshot_id="5" status="P" islast="true" + path="[null]"/> +</dataset>
\ No newline at end of file diff --git a/sonar-batch/src/test/resources/org/sonar/batch/phases/UpdateStatusJobTest/doNotFailIfNoPenultimateLast.xml b/sonar-batch/src/test/resources/org/sonar/batch/phases/UpdateStatusJobTest/doNotFailIfNoPenultimateLast.xml new file mode 100644 index 00000000000..700793aaeee --- /dev/null +++ b/sonar-batch/src/test/resources/org/sonar/batch/phases/UpdateStatusJobTest/doNotFailIfNoPenultimateLast.xml @@ -0,0 +1,23 @@ +<dataset> + + <!-- currently processing snapshots --> + <snapshots depth="[null]" id="5" scope="PRJ" qualifier="TRK" created_at="2008-12-04 13:58:00.00" version="[null]" + project_id="1" + parent_snapshot_id="[null]" root_project_id="[null]" root_snapshot_id="[null]" status="U" islast="false" + path="[null]"/> + + <snapshots depth="[null]" id="6" scope="PRJ" qualifier="TRK" created_at="2008-12-04 13:58:00.00" version="[null]" + project_id="2" + parent_snapshot_id="5" root_project_id="[null]" root_snapshot_id="5" status="U" islast="false" + path="[null]"/> + + <snapshots depth="[null]" id="7" scope="DIR" qualifier="PAC" created_at="2008-12-04 13:58:00.00" version="[null]" + project_id="3" + parent_snapshot_id="6" root_project_id="[null]" root_snapshot_id="5" status="U" islast="false" + path="[null]"/> + + <snapshots depth="[null]" id="8" scope="FIL" qualifier="CLA" created_at="2008-12-04 13:58:00.00" version="[null]" + project_id="4" + parent_snapshot_id="7" root_project_id="[null]" root_snapshot_id="5" status="U" islast="false" + path="[null]"/> +</dataset>
\ No newline at end of file diff --git a/sonar-batch/src/test/resources/org/sonar/batch/phases/UpdateStatusJobTest/lastSnapshotIsNotUpdatedWhenAnalyzingPastSnapshot-result.xml b/sonar-batch/src/test/resources/org/sonar/batch/phases/UpdateStatusJobTest/lastSnapshotIsNotUpdatedWhenAnalyzingPastSnapshot-result.xml new file mode 100644 index 00000000000..909141c4f5b --- /dev/null +++ b/sonar-batch/src/test/resources/org/sonar/batch/phases/UpdateStatusJobTest/lastSnapshotIsNotUpdatedWhenAnalyzingPastSnapshot-result.xml @@ -0,0 +1,173 @@ +<dataset> + + <!-- last snapshot : is always last, and not purged --> + <snapshots depth="[null]" id="1" scope="PRJ" qualifier="TRK" created_at="2008-12-02 13:58:00.00" version="[null]" + project_id="1" + parent_snapshot_id="[null]" root_project_id="[null]" root_snapshot_id="[null]" status="P" islast="true" + path="[null]"/> + + <snapshots depth="[null]" id="2" scope="PRJ" qualifier="TRK" created_at="2008-12-02 13:58:00.00" version="[null]" + project_id="2" + parent_snapshot_id="1" root_project_id="[null]" root_snapshot_id="1" status="P" islast="true" + path="[null]"/> + + <snapshots depth="[null]" id="3" scope="DIR" qualifier="PAC" created_at="2008-12-02 13:58:00.00" version="[null]" + project_id="3" + parent_snapshot_id="2" root_project_id="[null]" root_snapshot_id="1" status="P" islast="true" + path="[null]"/> + + <snapshots depth="[null]" id="4" scope="FIL" qualifier="CLA" created_at="2008-12-02 13:58:00.00" version="[null]" + project_id="4" + parent_snapshot_id="3" root_project_id="[null]" root_snapshot_id="1" status="P" islast="true" + path="[null]"/> + + <snapshots depth="[null]" id="5" scope="FIL" qualifier="CLA" created_at="2008-12-02 13:58:00.00" version="[null]" + project_id="5" + parent_snapshot_id="3" root_project_id="[null]" root_snapshot_id="1" status="P" islast="true" + path="[null]"/> + + + <!-- the snapshot to process : not set as last--> + <snapshots depth="[null]" id="6" scope="PRJ" qualifier="TRK" created_at="2005-10-01 00:00:00.00" version="[null]" + project_id="1" + parent_snapshot_id="[null]" root_project_id="[null]" root_snapshot_id="[null]" status="P" islast="false" + path="[null]"/> + + <snapshots depth="[null]" id="7" scope="PRJ" qualifier="TRK" created_at="2005-10-01 00:00:00.00" version="[null]" + project_id="2" + parent_snapshot_id="6" root_project_id="[null]" root_snapshot_id="6" status="P" islast="false" + path="[null]"/> + + <snapshots depth="[null]" id="8" scope="DIR" qualifier="PAC" created_at="2005-10-01 00:00:00.00" version="[null]" + project_id="3" + parent_snapshot_id="7" root_project_id="[null]" root_snapshot_id="6" status="P" islast="false" + path="[null]"/> + + <snapshots depth="[null]" id="9" scope="FIL" qualifier="CLA" created_at="2005-10-01 00:00:00.00" version="[null]" + project_id="4" + parent_snapshot_id="8" root_project_id="[null]" root_snapshot_id="6" status="P" islast="false" + path="[null]"/> + + <snapshots depth="[null]" id="10" scope="FIL" qualifier="CLA" created_at="2005-10-01 00:00:00.00" version="[null]" + project_id="5" + parent_snapshot_id="9" root_project_id="[null]" root_snapshot_id="6" status="P" islast="false" + path="[null]"/> + + + <SNAPSHOT_SOURCES ID="1" SNAPSHOT_ID="4" DATA="source code of Class1"/> + <SNAPSHOT_SOURCES ID="2" SNAPSHOT_ID="5" DATA="source code of Class2"/> + + <RULE_FAILURES ID="1" SNAPSHOT_ID="4" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg1" COST="[null]"/> + <RULE_FAILURES ID="2" SNAPSHOT_ID="4" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg2" COST="[null]"/> + <RULE_FAILURES ID="3" SNAPSHOT_ID="4" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg3" COST="[null]"/> + <RULE_FAILURES ID="4" SNAPSHOT_ID="4" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg4" COST="[null]"/> + + <RULE_FAILURES ID="5" SNAPSHOT_ID="5" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg5" COST="[null]"/> + <RULE_FAILURES ID="6" SNAPSHOT_ID="5" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg6" COST="[null]"/> + + <!-- measures at project level --> + <project_measures characteristic_id="[null]" url="[null]" diff_value_1="[null]" diff_value_2="[null]" diff_value_3="[null]" + rule_priority="[null]" + alert_text="[null]" ID="1" VALUE="10.0" METRIC_ID="1" SNAPSHOT_ID="1" RULES_CATEGORY_ID="1" + RULE_ID="1" + text_value="[null]" tendency="[null]" measure_date="[null]" project_id="[null]" + alert_status="[null]" description="[null]"/> + <project_measures characteristic_id="[null]" url="[null]" diff_value_1="[null]" diff_value_2="[null]" diff_value_3="[null]" + rule_priority="[null]" + alert_text="[null]" ID="2" VALUE="20.0" METRIC_ID="2" SNAPSHOT_ID="1" RULES_CATEGORY_ID="1" + RULE_ID="[null]" + text_value="[null]" tendency="[null]" measure_date="[null]" project_id="[null]" + alert_status="[null]" description="[null]"/> + <project_measures characteristic_id="[null]" url="[null]" diff_value_1="[null]" diff_value_2="[null]" diff_value_3="[null]" + rule_priority="[null]" + alert_text="[null]" ID="3" VALUE="30.0" METRIC_ID="3" SNAPSHOT_ID="1" RULES_CATEGORY_ID="[null]" + RULE_ID="[null]" + text_value="[null]" tendency="[null]" measure_date="[null]" project_id="[null]" + alert_status="[null]" description="[null]"/> + + <!-- measures at module level --> + <project_measures characteristic_id="[null]" url="[null]" diff_value_1="[null]" diff_value_2="[null]" diff_value_3="[null]" + rule_priority="[null]" + alert_text="[null]" ID="4" VALUE="10.0" METRIC_ID="1" SNAPSHOT_ID="2" RULES_CATEGORY_ID="1" + RULE_ID="1" + text_value="[null]" tendency="[null]" measure_date="[null]" project_id="[null]" + alert_status="[null]" description="[null]"/> + <project_measures characteristic_id="[null]" url="[null]" diff_value_1="[null]" diff_value_2="[null]" diff_value_3="[null]" + rule_priority="[null]" + alert_text="[null]" ID="5" VALUE="20.0" METRIC_ID="2" SNAPSHOT_ID="2" RULES_CATEGORY_ID="1" + RULE_ID="[null]" + text_value="[null]" tendency="[null]" measure_date="[null]" project_id="[null]" + alert_status="[null]" description="[null]"/> + <project_measures characteristic_id="[null]" url="[null]" diff_value_1="[null]" diff_value_2="[null]" diff_value_3="[null]" + rule_priority="[null]" + alert_text="[null]" ID="6" VALUE="30.0" METRIC_ID="3" SNAPSHOT_ID="2" RULES_CATEGORY_ID="[null]" + RULE_ID="[null]" + text_value="[null]" tendency="[null]" measure_date="[null]" project_id="[null]" + alert_status="[null]" description="[null]"/> + + <!-- measures at package level --> + <project_measures characteristic_id="[null]" url="[null]" diff_value_1="[null]" diff_value_2="[null]" diff_value_3="[null]" + rule_priority="[null]" + alert_text="[null]" ID="7" VALUE="40.0" METRIC_ID="1" SNAPSHOT_ID="3" RULES_CATEGORY_ID="[null]" + RULE_ID="1" + text_value="[null]" tendency="[null]" measure_date="[null]" project_id="[null]" + alert_status="[null]" description="[null]"/> + <project_measures characteristic_id="[null]" url="[null]" diff_value_1="[null]" diff_value_2="[null]" diff_value_3="[null]" + rule_priority="[null]" + alert_text="[null]" ID="8" VALUE="50.0" METRIC_ID="2" SNAPSHOT_ID="3" RULES_CATEGORY_ID="1" + RULE_ID="[null]" + text_value="[null]" tendency="[null]" measure_date="[null]" project_id="[null]" + alert_status="[null]" description="[null]"/> + <project_measures characteristic_id="[null]" url="[null]" diff_value_1="[null]" diff_value_2="[null]" diff_value_3="[null]" + rule_priority="[null]" + alert_text="[null]" ID="9" VALUE="60.0" METRIC_ID="3" SNAPSHOT_ID="3" RULES_CATEGORY_ID="[null]" + RULE_ID="[null]" + text_value="[null]" tendency="[null]" measure_date="[null]" project_id="[null]" + alert_status="[null]" description="[null]"/> + <project_measures characteristic_id="[null]" url="[null]" diff_value_1="[null]" diff_value_2="[null]" diff_value_3="[null]" + rule_priority="[null]" + alert_text="[null]" ID="10" VALUE="60.0" METRIC_ID="3" SNAPSHOT_ID="3" RULES_CATEGORY_ID="[null]" + RULE_ID="[null]" + text_value="[null]" tendency="[null]" measure_date="[null]" project_id="[null]" + alert_status="[null]" description="[null]"/> + + <!-- measures at class level --> + <project_measures characteristic_id="[null]" url="[null]" diff_value_1="[null]" diff_value_2="[null]" diff_value_3="[null]" + rule_priority="[null]" + alert_text="[null]" ID="11" VALUE="40.0" METRIC_ID="1" SNAPSHOT_ID="4" RULES_CATEGORY_ID="1" + RULE_ID="1" + text_value="[null]" tendency="[null]" measure_date="[null]" project_id="[null]" + alert_status="[null]" description="[null]"/> + <project_measures characteristic_id="[null]" url="[null]" diff_value_1="[null]" diff_value_2="[null]" diff_value_3="[null]" + rule_priority="[null]" + alert_text="[null]" ID="12" VALUE="50.0" METRIC_ID="2" SNAPSHOT_ID="4" RULES_CATEGORY_ID="1" + RULE_ID="[null]" + text_value="[null]" tendency="[null]" measure_date="[null]" project_id="[null]" + alert_status="[null]" description="[null]"/> + <project_measures characteristic_id="[null]" url="[null]" diff_value_1="[null]" diff_value_2="[null]" diff_value_3="[null]" + rule_priority="[null]" + alert_text="[null]" ID="13" VALUE="60.0" METRIC_ID="3" SNAPSHOT_ID="4" RULES_CATEGORY_ID="[null]" + RULE_ID="[null]" + text_value="[null]" tendency="[null]" measure_date="[null]" project_id="[null]" + alert_status="[null]" description="[null]"/> + + <project_measures characteristic_id="[null]" url="[null]" diff_value_1="[null]" diff_value_2="[null]" diff_value_3="[null]" + rule_priority="[null]" + alert_text="[null]" ID="14" VALUE="40.0" METRIC_ID="1" SNAPSHOT_ID="5" RULES_CATEGORY_ID="1" + RULE_ID="1" + text_value="[null]" tendency="[null]" measure_date="[null]" project_id="[null]" + alert_status="[null]" description="[null]"/> + <project_measures characteristic_id="[null]" url="[null]" diff_value_1="[null]" diff_value_2="[null]" diff_value_3="[null]" + rule_priority="[null]" + alert_text="[null]" ID="15" VALUE="50.0" METRIC_ID="2" SNAPSHOT_ID="5" RULES_CATEGORY_ID="1" + RULE_ID="[null]" + text_value="[null]" tendency="[null]" measure_date="[null]" project_id="[null]" + alert_status="[null]" description="[null]"/> + <project_measures characteristic_id="[null]" url="[null]" diff_value_1="[null]" diff_value_2="[null]" diff_value_3="[null]" + rule_priority="[null]" + alert_text="[null]" ID="16" VALUE="60.0" METRIC_ID="3" SNAPSHOT_ID="5" RULES_CATEGORY_ID="[null]" + RULE_ID="[null]" + text_value="[null]" tendency="[null]" measure_date="[null]" project_id="[null]" + alert_status="[null]" description="[null]"/> + +</dataset>
\ No newline at end of file diff --git a/sonar-batch/src/test/resources/org/sonar/batch/phases/UpdateStatusJobTest/lastSnapshotIsNotUpdatedWhenAnalyzingPastSnapshot.xml b/sonar-batch/src/test/resources/org/sonar/batch/phases/UpdateStatusJobTest/lastSnapshotIsNotUpdatedWhenAnalyzingPastSnapshot.xml new file mode 100644 index 00000000000..523a66915f4 --- /dev/null +++ b/sonar-batch/src/test/resources/org/sonar/batch/phases/UpdateStatusJobTest/lastSnapshotIsNotUpdatedWhenAnalyzingPastSnapshot.xml @@ -0,0 +1,174 @@ +<dataset> + + <!-- last snapshot --> + <snapshots depth="[null]" id="1" scope="PRJ" qualifier="TRK" created_at="2008-12-02 13:58:00.00" version="[null]" + project_id="1" + parent_snapshot_id="[null]" root_project_id="[null]" root_snapshot_id="[null]" status="P" islast="true" + path="[null]"/> + + <snapshots depth="[null]" id="2" scope="PRJ" qualifier="TRK" created_at="2008-12-02 13:58:00.00" version="[null]" + project_id="2" + parent_snapshot_id="1" root_project_id="[null]" root_snapshot_id="1" status="P" islast="true" + path="[null]"/> + + <snapshots depth="[null]" id="3" scope="DIR" qualifier="PAC" created_at="2008-12-02 13:58:00.00" version="[null]" + project_id="3" + parent_snapshot_id="2" root_project_id="[null]" root_snapshot_id="1" status="P" islast="true" + path="[null]"/> + + <snapshots depth="[null]" id="4" scope="FIL" qualifier="CLA" created_at="2008-12-02 13:58:00.00" version="[null]" + project_id="4" + parent_snapshot_id="3" root_project_id="[null]" root_snapshot_id="1" status="P" islast="true" + path="[null]"/> + + <snapshots depth="[null]" id="5" scope="FIL" qualifier="CLA" created_at="2008-12-02 13:58:00.00" version="[null]" + project_id="5" + parent_snapshot_id="3" root_project_id="[null]" root_snapshot_id="1" status="P" islast="true" + path="[null]"/> + + + <!-- the snapshot to process --> + <snapshots depth="[null]" id="6" scope="PRJ" qualifier="TRK" created_at="2005-10-01 00:00:00.00" version="[null]" + project_id="1" + parent_snapshot_id="[null]" root_project_id="[null]" root_snapshot_id="[null]" status="[null]" + islast="false" + path="[null]"/> + + <snapshots depth="[null]" id="7" scope="PRJ" qualifier="TRK" created_at="2005-10-01 00:00:00.00" version="[null]" + project_id="2" + parent_snapshot_id="6" root_project_id="[null]" root_snapshot_id="6" status="[null]" islast="false" + path="[null]"/> + + <snapshots depth="[null]" id="8" scope="DIR" qualifier="PAC" created_at="2005-10-01 00:00:00.00" version="[null]" + project_id="3" + parent_snapshot_id="7" root_project_id="[null]" root_snapshot_id="6" status="[null]" islast="false" + path="[null]"/> + + <snapshots depth="[null]" id="9" scope="FIL" qualifier="CLA" created_at="2005-10-01 00:00:00.00" version="[null]" + project_id="4" + parent_snapshot_id="8" root_project_id="[null]" root_snapshot_id="6" status="[null]" islast="false" + path="[null]"/> + + <snapshots depth="[null]" id="10" scope="FIL" qualifier="CLA" created_at="2005-10-01 00:00:00.00" version="[null]" + project_id="5" + parent_snapshot_id="9" root_project_id="[null]" root_snapshot_id="6" status="[null]" islast="false" + path="[null]"/> + + + <SNAPSHOT_SOURCES ID="1" SNAPSHOT_ID="4" DATA="source code of Class1"/> + <SNAPSHOT_SOURCES ID="2" SNAPSHOT_ID="5" DATA="source code of Class2"/> + + <RULE_FAILURES ID="1" SNAPSHOT_ID="4" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg1" COST="[null]"/> + <RULE_FAILURES ID="2" SNAPSHOT_ID="4" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg2" COST="[null]"/> + <RULE_FAILURES ID="3" SNAPSHOT_ID="4" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg3" COST="[null]"/> + <RULE_FAILURES ID="4" SNAPSHOT_ID="4" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg4" COST="[null]"/> + + <RULE_FAILURES ID="5" SNAPSHOT_ID="5" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg5" COST="[null]"/> + <RULE_FAILURES ID="6" SNAPSHOT_ID="5" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg6" COST="[null]"/> + + <!-- measures at project level --> + <project_measures characteristic_id="[null]" url="[null]" diff_value_1="[null]" diff_value_2="[null]" diff_value_3="[null]" + rule_priority="[null]" + alert_text="[null]" ID="1" VALUE="10.0" METRIC_ID="1" SNAPSHOT_ID="1" RULES_CATEGORY_ID="1" + RULE_ID="1" + text_value="[null]" tendency="[null]" measure_date="[null]" project_id="[null]" + alert_status="[null]" description="[null]"/> + <project_measures characteristic_id="[null]" url="[null]" diff_value_1="[null]" diff_value_2="[null]" diff_value_3="[null]" + rule_priority="[null]" + alert_text="[null]" ID="2" VALUE="20.0" METRIC_ID="2" SNAPSHOT_ID="1" RULES_CATEGORY_ID="1" + RULE_ID="[null]" + text_value="[null]" tendency="[null]" measure_date="[null]" project_id="[null]" + alert_status="[null]" description="[null]"/> + <project_measures characteristic_id="[null]" url="[null]" diff_value_1="[null]" diff_value_2="[null]" diff_value_3="[null]" + rule_priority="[null]" + alert_text="[null]" ID="3" VALUE="30.0" METRIC_ID="3" SNAPSHOT_ID="1" RULES_CATEGORY_ID="[null]" + RULE_ID="[null]" + text_value="[null]" tendency="[null]" measure_date="[null]" project_id="[null]" + alert_status="[null]" description="[null]"/> + + <!-- measures at module level --> + <project_measures characteristic_id="[null]" url="[null]" diff_value_1="[null]" diff_value_2="[null]" diff_value_3="[null]" + rule_priority="[null]" + alert_text="[null]" ID="4" VALUE="10.0" METRIC_ID="1" SNAPSHOT_ID="2" RULES_CATEGORY_ID="1" + RULE_ID="1" + text_value="[null]" tendency="[null]" measure_date="[null]" project_id="[null]" + alert_status="[null]" description="[null]"/> + <project_measures characteristic_id="[null]" url="[null]" diff_value_1="[null]" diff_value_2="[null]" diff_value_3="[null]" + rule_priority="[null]" + alert_text="[null]" ID="5" VALUE="20.0" METRIC_ID="2" SNAPSHOT_ID="2" RULES_CATEGORY_ID="1" + RULE_ID="[null]" + text_value="[null]" tendency="[null]" measure_date="[null]" project_id="[null]" + alert_status="[null]" description="[null]"/> + <project_measures characteristic_id="[null]" url="[null]" diff_value_1="[null]" diff_value_2="[null]" diff_value_3="[null]" + rule_priority="[null]" + alert_text="[null]" ID="6" VALUE="30.0" METRIC_ID="3" SNAPSHOT_ID="2" RULES_CATEGORY_ID="[null]" + RULE_ID="[null]" + text_value="[null]" tendency="[null]" measure_date="[null]" project_id="[null]" + alert_status="[null]" description="[null]"/> + + <!-- measures at package level --> + <project_measures characteristic_id="[null]" url="[null]" diff_value_1="[null]" diff_value_2="[null]" diff_value_3="[null]" + rule_priority="[null]" + alert_text="[null]" ID="7" VALUE="40.0" METRIC_ID="1" SNAPSHOT_ID="3" RULES_CATEGORY_ID="[null]" + RULE_ID="1" + text_value="[null]" tendency="[null]" measure_date="[null]" project_id="[null]" + alert_status="[null]" description="[null]"/> + <project_measures characteristic_id="[null]" url="[null]" diff_value_1="[null]" diff_value_2="[null]" diff_value_3="[null]" + rule_priority="[null]" + alert_text="[null]" ID="8" VALUE="50.0" METRIC_ID="2" SNAPSHOT_ID="3" RULES_CATEGORY_ID="1" + RULE_ID="[null]" + text_value="[null]" tendency="[null]" measure_date="[null]" project_id="[null]" + alert_status="[null]" description="[null]"/> + <project_measures characteristic_id="[null]" url="[null]" diff_value_1="[null]" diff_value_2="[null]" diff_value_3="[null]" + rule_priority="[null]" + alert_text="[null]" ID="9" VALUE="60.0" METRIC_ID="3" SNAPSHOT_ID="3" RULES_CATEGORY_ID="[null]" + RULE_ID="[null]" + text_value="[null]" tendency="[null]" measure_date="[null]" project_id="[null]" + alert_status="[null]" description="[null]"/> + <project_measures characteristic_id="[null]" url="[null]" diff_value_1="[null]" diff_value_2="[null]" diff_value_3="[null]" + rule_priority="[null]" + alert_text="[null]" ID="10" VALUE="60.0" METRIC_ID="3" SNAPSHOT_ID="3" RULES_CATEGORY_ID="[null]" + RULE_ID="[null]" + text_value="[null]" tendency="[null]" measure_date="[null]" project_id="[null]" + alert_status="[null]" description="[null]"/> + + <!-- measures at class level --> + <project_measures characteristic_id="[null]" url="[null]" diff_value_1="[null]" diff_value_2="[null]" diff_value_3="[null]" + rule_priority="[null]" + alert_text="[null]" ID="11" VALUE="40.0" METRIC_ID="1" SNAPSHOT_ID="4" RULES_CATEGORY_ID="1" + RULE_ID="1" + text_value="[null]" tendency="[null]" measure_date="[null]" project_id="[null]" + alert_status="[null]" description="[null]"/> + <project_measures characteristic_id="[null]" url="[null]" diff_value_1="[null]" diff_value_2="[null]" diff_value_3="[null]" + rule_priority="[null]" + alert_text="[null]" ID="12" VALUE="50.0" METRIC_ID="2" SNAPSHOT_ID="4" RULES_CATEGORY_ID="1" + RULE_ID="[null]" + text_value="[null]" tendency="[null]" measure_date="[null]" project_id="[null]" + alert_status="[null]" description="[null]"/> + <project_measures characteristic_id="[null]" url="[null]" diff_value_1="[null]" diff_value_2="[null]" diff_value_3="[null]" + rule_priority="[null]" + alert_text="[null]" ID="13" VALUE="60.0" METRIC_ID="3" SNAPSHOT_ID="4" RULES_CATEGORY_ID="[null]" + RULE_ID="[null]" + text_value="[null]" tendency="[null]" measure_date="[null]" project_id="[null]" + alert_status="[null]" description="[null]"/> + + <project_measures characteristic_id="[null]" url="[null]" diff_value_1="[null]" diff_value_2="[null]" diff_value_3="[null]" + rule_priority="[null]" + alert_text="[null]" ID="14" VALUE="40.0" METRIC_ID="1" SNAPSHOT_ID="5" RULES_CATEGORY_ID="1" + RULE_ID="1" + text_value="[null]" tendency="[null]" measure_date="[null]" project_id="[null]" + alert_status="[null]" description="[null]"/> + <project_measures characteristic_id="[null]" url="[null]" diff_value_1="[null]" diff_value_2="[null]" diff_value_3="[null]" + rule_priority="[null]" + alert_text="[null]" ID="15" VALUE="50.0" METRIC_ID="2" SNAPSHOT_ID="5" RULES_CATEGORY_ID="1" + RULE_ID="[null]" + text_value="[null]" tendency="[null]" measure_date="[null]" project_id="[null]" + alert_status="[null]" description="[null]"/> + <project_measures characteristic_id="[null]" url="[null]" diff_value_1="[null]" diff_value_2="[null]" diff_value_3="[null]" + rule_priority="[null]" + alert_text="[null]" ID="16" VALUE="60.0" METRIC_ID="3" SNAPSHOT_ID="5" RULES_CATEGORY_ID="[null]" + RULE_ID="[null]" + text_value="[null]" tendency="[null]" measure_date="[null]" project_id="[null]" + alert_status="[null]" description="[null]"/> + +</dataset>
\ No newline at end of file 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 new file mode 100644 index 00000000000..00420a0362f --- /dev/null +++ b/sonar-batch/src/test/resources/org/sonar/batch/phases/UpdateStatusJobTest/sharedFixture.xml @@ -0,0 +1,38 @@ +<dataset> + <rules_categories id="1" name="category one" description="[null]"/> + <rules id="1" name="foo" rules_category_id="1" plugin_config_key="checker/foo" plugin_rule_key="checkstyle.rule1" + plugin_name="maven-checkstyle-plugin" description="description" cardinality="SINGLE" parent_id="[null]"/> + + <metrics id="1" name="ncloc" val_type="INT" description="[null]" domain="[null]" + short_name="" qualitative="false" user_managed="false" enabled="true" worst_value="[null]" optimized_best_value="[null]" best_value="[null]" direction="0" hidden="false"/> + <metrics id="2" name="foo" val_type="INT" description="[null]" domain="[null]" + short_name="" qualitative="false" user_managed="false" enabled="true" worst_value="[null]" optimized_best_value="[null]" best_value="[null]" direction="0" hidden="false"/> + <metrics id="3" name="bar" val_type="INT" description="[null]" domain="[null]" + short_name="" qualitative="false" user_managed="false" enabled="true" worst_value="[null]" optimized_best_value="[null]" best_value="[null]" direction="0" hidden="false"/> + <metrics id="4" name="baz" val_type="INT" description="[null]" domain="[null]" + short_name="" qualitative="false" user_managed="false" enabled="true" worst_value="[null]" optimized_best_value="[null]" best_value="[null]" direction="0" hidden="false"/> + + <projects long_name="[null]" id="1" scope="PRJ" qualifier="TRK" kee="mygroup:myartifact" name="[null]" + root_id="[null]" + description="[null]" + enabled="true" language="java" copy_resource_id="[null]"/> + + <projects long_name="[null]" id="2" scope="PRJ" qualifier="TRK" kee="mygroup:myartifact2" name="[null]" root_id="1" + description="[null]" + enabled="true" language="java" copy_resource_id="[null]"/> + + <projects long_name="[null]" id="3" scope="DIR" qualifier="PAC" kee="mygroup:myartifact:my.package" name="[null]" + root_id="1" + description="[null]" + enabled="true" language="java" copy_resource_id="[null]"/> + + <projects long_name="[null]" id="4" scope="FIL" qualifier="CLA" kee="mygroup:myartifact:my.package.Class1" + name="[null]" root_id="1" + description="[null]" + enabled="true" language="java" copy_resource_id="[null]"/> + + <projects long_name="[null]" id="5" scope="FIL" qualifier="CLA" kee="mygroup:myartifact:my.package.Class2" + name="[null]" root_id="1" + description="[null]" + enabled="true" language="java" copy_resource_id="[null]"/> +</dataset>
\ No newline at end of file diff --git a/sonar-batch/src/test/resources/org/sonar/batch/phases/UpdateStatusJobTest/shouldUnflagPenultimateLastSnapshot-result.xml b/sonar-batch/src/test/resources/org/sonar/batch/phases/UpdateStatusJobTest/shouldUnflagPenultimateLastSnapshot-result.xml new file mode 100644 index 00000000000..815b71743a4 --- /dev/null +++ b/sonar-batch/src/test/resources/org/sonar/batch/phases/UpdateStatusJobTest/shouldUnflagPenultimateLastSnapshot-result.xml @@ -0,0 +1,55 @@ +<dataset> + + <!-- previous last snapshots --> + <snapshots depth="[null]" id="1" scope="PRJ" qualifier="TRK" created_at="2008-12-02 13:58:00.00" version="[null]" + project_id="1" + parent_snapshot_id="[null]" root_project_id="[null]" root_snapshot_id="[null]" status="P" islast="false" + path="[null]"/> + + <snapshots depth="[null]" id="2" scope="PRJ" qualifier="TRK" created_at="2008-12-02 13:58:00.00" version="[null]" + project_id="2" + parent_snapshot_id="1" root_project_id="[null]" root_snapshot_id="1" status="P" islast="false" + path="[null]"/> + + <snapshots depth="[null]" id="3" scope="DIR" qualifier="PAC" created_at="2008-12-02 13:58:00.00" version="[null]" + project_id="3" + parent_snapshot_id="2" root_project_id="[null]" root_snapshot_id="1" status="P" islast="false" + path="[null]"/> + + <snapshots depth="[null]" id="4" scope="FIL" qualifier="CLA" created_at="2008-12-02 13:58:00.00" version="[null]" + project_id="4" + parent_snapshot_id="3" root_project_id="[null]" root_snapshot_id="1" status="P" islast="false" + path="[null]"/> + + <!-- already purged snapshot --> + <snapshots depth="[null]" id="9" scope="PRJ" qualifier="TRK" created_at="2008-10-02 13:58:00.00" version="[null]" + project_id="1" + parent_snapshot_id="[null]" root_project_id="[null]" root_snapshot_id="[null]" status="P" islast="false" + path="[null]"/> + + <snapshots depth="[null]" id="10" scope="PRJ" qualifier="TRK" created_at="2008-10-02 13:58:00.00" version="[null]" + project_id="2" + parent_snapshot_id="9" root_project_id="[null]" root_snapshot_id="9" status="P" islast="false" + path="[null]"/> + + <!-- currently processing snapshots --> + <snapshots depth="[null]" id="11" scope="PRJ" qualifier="TRK" created_at="2008-12-04 13:58:00.00" version="[null]" + project_id="1" + parent_snapshot_id="[null]" root_project_id="[null]" root_snapshot_id="[null]" status="P" islast="true" + path="[null]"/> + + <snapshots depth="[null]" id="12" scope="PRJ" qualifier="TRK" created_at="2008-12-04 13:58:00.00" version="[null]" + project_id="2" + parent_snapshot_id="11" root_project_id="[null]" root_snapshot_id="11" status="P" islast="true" + path="[null]"/> + + <snapshots depth="[null]" id="13" scope="DIR" qualifier="PAC" created_at="2008-12-04 13:58:00.00" version="[null]" + project_id="3" + parent_snapshot_id="12" root_project_id="[null]" root_snapshot_id="11" status="P" islast="true" + path="[null]"/> + + <snapshots depth="[null]" id="14" scope="FIL" qualifier="CLA" created_at="2008-12-04 13:58:00.00" version="[null]" + project_id="4" + parent_snapshot_id="13" root_project_id="[null]" root_snapshot_id="11" status="P" islast="true" + path="[null]"/> +</dataset>
\ No newline at end of file diff --git a/sonar-batch/src/test/resources/org/sonar/batch/phases/UpdateStatusJobTest/shouldUnflagPenultimateLastSnapshot.xml b/sonar-batch/src/test/resources/org/sonar/batch/phases/UpdateStatusJobTest/shouldUnflagPenultimateLastSnapshot.xml new file mode 100644 index 00000000000..7e4130b75d9 --- /dev/null +++ b/sonar-batch/src/test/resources/org/sonar/batch/phases/UpdateStatusJobTest/shouldUnflagPenultimateLastSnapshot.xml @@ -0,0 +1,57 @@ +<dataset> + + <!-- previous last snapshots --> + <snapshots depth="[null]" id="1" scope="PRJ" qualifier="TRK" created_at="2008-12-02 13:58:00.00" version="[null]" + project_id="1" + parent_snapshot_id="[null]" root_project_id="[null]" root_snapshot_id="[null]" status="P" islast="true" + path="[null]"/> + + <snapshots depth="[null]" id="2" scope="PRJ" qualifier="TRK" created_at="2008-12-02 13:58:00.00" version="[null]" + project_id="2" + parent_snapshot_id="1" root_project_id="[null]" root_snapshot_id="1" status="P" islast="true" + path="[null]"/> + + <snapshots depth="[null]" id="3" scope="DIR" qualifier="PAC" created_at="2008-12-02 13:58:00.00" version="[null]" + project_id="3" + parent_snapshot_id="2" root_project_id="[null]" root_snapshot_id="1" status="P" islast="true" + path="[null]"/> + + <snapshots depth="[null]" id="4" scope="FIL" qualifier="CLA" created_at="2008-12-02 13:58:00.00" version="[null]" + project_id="4" + parent_snapshot_id="3" root_project_id="[null]" root_snapshot_id="1" status="P" islast="true" + path="[null]"/> + + + <!-- already purged snapshot --> + <snapshots depth="[null]" id="9" scope="PRJ" qualifier="TRK" created_at="2008-10-02 13:58:00.00" version="[null]" + project_id="1" + parent_snapshot_id="[null]" root_project_id="[null]" root_snapshot_id="[null]" status="P" islast="false" + path="[null]"/> + + <snapshots depth="[null]" id="10" scope="PRJ" qualifier="TRK" created_at="2008-10-02 13:58:00.00" version="[null]" + project_id="2" + parent_snapshot_id="9" root_project_id="[null]" root_snapshot_id="9" status="P" islast="false" + path="[null]"/> + + + <!-- currently processing snapshots --> + <snapshots depth="[null]" id="11" scope="PRJ" qualifier="TRK" created_at="2008-12-04 13:58:00.00" version="[null]" + project_id="1" + parent_snapshot_id="[null]" root_project_id="[null]" root_snapshot_id="[null]" status="U" islast="false" + path="[null]"/> + + <snapshots depth="[null]" id="12" scope="PRJ" qualifier="TRK" created_at="2008-12-04 13:58:00.00" version="[null]" + project_id="2" + parent_snapshot_id="11" root_project_id="[null]" root_snapshot_id="11" status="U" islast="false" + path="[null]"/> + + <snapshots depth="[null]" id="13" scope="DIR" qualifier="PAC" created_at="2008-12-04 13:58:00.00" version="[null]" + project_id="3" + parent_snapshot_id="12" root_project_id="[null]" root_snapshot_id="11" status="U" islast="false" + path="[null]"/> + + <snapshots depth="[null]" id="14" scope="FIL" qualifier="CLA" created_at="2008-12-04 13:58:00.00" version="[null]" + project_id="4" + parent_snapshot_id="13" root_project_id="[null]" root_snapshot_id="11" status="U" islast="false" + path="[null]"/> +</dataset>
\ No newline at end of file |