aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEvgeny Mandrikov <mandrikov@gmail.com>2011-03-31 02:09:23 +0400
committerEvgeny Mandrikov <mandrikov@gmail.com>2011-03-31 16:06:17 +0400
commitc3d2ff43be4cfc704c4b7eb0ffe6d3bf935cfd47 (patch)
tree66010d65288eba7d4f9cde1799abcc4446b54fd7
parent839e764f272932b2a01450d7b3e2a97a4cf06746 (diff)
downloadsonarqube-c3d2ff43be4cfc704c4b7eb0ffe6d3bf935cfd47.tar.gz
sonarqube-c3d2ff43be4cfc704c4b7eb0ffe6d3bf935cfd47.zip
Fix crlf
-rw-r--r--sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresDaoTest/sharedFixture.xml44
-rw-r--r--sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresDaoTest/testDeleteAsyncMeasure-result.xml42
-rw-r--r--sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresDaoTest/testDeleteAsyncMeasure.xml50
-rw-r--r--sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresDaoTest/testDeleteAsyncMeasureSnapshots-result.xml20
-rw-r--r--sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresDaoTest/testDeleteAsyncMeasureSnapshots.xml20
-rw-r--r--sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresDaoTest/testGetAsyncMeasureSnapshotsFromSnapshotId.xml50
-rw-r--r--sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresDaoTest/testGetLastAsyncMeasureSnapshot.xml22
-rw-r--r--sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresDaoTest/testGetNextAsyncMeasureSnapshot.xml20
-rw-r--r--sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresDaoTest/testGetNextAsyncMeasureSnapshotsUntilDate.xml98
-rw-r--r--sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresDaoTest/testGetNextSnapshotsUntilDate.xml68
-rw-r--r--sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresDaoTest/testGetPreviousAsyncMeasureSnapshots.xml34
-rw-r--r--sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresDaoTest/testGetPreviousSnapshot.xml46
-rw-r--r--sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/addFutureSnapshot-result.xml54
-rw-r--r--sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/addFutureSnapshot.xml46
-rw-r--r--sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/addInvisibleMeasure-result.xml54
-rw-r--r--sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/addInvisibleMeasure.xml46
-rw-r--r--sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/assignAPastMeasureToNextSnapshotsWithDifferentMetric-result.xml72
-rw-r--r--sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/assignAPastMeasureToNextSnapshotsWithDifferentMetric.xml64
-rw-r--r--sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/assignLatestMeasuresToLastSnapshot-result.xml82
-rw-r--r--sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/assignLatestMeasuresToLastSnapshot.xml70
-rw-r--r--sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/assignLatestMeasuresWhenNoPreviousSnapshot-result.xml88
-rw-r--r--sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/assignLatestMeasuresWhenNoPreviousSnapshot.xml84
-rw-r--r--sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/assignMeasureToFutureSnapshotsWithDifferentMetric-result.xml116
-rw-r--r--sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/assignMeasureToFutureSnapshotsWithDifferentMetric.xml96
-rw-r--r--sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/assignMeasuresWhenNoPreviousSnapshot-result.xml46
-rw-r--r--sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/assignMeasuresWhenNoPreviousSnapshot.xml46
-rw-r--r--sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/assignNewMeasureToFutureSnapshots-result.xml86
-rw-r--r--sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/assignNewMeasureToFutureSnapshots.xml70
-rw-r--r--sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/assignNewMeasuresToLastSnapshot-result.xml84
-rw-r--r--sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/assignNewMeasuresToLastSnapshot.xml82
-rw-r--r--sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/assignPastMeasuresToPastSnapshot-result.xml92
-rw-r--r--sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/assignPastMeasuresToPastSnapshot.xml82
-rw-r--r--sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/deleteLastMeasure-result.xml58
-rw-r--r--sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/deleteLastMeasure.xml62
-rw-r--r--sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/deleteMeasure-result.xml80
-rw-r--r--sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/deleteMeasure.xml76
-rw-r--r--sonar-core/src/test/resources/org/sonar/jpa/dao/ProfilesDaoTest/shouldGetProfiles.xml12
-rw-r--r--sonar-core/src/test/resources/org/sonar/jpa/dao/RulesDaoTest/shouldDeleteActiveRules-result.xml36
-rw-r--r--sonar-core/src/test/resources/org/sonar/jpa/dao/RulesDaoTest/shouldDeleteActiveRules.xml44
-rw-r--r--sonar-core/src/test/resources/org/sonar/jpa/dao/RulesDaoTest/shouldGetActiveRules.xml36
-rw-r--r--sonar-core/src/test/resources/org/sonar/jpa/dao/RulesDaoTest/shouldGetRuleParams.xml36
-rw-r--r--sonar-core/src/test/resources/org/sonar/jpa/dao/RulesDaoTest/shouldGetRuleWithRuleKeyAndPluginKey.xml14
-rw-r--r--sonar-plugin-api/src/test/resources/META-INF/MANIFEST.MF12
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/views/components/_treemap_gradient.rhtml38
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/views/components/_treemap_set_default.html.erb8
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/views/layouts/_breadcrumb.html.erb50
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/views/setup/dbdown.rhtml40
-rwxr-xr-xsonar-server/src/main/webapp/WEB-INF/config/locales/defaults/sk.yml278
-rw-r--r--sonar-server/src/main/webapp/javascripts/prototip.js560
-rw-r--r--sonar-server/src/main/webapp/javascripts/tablekit.js1704
-rw-r--r--sonar-server/src/test/resources/org/sonar/server/platform/ServerImplTest/pom-with-empty-version.properties8
-rw-r--r--sonar-server/src/test/resources/org/sonar/server/platform/ServerImplTest/pom-without-version.properties8
52 files changed, 2567 insertions, 2567 deletions
diff --git a/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresDaoTest/sharedFixture.xml b/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresDaoTest/sharedFixture.xml
index 4fbd9f7d094..c748a030e3a 100644
--- a/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresDaoTest/sharedFixture.xml
+++ b/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresDaoTest/sharedFixture.xml
@@ -1,23 +1,23 @@
-<dataset>
-
- <metrics id="1" name="foo" val_type="INT" description="[null]" domain="[null]"
- short_name="" qualitative="false" user_managed="false"
- enabled="false" worst_value="[null]" optimized_best_value="[null]" best_value="[null]" direction="0" hidden="false"/>
- <metrics id="2" name="bar" val_type="INT" description="[null]" domain="[null]"
- short_name="" qualitative="false" user_managed="false"
- enabled="false" worst_value="[null]" optimized_best_value="[null]" best_value="[null]" direction="0" hidden="false"/>
- <metrics id="3" name="boo" val_type="INT" description="[null]" domain="[null]"
- short_name="" qualitative="false" user_managed="false"
- enabled="false" 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="mygroup2:myartifact" name="[null]"
- root_id="[null]"
- description="[null]"
- enabled="true" language="java" copy_resource_id="[null]"/>
-
+<dataset>
+
+ <metrics id="1" name="foo" val_type="INT" description="[null]" domain="[null]"
+ short_name="" qualitative="false" user_managed="false"
+ enabled="false" worst_value="[null]" optimized_best_value="[null]" best_value="[null]" direction="0" hidden="false"/>
+ <metrics id="2" name="bar" val_type="INT" description="[null]" domain="[null]"
+ short_name="" qualitative="false" user_managed="false"
+ enabled="false" worst_value="[null]" optimized_best_value="[null]" best_value="[null]" direction="0" hidden="false"/>
+ <metrics id="3" name="boo" val_type="INT" description="[null]" domain="[null]"
+ short_name="" qualitative="false" user_managed="false"
+ enabled="false" 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="mygroup2:myartifact" name="[null]"
+ root_id="[null]"
+ description="[null]"
+ enabled="true" language="java" copy_resource_id="[null]"/>
+
</dataset> \ No newline at end of file
diff --git a/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresDaoTest/testDeleteAsyncMeasure-result.xml b/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresDaoTest/testDeleteAsyncMeasure-result.xml
index ceb6a73c68c..1905e69d94e 100644
--- a/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresDaoTest/testDeleteAsyncMeasure-result.xml
+++ b/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresDaoTest/testDeleteAsyncMeasure-result.xml
@@ -1,22 +1,22 @@
-<dataset>
-
- <!--<project_measures characteristic_id="[null]" url="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]" rule_priority="[null]" alert_text="[null]" id="1" project_id="1" metric_id="1" value="1" measure_date="2008-12-03 08:00:00.00" rule_id="[null]"-->
- <!--snapshot_id="[null]" rules_category_id="[null]" text_value="[null]" tendency="[null]"/>-->
- <project_measures characteristic_id="[null]" url="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]"
- rule_priority="[null]"
- alert_text="[null]" id="2" project_id="1" metric_id="1" value="5"
- measure_date="2008-12-06 08:00:00.00" rule_id="[null]"
- snapshot_id="[null]" rules_category_id="[null]" text_value="[null]" tendency="[null]"
- alert_status="[null]" description="[null]"/>
-
-
- <!--<async_measure_snapshots id="1" project_measure_id="1" snapshot_id="1" measure_date="2008-12-03 08:00:00.00"-->
- <!--snapshot_date="2008-12-03 12:00:00.00" metric_id="1" project_id="1"/>-->
- <!--<async_measure_snapshots id="2" project_measure_id="1" snapshot_id="2" measure_date="2008-12-03 08:00:00.00"-->
- <!--snapshot_date="2008-12-04 12:00:00.00" metric_id="1" project_id="1"/>-->
- <!--<async_measure_snapshots id="3" project_measure_id="1" snapshot_id="3" measure_date="2008-12-03 08:00:00.00"-->
- <!--snapshot_date="2008-12-05 12:00:00.00" metric_id="1" project_id="1"/>-->
- <async_measure_snapshots id="4" project_measure_id="2" snapshot_id="4" measure_date="2008-12-06 08:00:00.00"
- snapshot_date="2008-12-06 12:00:00.00" metric_id="1" project_id="1"/>
-
+<dataset>
+
+ <!--<project_measures characteristic_id="[null]" url="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]" rule_priority="[null]" alert_text="[null]" id="1" project_id="1" metric_id="1" value="1" measure_date="2008-12-03 08:00:00.00" rule_id="[null]"-->
+ <!--snapshot_id="[null]" rules_category_id="[null]" text_value="[null]" tendency="[null]"/>-->
+ <project_measures characteristic_id="[null]" url="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]"
+ rule_priority="[null]"
+ alert_text="[null]" id="2" project_id="1" metric_id="1" value="5"
+ measure_date="2008-12-06 08:00:00.00" rule_id="[null]"
+ snapshot_id="[null]" rules_category_id="[null]" text_value="[null]" tendency="[null]"
+ alert_status="[null]" description="[null]"/>
+
+
+ <!--<async_measure_snapshots id="1" project_measure_id="1" snapshot_id="1" measure_date="2008-12-03 08:00:00.00"-->
+ <!--snapshot_date="2008-12-03 12:00:00.00" metric_id="1" project_id="1"/>-->
+ <!--<async_measure_snapshots id="2" project_measure_id="1" snapshot_id="2" measure_date="2008-12-03 08:00:00.00"-->
+ <!--snapshot_date="2008-12-04 12:00:00.00" metric_id="1" project_id="1"/>-->
+ <!--<async_measure_snapshots id="3" project_measure_id="1" snapshot_id="3" measure_date="2008-12-03 08:00:00.00"-->
+ <!--snapshot_date="2008-12-05 12:00:00.00" metric_id="1" project_id="1"/>-->
+ <async_measure_snapshots id="4" project_measure_id="2" snapshot_id="4" measure_date="2008-12-06 08:00:00.00"
+ snapshot_date="2008-12-06 12:00:00.00" metric_id="1" project_id="1"/>
+
</dataset> \ No newline at end of file
diff --git a/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresDaoTest/testDeleteAsyncMeasure.xml b/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresDaoTest/testDeleteAsyncMeasure.xml
index e4e1e9f289d..a31a3a3103f 100644
--- a/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresDaoTest/testDeleteAsyncMeasure.xml
+++ b/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresDaoTest/testDeleteAsyncMeasure.xml
@@ -1,26 +1,26 @@
-<dataset>
-
- <project_measures characteristic_id="[null]" url="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]"
- rule_priority="[null]"
- alert_text="[null]" id="1" project_id="1" metric_id="1" value="1"
- measure_date="2008-12-03 08:00:00.00" rule_id="[null]"
- snapshot_id="[null]" rules_category_id="[null]" text_value="[null]" tendency="[null]"
- alert_status="[null]" description="[null]"/>
- <project_measures characteristic_id="[null]" url="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]"
- rule_priority="[null]"
- alert_text="[null]" id="2" project_id="1" metric_id="1" value="5"
- measure_date="2008-12-06 08:00:00.00" rule_id="[null]"
- snapshot_id="[null]" rules_category_id="[null]" text_value="[null]" tendency="[null]"
- alert_status="[null]" description="[null]"/>
-
-
- <async_measure_snapshots id="1" project_measure_id="1" snapshot_id="1" measure_date="2008-12-03 08:00:00.00"
- snapshot_date="2008-12-03 12:00:00.00" metric_id="1" project_id="1"/>
- <async_measure_snapshots id="2" project_measure_id="1" snapshot_id="2" measure_date="2008-12-03 08:00:00.00"
- snapshot_date="2008-12-04 12:00:00.00" metric_id="1" project_id="1"/>
- <async_measure_snapshots id="3" project_measure_id="1" snapshot_id="3" measure_date="2008-12-03 08:00:00.00"
- snapshot_date="2008-12-05 12:00:00.00" metric_id="1" project_id="1"/>
- <async_measure_snapshots id="4" project_measure_id="2" snapshot_id="4" measure_date="2008-12-06 08:00:00.00"
- snapshot_date="2008-12-06 12:00:00.00" metric_id="1" project_id="1"/>
-
+<dataset>
+
+ <project_measures characteristic_id="[null]" url="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]"
+ rule_priority="[null]"
+ alert_text="[null]" id="1" project_id="1" metric_id="1" value="1"
+ measure_date="2008-12-03 08:00:00.00" rule_id="[null]"
+ snapshot_id="[null]" rules_category_id="[null]" text_value="[null]" tendency="[null]"
+ alert_status="[null]" description="[null]"/>
+ <project_measures characteristic_id="[null]" url="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]"
+ rule_priority="[null]"
+ alert_text="[null]" id="2" project_id="1" metric_id="1" value="5"
+ measure_date="2008-12-06 08:00:00.00" rule_id="[null]"
+ snapshot_id="[null]" rules_category_id="[null]" text_value="[null]" tendency="[null]"
+ alert_status="[null]" description="[null]"/>
+
+
+ <async_measure_snapshots id="1" project_measure_id="1" snapshot_id="1" measure_date="2008-12-03 08:00:00.00"
+ snapshot_date="2008-12-03 12:00:00.00" metric_id="1" project_id="1"/>
+ <async_measure_snapshots id="2" project_measure_id="1" snapshot_id="2" measure_date="2008-12-03 08:00:00.00"
+ snapshot_date="2008-12-04 12:00:00.00" metric_id="1" project_id="1"/>
+ <async_measure_snapshots id="3" project_measure_id="1" snapshot_id="3" measure_date="2008-12-03 08:00:00.00"
+ snapshot_date="2008-12-05 12:00:00.00" metric_id="1" project_id="1"/>
+ <async_measure_snapshots id="4" project_measure_id="2" snapshot_id="4" measure_date="2008-12-06 08:00:00.00"
+ snapshot_date="2008-12-06 12:00:00.00" metric_id="1" project_id="1"/>
+
</dataset> \ No newline at end of file
diff --git a/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresDaoTest/testDeleteAsyncMeasureSnapshots-result.xml b/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresDaoTest/testDeleteAsyncMeasureSnapshots-result.xml
index ae9389c25b2..a9371f88cc4 100644
--- a/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresDaoTest/testDeleteAsyncMeasureSnapshots-result.xml
+++ b/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresDaoTest/testDeleteAsyncMeasureSnapshots-result.xml
@@ -1,11 +1,11 @@
-<dataset>
-
- <!--<async_measure_snapshots id="1" project_measure_id="1" snapshot_id="[null]" measure_date="2008-12-03 08:00:00.00"-->
- <!--snapshot_date="[null]" metric_id="1" project_id="1"/>-->
- <!--<async_measure_snapshots id="2" project_measure_id="1" snapshot_id="2" measure_date="2008-12-03 08:00:00.00"-->
- <!--snapshot_date="[null]" metric_id="1" project_id="1"/>-->
- <!--<async_measure_snapshots id="3" project_measure_id="1" snapshot_id="[null]" measure_date="2008-12-03 08:00:00.00"-->
- <!--snapshot_date="[null]" metric_id="1" project_id="1"/>-->
- <async_measure_snapshots id="4" project_measure_id="2" snapshot_id="[null]" measure_date="2008-12-03 08:00:00.00"
- snapshot_date="[null]" metric_id="2" project_id="1"/>
+<dataset>
+
+ <!--<async_measure_snapshots id="1" project_measure_id="1" snapshot_id="[null]" measure_date="2008-12-03 08:00:00.00"-->
+ <!--snapshot_date="[null]" metric_id="1" project_id="1"/>-->
+ <!--<async_measure_snapshots id="2" project_measure_id="1" snapshot_id="2" measure_date="2008-12-03 08:00:00.00"-->
+ <!--snapshot_date="[null]" metric_id="1" project_id="1"/>-->
+ <!--<async_measure_snapshots id="3" project_measure_id="1" snapshot_id="[null]" measure_date="2008-12-03 08:00:00.00"-->
+ <!--snapshot_date="[null]" metric_id="1" project_id="1"/>-->
+ <async_measure_snapshots id="4" project_measure_id="2" snapshot_id="[null]" measure_date="2008-12-03 08:00:00.00"
+ snapshot_date="[null]" metric_id="2" project_id="1"/>
</dataset> \ No newline at end of file
diff --git a/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresDaoTest/testDeleteAsyncMeasureSnapshots.xml b/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresDaoTest/testDeleteAsyncMeasureSnapshots.xml
index 55b7e7ecc0f..cf0a5f96390 100644
--- a/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresDaoTest/testDeleteAsyncMeasureSnapshots.xml
+++ b/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresDaoTest/testDeleteAsyncMeasureSnapshots.xml
@@ -1,11 +1,11 @@
-<dataset>
-
- <async_measure_snapshots id="1" project_measure_id="1" snapshot_id="[null]" measure_date="2008-12-03 08:00:00.00"
- snapshot_date="[null]" metric_id="1" project_id="1"/>
- <async_measure_snapshots id="2" project_measure_id="1" snapshot_id="2" measure_date="2008-12-03 08:00:00.00"
- snapshot_date="[null]" metric_id="1" project_id="1"/>
- <async_measure_snapshots id="3" project_measure_id="1" snapshot_id="[null]" measure_date="2008-12-03 08:00:00.00"
- snapshot_date="[null]" metric_id="1" project_id="1"/>
- <async_measure_snapshots id="4" project_measure_id="2" snapshot_id="[null]" measure_date="2008-12-03 08:00:00.00"
- snapshot_date="[null]" metric_id="2" project_id="1"/>
+<dataset>
+
+ <async_measure_snapshots id="1" project_measure_id="1" snapshot_id="[null]" measure_date="2008-12-03 08:00:00.00"
+ snapshot_date="[null]" metric_id="1" project_id="1"/>
+ <async_measure_snapshots id="2" project_measure_id="1" snapshot_id="2" measure_date="2008-12-03 08:00:00.00"
+ snapshot_date="[null]" metric_id="1" project_id="1"/>
+ <async_measure_snapshots id="3" project_measure_id="1" snapshot_id="[null]" measure_date="2008-12-03 08:00:00.00"
+ snapshot_date="[null]" metric_id="1" project_id="1"/>
+ <async_measure_snapshots id="4" project_measure_id="2" snapshot_id="[null]" measure_date="2008-12-03 08:00:00.00"
+ snapshot_date="[null]" metric_id="2" project_id="1"/>
</dataset> \ No newline at end of file
diff --git a/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresDaoTest/testGetAsyncMeasureSnapshotsFromSnapshotId.xml b/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresDaoTest/testGetAsyncMeasureSnapshotsFromSnapshotId.xml
index e5d1c4892a0..f83aff294c3 100644
--- a/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresDaoTest/testGetAsyncMeasureSnapshotsFromSnapshotId.xml
+++ b/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresDaoTest/testGetAsyncMeasureSnapshotsFromSnapshotId.xml
@@ -1,26 +1,26 @@
-<dataset>
-
- <snapshots period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="1" scope="PRJ" qualifier="TRK" created_at="2008-12-04 12:00: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]"/>
-
- <project_measures characteristic_id="[null]" url="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]"
- rule_priority="[null]"
- alert_text="[null]" id="1" project_id="1" metric_id="1" value="1"
- measure_date="2008-12-03 18:00:00.00" rule_id="[null]"
- snapshot_id="[null]" rules_category_id="[null]" text_value="[null]" tendency="[null]"
- description="[null]"/>
- <project_measures characteristic_id="[null]" url="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]"
- rule_priority="[null]"
- alert_text="[null]" id="2" project_id="1" metric_id="2" value="2"
- measure_date="2008-12-04 08:00:00.00" rule_id="[null]"
- snapshot_id="[null]" rules_category_id="[null]" text_value="[null]" tendency="[null]"
- description="[null]"/>
-
- <async_measure_snapshots id="1" project_measure_id="1" snapshot_id="1" measure_date="2008-12-03 18:00:00.00"
- snapshot_date="2008-12-04 12:00:00.00" metric_id="1" project_id="1"/>
- <async_measure_snapshots id="2" project_measure_id="2" snapshot_id="1" measure_date="2008-12-04 08:00:00.00"
- snapshot_date="2008-12-04 12:00:00.00" metric_id="2" project_id="1"/>
-
+<dataset>
+
+ <snapshots period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="1" scope="PRJ" qualifier="TRK" created_at="2008-12-04 12:00: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]"/>
+
+ <project_measures characteristic_id="[null]" url="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]"
+ rule_priority="[null]"
+ alert_text="[null]" id="1" project_id="1" metric_id="1" value="1"
+ measure_date="2008-12-03 18:00:00.00" rule_id="[null]"
+ snapshot_id="[null]" rules_category_id="[null]" text_value="[null]" tendency="[null]"
+ description="[null]"/>
+ <project_measures characteristic_id="[null]" url="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]"
+ rule_priority="[null]"
+ alert_text="[null]" id="2" project_id="1" metric_id="2" value="2"
+ measure_date="2008-12-04 08:00:00.00" rule_id="[null]"
+ snapshot_id="[null]" rules_category_id="[null]" text_value="[null]" tendency="[null]"
+ description="[null]"/>
+
+ <async_measure_snapshots id="1" project_measure_id="1" snapshot_id="1" measure_date="2008-12-03 18:00:00.00"
+ snapshot_date="2008-12-04 12:00:00.00" metric_id="1" project_id="1"/>
+ <async_measure_snapshots id="2" project_measure_id="2" snapshot_id="1" measure_date="2008-12-04 08:00:00.00"
+ snapshot_date="2008-12-04 12:00:00.00" metric_id="2" project_id="1"/>
+
</dataset> \ No newline at end of file
diff --git a/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresDaoTest/testGetLastAsyncMeasureSnapshot.xml b/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresDaoTest/testGetLastAsyncMeasureSnapshot.xml
index 7adc403b439..c449c6eef14 100644
--- a/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresDaoTest/testGetLastAsyncMeasureSnapshot.xml
+++ b/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresDaoTest/testGetLastAsyncMeasureSnapshot.xml
@@ -1,12 +1,12 @@
-<dataset>
-
- <async_measure_snapshots id="1" project_measure_id="1" snapshot_id="1" measure_date="2008-12-03 08:00:00.00"
- snapshot_date="2008-12-03 12:00:00.00" metric_id="1" project_id="1"/>
- <async_measure_snapshots id="2" project_measure_id="1" snapshot_id="2" measure_date="2008-12-04 08:00:00.00"
- snapshot_date="2008-12-04 12:00:00.00" metric_id="1" project_id="1"/>
- <async_measure_snapshots id="3" project_measure_id="1" snapshot_id="3" measure_date="2008-12-05 08:00:00.00"
- snapshot_date="2008-12-05 12:00:00.00" metric_id="1" project_id="1"/>
- <async_measure_snapshots id="4" project_measure_id="2" snapshot_id="4" measure_date="2008-12-06 08:00:00.00"
- snapshot_date="2008-12-06 12:00:00.00" metric_id="1" project_id="1"/>
-
+<dataset>
+
+ <async_measure_snapshots id="1" project_measure_id="1" snapshot_id="1" measure_date="2008-12-03 08:00:00.00"
+ snapshot_date="2008-12-03 12:00:00.00" metric_id="1" project_id="1"/>
+ <async_measure_snapshots id="2" project_measure_id="1" snapshot_id="2" measure_date="2008-12-04 08:00:00.00"
+ snapshot_date="2008-12-04 12:00:00.00" metric_id="1" project_id="1"/>
+ <async_measure_snapshots id="3" project_measure_id="1" snapshot_id="3" measure_date="2008-12-05 08:00:00.00"
+ snapshot_date="2008-12-05 12:00:00.00" metric_id="1" project_id="1"/>
+ <async_measure_snapshots id="4" project_measure_id="2" snapshot_id="4" measure_date="2008-12-06 08:00:00.00"
+ snapshot_date="2008-12-06 12:00:00.00" metric_id="1" project_id="1"/>
+
</dataset> \ No newline at end of file
diff --git a/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresDaoTest/testGetNextAsyncMeasureSnapshot.xml b/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresDaoTest/testGetNextAsyncMeasureSnapshot.xml
index 705cebd5ef7..baba9aad126 100644
--- a/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresDaoTest/testGetNextAsyncMeasureSnapshot.xml
+++ b/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresDaoTest/testGetNextAsyncMeasureSnapshot.xml
@@ -1,11 +1,11 @@
-<dataset>
-
- <async_measure_snapshots id="1" project_measure_id="1" snapshot_id="1" measure_date="2008-12-03 08:00:00.00"
- snapshot_date="2008-12-03 12:00:00.00" metric_id="1" project_id="1"/>
- <async_measure_snapshots id="2" project_measure_id="1" snapshot_id="2" measure_date="2008-12-04 08:00:00.00"
- snapshot_date="2008-12-04 12:00:00.00" metric_id="1" project_id="1"/>
- <async_measure_snapshots id="3" project_measure_id="1" snapshot_id="3" measure_date="2008-12-05 08:00:00.00"
- snapshot_date="2008-12-05 12:00:00.00" metric_id="1" project_id="1"/>
- <async_measure_snapshots id="4" project_measure_id="2" snapshot_id="4" measure_date="2008-12-06 08:00:00.00"
- snapshot_date="2008-12-06 12:00:00.00" metric_id="1" project_id="1"/>
+<dataset>
+
+ <async_measure_snapshots id="1" project_measure_id="1" snapshot_id="1" measure_date="2008-12-03 08:00:00.00"
+ snapshot_date="2008-12-03 12:00:00.00" metric_id="1" project_id="1"/>
+ <async_measure_snapshots id="2" project_measure_id="1" snapshot_id="2" measure_date="2008-12-04 08:00:00.00"
+ snapshot_date="2008-12-04 12:00:00.00" metric_id="1" project_id="1"/>
+ <async_measure_snapshots id="3" project_measure_id="1" snapshot_id="3" measure_date="2008-12-05 08:00:00.00"
+ snapshot_date="2008-12-05 12:00:00.00" metric_id="1" project_id="1"/>
+ <async_measure_snapshots id="4" project_measure_id="2" snapshot_id="4" measure_date="2008-12-06 08:00:00.00"
+ snapshot_date="2008-12-06 12:00:00.00" metric_id="1" project_id="1"/>
</dataset> \ No newline at end of file
diff --git a/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresDaoTest/testGetNextAsyncMeasureSnapshotsUntilDate.xml b/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresDaoTest/testGetNextAsyncMeasureSnapshotsUntilDate.xml
index 645a4f4ca05..ff8b246f66b 100644
--- a/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresDaoTest/testGetNextAsyncMeasureSnapshotsUntilDate.xml
+++ b/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresDaoTest/testGetNextAsyncMeasureSnapshotsUntilDate.xml
@@ -1,50 +1,50 @@
-<dataset>
-
- <snapshots period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="1" scope="PRJ" qualifier="TRK" created_at="2008-12-03 12:00: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 period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="2" scope="PRJ" qualifier="TRK" created_at="2008-12-04 12:00: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 period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="3" scope="PRJ" qualifier="TRK" created_at="2008-12-05 12:00: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 period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="4" scope="PRJ" qualifier="TRK" created_at="2008-12-06 12:00: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]"/>
-
- <project_measures characteristic_id="[null]" url="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]"
- rule_priority="[null]"
- alert_text="[null]" id="1" project_id="1" metric_id="1" value="1"
- measure_date="2008-12-03 08:00:00.00" rule_id="[null]"
- snapshot_id="[null]" rules_category_id="[null]" text_value="[null]" tendency="[null]"
- description="[null]"/>
- <project_measures characteristic_id="[null]" url="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]"
- rule_priority="[null]"
- alert_text="[null]" id="2" project_id="1" metric_id="1" value="5"
- measure_date="2008-12-06 08:00:00.00" rule_id="[null]"
- snapshot_id="[null]" rules_category_id="[null]" text_value="[null]" tendency="[null]"
- description="[null]"/>
- <!-- measure inserted on snapshot 2 -->
- <project_measures characteristic_id="[null]" url="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]"
- rule_priority="[null]"
- alert_text="[null]" id="3" project_id="1" metric_id="1" value="2"
- measure_date="2008-12-04 12:00:00.00" rule_id="[null]"
- snapshot_id="[null]" rules_category_id="[null]" text_value="[null]" tendency="[null]"
- description="[null]"/>
-
-
- <async_measure_snapshots id="1" project_measure_id="1" snapshot_id="1" measure_date="2008-12-03 08:00:00.00"
- snapshot_date="2008-12-03 12:00:00.00" metric_id="1" project_id="1"/>
- <async_measure_snapshots id="2" project_measure_id="1" snapshot_id="2" measure_date="2008-12-03 08:00:00.00"
- snapshot_date="2008-12-04 12:00:00.00" metric_id="1" project_id="1"/>
- <async_measure_snapshots id="3" project_measure_id="1" snapshot_id="3" measure_date="2008-12-03 08:00:00.00"
- snapshot_date="2008-12-05 12:00:00.00" metric_id="1" project_id="1"/>
- <async_measure_snapshots id="4" project_measure_id="2" snapshot_id="4" measure_date="2008-12-06 08:00:00.00"
- snapshot_date="2008-12-06 12:00:00.00" metric_id="1" project_id="1"/>
-
+<dataset>
+
+ <snapshots period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="1" scope="PRJ" qualifier="TRK" created_at="2008-12-03 12:00: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 period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="2" scope="PRJ" qualifier="TRK" created_at="2008-12-04 12:00: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 period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="3" scope="PRJ" qualifier="TRK" created_at="2008-12-05 12:00: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 period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="4" scope="PRJ" qualifier="TRK" created_at="2008-12-06 12:00: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]"/>
+
+ <project_measures characteristic_id="[null]" url="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]"
+ rule_priority="[null]"
+ alert_text="[null]" id="1" project_id="1" metric_id="1" value="1"
+ measure_date="2008-12-03 08:00:00.00" rule_id="[null]"
+ snapshot_id="[null]" rules_category_id="[null]" text_value="[null]" tendency="[null]"
+ description="[null]"/>
+ <project_measures characteristic_id="[null]" url="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]"
+ rule_priority="[null]"
+ alert_text="[null]" id="2" project_id="1" metric_id="1" value="5"
+ measure_date="2008-12-06 08:00:00.00" rule_id="[null]"
+ snapshot_id="[null]" rules_category_id="[null]" text_value="[null]" tendency="[null]"
+ description="[null]"/>
+ <!-- measure inserted on snapshot 2 -->
+ <project_measures characteristic_id="[null]" url="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]"
+ rule_priority="[null]"
+ alert_text="[null]" id="3" project_id="1" metric_id="1" value="2"
+ measure_date="2008-12-04 12:00:00.00" rule_id="[null]"
+ snapshot_id="[null]" rules_category_id="[null]" text_value="[null]" tendency="[null]"
+ description="[null]"/>
+
+
+ <async_measure_snapshots id="1" project_measure_id="1" snapshot_id="1" measure_date="2008-12-03 08:00:00.00"
+ snapshot_date="2008-12-03 12:00:00.00" metric_id="1" project_id="1"/>
+ <async_measure_snapshots id="2" project_measure_id="1" snapshot_id="2" measure_date="2008-12-03 08:00:00.00"
+ snapshot_date="2008-12-04 12:00:00.00" metric_id="1" project_id="1"/>
+ <async_measure_snapshots id="3" project_measure_id="1" snapshot_id="3" measure_date="2008-12-03 08:00:00.00"
+ snapshot_date="2008-12-05 12:00:00.00" metric_id="1" project_id="1"/>
+ <async_measure_snapshots id="4" project_measure_id="2" snapshot_id="4" measure_date="2008-12-06 08:00:00.00"
+ snapshot_date="2008-12-06 12:00:00.00" metric_id="1" project_id="1"/>
+
</dataset> \ No newline at end of file
diff --git a/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresDaoTest/testGetNextSnapshotsUntilDate.xml b/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresDaoTest/testGetNextSnapshotsUntilDate.xml
index 3f139ece550..096f1983d3b 100644
--- a/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresDaoTest/testGetNextSnapshotsUntilDate.xml
+++ b/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresDaoTest/testGetNextSnapshotsUntilDate.xml
@@ -1,35 +1,35 @@
-<dataset>
-
- <snapshots period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="1" scope="PRJ" qualifier="TRK" created_at="2008-12-03 12:00: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 period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="2" scope="PRJ" qualifier="TRK" created_at="2008-12-04 12:00: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 period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="3" scope="FIL" qualifier="CLA" created_at="2008-12-04 12:00:00.00" version="[null]"
- project_id="1"
- parent_snapshot_id="3" root_project_id="[null]" root_snapshot_id="3" status="P" islast="true"
- path="[null]"/>
- <snapshots period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="4" scope="PRJ" qualifier="TRK" created_at="2008-12-05 12:00: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 period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="5" scope="FIL" qualifier="CLA" created_at="2008-12-05 12:00:00.00" version="[null]"
- project_id="1"
- parent_snapshot_id="4" root_project_id="[null]" root_snapshot_id="4" status="P" islast="true"
- path="[null]"/>
- <snapshots period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="6" scope="PRJ" qualifier="TRK" created_at="2008-12-06 12:00: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]"/>
-
- <project_measures characteristic_id="[null]" url="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]"
- rule_priority="[null]"
- alert_text="[null]" id="1" project_id="1" metric_id="1" value="1"
- measure_date="2008-12-04 12:00:00.00" rule_id="[null]"
- snapshot_id="[null]" rules_category_id="[null]" text_value="[null]" tendency="[null]"
- description="[null]"/>
-
+<dataset>
+
+ <snapshots period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="1" scope="PRJ" qualifier="TRK" created_at="2008-12-03 12:00: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 period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="2" scope="PRJ" qualifier="TRK" created_at="2008-12-04 12:00: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 period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="3" scope="FIL" qualifier="CLA" created_at="2008-12-04 12:00:00.00" version="[null]"
+ project_id="1"
+ parent_snapshot_id="3" root_project_id="[null]" root_snapshot_id="3" status="P" islast="true"
+ path="[null]"/>
+ <snapshots period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="4" scope="PRJ" qualifier="TRK" created_at="2008-12-05 12:00: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 period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="5" scope="FIL" qualifier="CLA" created_at="2008-12-05 12:00:00.00" version="[null]"
+ project_id="1"
+ parent_snapshot_id="4" root_project_id="[null]" root_snapshot_id="4" status="P" islast="true"
+ path="[null]"/>
+ <snapshots period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="6" scope="PRJ" qualifier="TRK" created_at="2008-12-06 12:00: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]"/>
+
+ <project_measures characteristic_id="[null]" url="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]"
+ rule_priority="[null]"
+ alert_text="[null]" id="1" project_id="1" metric_id="1" value="1"
+ measure_date="2008-12-04 12:00:00.00" rule_id="[null]"
+ snapshot_id="[null]" rules_category_id="[null]" text_value="[null]" tendency="[null]"
+ description="[null]"/>
+
</dataset> \ No newline at end of file
diff --git a/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresDaoTest/testGetPreviousAsyncMeasureSnapshots.xml b/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresDaoTest/testGetPreviousAsyncMeasureSnapshots.xml
index b5a5b9dc96d..a268b957d61 100644
--- a/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresDaoTest/testGetPreviousAsyncMeasureSnapshots.xml
+++ b/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresDaoTest/testGetPreviousAsyncMeasureSnapshots.xml
@@ -1,18 +1,18 @@
-<dataset>
-
- <async_measure_snapshots id="1" project_measure_id="1" snapshot_id="1" measure_date="2008-12-03 08:00:00.00"
- snapshot_date="2008-12-03 12:00:00.00" metric_id="2" project_id="1"/>
- <async_measure_snapshots id="2" project_measure_id="2" snapshot_id="2" measure_date="2008-12-04 08:00:00.00"
- snapshot_date="2008-12-04 12:00:00.00" metric_id="2" project_id="1"/>
- <async_measure_snapshots id="3" project_measure_id="3" snapshot_id="3" measure_date="2008-12-05 08:00:00.00"
- snapshot_date="2008-12-05 12:00:00.00" metric_id="1" project_id="1"/>
- <async_measure_snapshots id="4" project_measure_id="4" snapshot_id="4" measure_date="2008-12-06 08:00:00.00"
- snapshot_date="2008-12-06 12:00:00.00" metric_id="1" project_id="1"/>
-
- <async_measure_snapshots id="5" project_measure_id="5" snapshot_id="[null]" measure_date="2008-12-07 08:00:00.00"
- snapshot_date="[null]" metric_id="2" project_id="1"/>
- <async_measure_snapshots id="6" project_measure_id="6" snapshot_id="[null]" measure_date="2008-12-08 08:00:00.00"
- snapshot_date="[null]" metric_id="1" project_id="1"/>
- <async_measure_snapshots id="7" project_measure_id="7" snapshot_id="[null]" measure_date="2008-12-09 08:00:00.00"
- snapshot_date="[null]" metric_id="1" project_id="1"/>
+<dataset>
+
+ <async_measure_snapshots id="1" project_measure_id="1" snapshot_id="1" measure_date="2008-12-03 08:00:00.00"
+ snapshot_date="2008-12-03 12:00:00.00" metric_id="2" project_id="1"/>
+ <async_measure_snapshots id="2" project_measure_id="2" snapshot_id="2" measure_date="2008-12-04 08:00:00.00"
+ snapshot_date="2008-12-04 12:00:00.00" metric_id="2" project_id="1"/>
+ <async_measure_snapshots id="3" project_measure_id="3" snapshot_id="3" measure_date="2008-12-05 08:00:00.00"
+ snapshot_date="2008-12-05 12:00:00.00" metric_id="1" project_id="1"/>
+ <async_measure_snapshots id="4" project_measure_id="4" snapshot_id="4" measure_date="2008-12-06 08:00:00.00"
+ snapshot_date="2008-12-06 12:00:00.00" metric_id="1" project_id="1"/>
+
+ <async_measure_snapshots id="5" project_measure_id="5" snapshot_id="[null]" measure_date="2008-12-07 08:00:00.00"
+ snapshot_date="[null]" metric_id="2" project_id="1"/>
+ <async_measure_snapshots id="6" project_measure_id="6" snapshot_id="[null]" measure_date="2008-12-08 08:00:00.00"
+ snapshot_date="[null]" metric_id="1" project_id="1"/>
+ <async_measure_snapshots id="7" project_measure_id="7" snapshot_id="[null]" measure_date="2008-12-09 08:00:00.00"
+ snapshot_date="[null]" metric_id="1" project_id="1"/>
</dataset> \ No newline at end of file
diff --git a/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresDaoTest/testGetPreviousSnapshot.xml b/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresDaoTest/testGetPreviousSnapshot.xml
index 1a0faac5232..115b532c994 100644
--- a/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresDaoTest/testGetPreviousSnapshot.xml
+++ b/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresDaoTest/testGetPreviousSnapshot.xml
@@ -1,24 +1,24 @@
-<dataset>
-
- <snapshots period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="1" scope="PRJ" qualifier="TRK" created_at="2008-12-03 12:00: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 period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="2" scope="DIR" qualifier="PAC" created_at="2008-12-03 12:00:00.00" version="[null]"
- project_id="1"
- parent_snapshot_id="1" root_project_id="[null]" root_snapshot_id="1" status="P" islast="true"
- path="[null]"/>
- <snapshots period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="3" scope="PRJ" qualifier="TRK" created_at="2008-12-04 12:00: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 period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="4" scope="PRJ" qualifier="TRK" created_at="2008-12-05 12:00: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 period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="5" scope="PRJ" qualifier="TRK" created_at="2008-12-03 12:00:00.00" version="[null]"
- project_id="2"
- parent_snapshot_id="[null]" root_project_id="[null]" root_snapshot_id="[null]" status="P" islast="true"
- path="[null]"/>
-
+<dataset>
+
+ <snapshots period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="1" scope="PRJ" qualifier="TRK" created_at="2008-12-03 12:00: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 period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="2" scope="DIR" qualifier="PAC" created_at="2008-12-03 12:00:00.00" version="[null]"
+ project_id="1"
+ parent_snapshot_id="1" root_project_id="[null]" root_snapshot_id="1" status="P" islast="true"
+ path="[null]"/>
+ <snapshots period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="3" scope="PRJ" qualifier="TRK" created_at="2008-12-04 12:00: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 period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="4" scope="PRJ" qualifier="TRK" created_at="2008-12-05 12:00: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 period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="5" scope="PRJ" qualifier="TRK" created_at="2008-12-03 12:00:00.00" version="[null]"
+ project_id="2"
+ parent_snapshot_id="[null]" root_project_id="[null]" root_snapshot_id="[null]" status="P" islast="true"
+ path="[null]"/>
+
</dataset> \ No newline at end of file
diff --git a/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/addFutureSnapshot-result.xml b/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/addFutureSnapshot-result.xml
index d898eaa01cc..7a12ccd2074 100644
--- a/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/addFutureSnapshot-result.xml
+++ b/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/addFutureSnapshot-result.xml
@@ -1,28 +1,28 @@
-<dataset>
-
- <snapshots period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="1" scope="PRJ" qualifier="TRK" created_at="2008-12-03 12:00: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]"/>
-
- <!-- Assigned to first sanspshot -->
- <project_measures characteristic_id="[null]" url="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]"
- rule_priority="[null]"
- alert_text="[null]" id="1" project_id="1" metric_id="1" value="1"
- measure_date="2008-12-02 12:00:00.00" rule_id="[null]"
- snapshot_id="[null]" rules_category_id="[null]" text_value="[null]" tendency="[null]"/>
- <!-- New measure, after last snapshot -->
- <project_measures characteristic_id="[null]" url="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]"
- rule_priority="[null]"
- alert_text="[null]" id="2" project_id="1" metric_id="1" value="5"
- measure_date="2008-12-04 12:00:00.00" rule_id="[null]"
- snapshot_id="[null]" rules_category_id="[null]" text_value="[null]" tendency="[null]"/>
-
- <async_measure_snapshots id="1" project_measure_id="1" snapshot_id="1" measure_date="2008-12-02 12:00:00.00"
- snapshot_date="2008-12-03 12:00:00.00" metric_id="1" project_id="1"/>
-
- <!-- No snapshot attached -->
- <async_measure_snapshots id="2" project_measure_id="2" snapshot_id="[null]" measure_date="2008-12-04 12:00:00.00"
- snapshot_date="[null]" metric_id="1" project_id="1"/>
-
+<dataset>
+
+ <snapshots period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="1" scope="PRJ" qualifier="TRK" created_at="2008-12-03 12:00: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]"/>
+
+ <!-- Assigned to first sanspshot -->
+ <project_measures characteristic_id="[null]" url="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]"
+ rule_priority="[null]"
+ alert_text="[null]" id="1" project_id="1" metric_id="1" value="1"
+ measure_date="2008-12-02 12:00:00.00" rule_id="[null]"
+ snapshot_id="[null]" rules_category_id="[null]" text_value="[null]" tendency="[null]"/>
+ <!-- New measure, after last snapshot -->
+ <project_measures characteristic_id="[null]" url="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]"
+ rule_priority="[null]"
+ alert_text="[null]" id="2" project_id="1" metric_id="1" value="5"
+ measure_date="2008-12-04 12:00:00.00" rule_id="[null]"
+ snapshot_id="[null]" rules_category_id="[null]" text_value="[null]" tendency="[null]"/>
+
+ <async_measure_snapshots id="1" project_measure_id="1" snapshot_id="1" measure_date="2008-12-02 12:00:00.00"
+ snapshot_date="2008-12-03 12:00:00.00" metric_id="1" project_id="1"/>
+
+ <!-- No snapshot attached -->
+ <async_measure_snapshots id="2" project_measure_id="2" snapshot_id="[null]" measure_date="2008-12-04 12:00:00.00"
+ snapshot_date="[null]" metric_id="1" project_id="1"/>
+
</dataset> \ No newline at end of file
diff --git a/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/addFutureSnapshot.xml b/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/addFutureSnapshot.xml
index 453e0ed20ba..4c2bea917dd 100644
--- a/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/addFutureSnapshot.xml
+++ b/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/addFutureSnapshot.xml
@@ -1,24 +1,24 @@
-<dataset>
-
- <snapshots period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="1" scope="PRJ" qualifier="TRK" created_at="2008-12-03 12:00: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]"/>
-
- <!-- Assigned to first sanspshot -->
- <project_measures characteristic_id="[null]" url="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]"
- rule_priority="[null]"
- alert_text="[null]" id="1" project_id="1" metric_id="1" value="1"
- measure_date="2008-12-02 12:00:00.00" rule_id="[null]"
- snapshot_id="[null]" rules_category_id="[null]" text_value="[null]" tendency="[null]"/>
- <!-- New measure, after last snapshot -->
- <project_measures characteristic_id="[null]" url="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]"
- rule_priority="[null]"
- alert_text="[null]" id="2" project_id="1" metric_id="1" value="5"
- measure_date="2008-12-04 12:00:00.00" rule_id="[null]"
- snapshot_id="[null]" rules_category_id="[null]" text_value="[null]" tendency="[null]"/>
-
- <async_measure_snapshots id="1" project_measure_id="1" snapshot_id="1" measure_date="2008-12-02 12:00:00.00"
- snapshot_date="2008-12-03 12:00:00.00" metric_id="1" project_id="1"/>
-
+<dataset>
+
+ <snapshots period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="1" scope="PRJ" qualifier="TRK" created_at="2008-12-03 12:00: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]"/>
+
+ <!-- Assigned to first sanspshot -->
+ <project_measures characteristic_id="[null]" url="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]"
+ rule_priority="[null]"
+ alert_text="[null]" id="1" project_id="1" metric_id="1" value="1"
+ measure_date="2008-12-02 12:00:00.00" rule_id="[null]"
+ snapshot_id="[null]" rules_category_id="[null]" text_value="[null]" tendency="[null]"/>
+ <!-- New measure, after last snapshot -->
+ <project_measures characteristic_id="[null]" url="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]"
+ rule_priority="[null]"
+ alert_text="[null]" id="2" project_id="1" metric_id="1" value="5"
+ measure_date="2008-12-04 12:00:00.00" rule_id="[null]"
+ snapshot_id="[null]" rules_category_id="[null]" text_value="[null]" tendency="[null]"/>
+
+ <async_measure_snapshots id="1" project_measure_id="1" snapshot_id="1" measure_date="2008-12-02 12:00:00.00"
+ snapshot_date="2008-12-03 12:00:00.00" metric_id="1" project_id="1"/>
+
</dataset> \ No newline at end of file
diff --git a/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/addInvisibleMeasure-result.xml b/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/addInvisibleMeasure-result.xml
index 64013773824..f10b82f86cd 100644
--- a/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/addInvisibleMeasure-result.xml
+++ b/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/addInvisibleMeasure-result.xml
@@ -1,28 +1,28 @@
-<dataset>
-
- <snapshots period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="1" scope="PRJ" qualifier="TRK" created_at="2008-12-03 12:00: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]"/>
-
- <!-- Assigned to first sanspshot -->
- <project_measures characteristic_id="[null]" url="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]"
- rule_priority="[null]"
- alert_text="[null]" id="1" project_id="1" metric_id="1" value="1"
- measure_date="2008-12-02 12:00:00.00" rule_id="[null]"
- snapshot_id="[null]" rules_category_id="[null]" text_value="[null]" tendency="[null]"/>
- <!-- New measure, just before first measure -->
- <project_measures characteristic_id="[null]" url="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]"
- rule_priority="[null]"
- alert_text="[null]" id="2" project_id="1" metric_id="1" value="50"
- measure_date="2008-12-02 08:00:00.00" rule_id="[null]"
- snapshot_id="[null]" rules_category_id="[null]" text_value="[null]" tendency="[null]"/>
-
- <async_measure_snapshots id="1" project_measure_id="1" snapshot_id="1" measure_date="2008-12-02 12:00:00.00"
- snapshot_date="2008-12-03 12:00:00.00" metric_id="1" project_id="1"/>
-
- <!-- No snapshot attached -->
- <async_measure_snapshots id="2" project_measure_id="2" snapshot_id="[null]" measure_date="2008-12-02 08:00:00.00"
- snapshot_date="[null]" metric_id="1" project_id="1"/>
-
+<dataset>
+
+ <snapshots period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="1" scope="PRJ" qualifier="TRK" created_at="2008-12-03 12:00: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]"/>
+
+ <!-- Assigned to first sanspshot -->
+ <project_measures characteristic_id="[null]" url="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]"
+ rule_priority="[null]"
+ alert_text="[null]" id="1" project_id="1" metric_id="1" value="1"
+ measure_date="2008-12-02 12:00:00.00" rule_id="[null]"
+ snapshot_id="[null]" rules_category_id="[null]" text_value="[null]" tendency="[null]"/>
+ <!-- New measure, just before first measure -->
+ <project_measures characteristic_id="[null]" url="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]"
+ rule_priority="[null]"
+ alert_text="[null]" id="2" project_id="1" metric_id="1" value="50"
+ measure_date="2008-12-02 08:00:00.00" rule_id="[null]"
+ snapshot_id="[null]" rules_category_id="[null]" text_value="[null]" tendency="[null]"/>
+
+ <async_measure_snapshots id="1" project_measure_id="1" snapshot_id="1" measure_date="2008-12-02 12:00:00.00"
+ snapshot_date="2008-12-03 12:00:00.00" metric_id="1" project_id="1"/>
+
+ <!-- No snapshot attached -->
+ <async_measure_snapshots id="2" project_measure_id="2" snapshot_id="[null]" measure_date="2008-12-02 08:00:00.00"
+ snapshot_date="[null]" metric_id="1" project_id="1"/>
+
</dataset> \ No newline at end of file
diff --git a/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/addInvisibleMeasure.xml b/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/addInvisibleMeasure.xml
index c21c79b33cc..bca00e33772 100644
--- a/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/addInvisibleMeasure.xml
+++ b/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/addInvisibleMeasure.xml
@@ -1,24 +1,24 @@
-<dataset>
-
- <snapshots period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="1" scope="PRJ" qualifier="TRK" created_at="2008-12-03 12:00: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]"/>
-
- <!-- Assigned to first sanspshot -->
- <project_measures characteristic_id="[null]" url="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]"
- rule_priority="[null]"
- alert_text="[null]" id="1" project_id="1" metric_id="1" value="1"
- measure_date="2008-12-02 12:00:00.00" rule_id="[null]"
- snapshot_id="[null]" rules_category_id="[null]" text_value="[null]" tendency="[null]"/>
- <!-- New measure, just before first measure -->
- <project_measures characteristic_id="[null]" url="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]"
- rule_priority="[null]"
- alert_text="[null]" id="2" project_id="1" metric_id="1" value="50"
- measure_date="2008-12-02 08:00:00.00" rule_id="[null]"
- snapshot_id="[null]" rules_category_id="[null]" text_value="[null]" tendency="[null]"/>
-
- <async_measure_snapshots id="1" project_measure_id="1" snapshot_id="1" measure_date="2008-12-02 12:00:00.00"
- snapshot_date="2008-12-03 12:00:00.00" metric_id="1" project_id="1"/>
-
+<dataset>
+
+ <snapshots period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="1" scope="PRJ" qualifier="TRK" created_at="2008-12-03 12:00: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]"/>
+
+ <!-- Assigned to first sanspshot -->
+ <project_measures characteristic_id="[null]" url="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]"
+ rule_priority="[null]"
+ alert_text="[null]" id="1" project_id="1" metric_id="1" value="1"
+ measure_date="2008-12-02 12:00:00.00" rule_id="[null]"
+ snapshot_id="[null]" rules_category_id="[null]" text_value="[null]" tendency="[null]"/>
+ <!-- New measure, just before first measure -->
+ <project_measures characteristic_id="[null]" url="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]"
+ rule_priority="[null]"
+ alert_text="[null]" id="2" project_id="1" metric_id="1" value="50"
+ measure_date="2008-12-02 08:00:00.00" rule_id="[null]"
+ snapshot_id="[null]" rules_category_id="[null]" text_value="[null]" tendency="[null]"/>
+
+ <async_measure_snapshots id="1" project_measure_id="1" snapshot_id="1" measure_date="2008-12-02 12:00:00.00"
+ snapshot_date="2008-12-03 12:00:00.00" metric_id="1" project_id="1"/>
+
</dataset> \ No newline at end of file
diff --git a/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/assignAPastMeasureToNextSnapshotsWithDifferentMetric-result.xml b/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/assignAPastMeasureToNextSnapshotsWithDifferentMetric-result.xml
index ed05c5cdfb7..7d20af58577 100644
--- a/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/assignAPastMeasureToNextSnapshotsWithDifferentMetric-result.xml
+++ b/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/assignAPastMeasureToNextSnapshotsWithDifferentMetric-result.xml
@@ -1,37 +1,37 @@
-<dataset>
-
- <snapshots period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="1" scope="PRJ" qualifier="TRK" created_at="2008-12-03 12:00: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 period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="2" scope="PRJ" qualifier="TRK" created_at="2008-12-04 12:00: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 period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="3" scope="PRJ" qualifier="TRK" created_at="2008-12-05 12:00: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]"/>
-
- <!-- Assigned to snapshot 3 -->
- <project_measures characteristic_id="[null]" url="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]"
- rule_priority="[null]"
- alert_text="[null]" id="1" project_id="1" metric_id="1" value="1"
- measure_date="2008-12-05 08:00:00.00" rule_id="[null]"
- snapshot_id="[null]" rules_category_id="[null]" text_value="[null]" tendency="[null]"/>
- <!-- Past measure inserted, have to be assigned only to snapshot 1 and 2 -->
- <project_measures characteristic_id="[null]" url="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]"
- rule_priority="[null]"
- alert_text="[null]" id="2" project_id="1" metric_id="1" value="8"
- measure_date="2008-12-03 08:00:00.00" rule_id="[null]"
- snapshot_id="[null]" rules_category_id="[null]" text_value="[null]" tendency="[null]"/>
-
-
- <async_measure_snapshots id="1" project_measure_id="1" snapshot_id="3" measure_date="2008-12-05 08:00:00.00"
- snapshot_date="2008-12-05 12:00:00.00" metric_id="1" project_id="1"/>
- <async_measure_snapshots id="2" project_measure_id="2" snapshot_id="1" measure_date="2008-12-03 08:00:00.00"
- snapshot_date="2008-12-03 12:00:00.00" metric_id="1" project_id="1"/>
- <async_measure_snapshots id="3" project_measure_id="2" snapshot_id="2" measure_date="2008-12-03 08:00:00.00"
- snapshot_date="2008-12-04 12:00:00.00" metric_id="1" project_id="1"/>
-
+<dataset>
+
+ <snapshots period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="1" scope="PRJ" qualifier="TRK" created_at="2008-12-03 12:00: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 period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="2" scope="PRJ" qualifier="TRK" created_at="2008-12-04 12:00: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 period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="3" scope="PRJ" qualifier="TRK" created_at="2008-12-05 12:00: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]"/>
+
+ <!-- Assigned to snapshot 3 -->
+ <project_measures characteristic_id="[null]" url="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]"
+ rule_priority="[null]"
+ alert_text="[null]" id="1" project_id="1" metric_id="1" value="1"
+ measure_date="2008-12-05 08:00:00.00" rule_id="[null]"
+ snapshot_id="[null]" rules_category_id="[null]" text_value="[null]" tendency="[null]"/>
+ <!-- Past measure inserted, have to be assigned only to snapshot 1 and 2 -->
+ <project_measures characteristic_id="[null]" url="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]"
+ rule_priority="[null]"
+ alert_text="[null]" id="2" project_id="1" metric_id="1" value="8"
+ measure_date="2008-12-03 08:00:00.00" rule_id="[null]"
+ snapshot_id="[null]" rules_category_id="[null]" text_value="[null]" tendency="[null]"/>
+
+
+ <async_measure_snapshots id="1" project_measure_id="1" snapshot_id="3" measure_date="2008-12-05 08:00:00.00"
+ snapshot_date="2008-12-05 12:00:00.00" metric_id="1" project_id="1"/>
+ <async_measure_snapshots id="2" project_measure_id="2" snapshot_id="1" measure_date="2008-12-03 08:00:00.00"
+ snapshot_date="2008-12-03 12:00:00.00" metric_id="1" project_id="1"/>
+ <async_measure_snapshots id="3" project_measure_id="2" snapshot_id="2" measure_date="2008-12-03 08:00:00.00"
+ snapshot_date="2008-12-04 12:00:00.00" metric_id="1" project_id="1"/>
+
</dataset> \ No newline at end of file
diff --git a/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/assignAPastMeasureToNextSnapshotsWithDifferentMetric.xml b/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/assignAPastMeasureToNextSnapshotsWithDifferentMetric.xml
index f626a2ecdb2..74d8837d110 100644
--- a/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/assignAPastMeasureToNextSnapshotsWithDifferentMetric.xml
+++ b/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/assignAPastMeasureToNextSnapshotsWithDifferentMetric.xml
@@ -1,33 +1,33 @@
-<dataset>
-
- <snapshots period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="1" scope="PRJ" qualifier="TRK" created_at="2008-12-03 12:00: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 period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="2" scope="PRJ" qualifier="TRK" created_at="2008-12-04 12:00: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 period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="3" scope="PRJ" qualifier="TRK" created_at="2008-12-05 12:00: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]"/>
-
- <!-- Assigned to snapshot 3 -->
- <project_measures characteristic_id="[null]" url="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]"
- rule_priority="[null]"
- alert_text="[null]" id="1" project_id="1" metric_id="1" value="1"
- measure_date="2008-12-05 08:00:00.00" rule_id="[null]"
- snapshot_id="[null]" rules_category_id="[null]" text_value="[null]" tendency="[null]"/>
- <!-- Past measure inserted, have to be assigned only to snapshot 1 and 2 -->
- <project_measures characteristic_id="[null]" url="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]"
- rule_priority="[null]"
- alert_text="[null]" id="2" project_id="1" metric_id="1" value="8"
- measure_date="2008-12-03 08:00:00.00" rule_id="[null]"
- snapshot_id="[null]" rules_category_id="[null]" text_value="[null]" tendency="[null]"/>
-
-
- <async_measure_snapshots id="1" project_measure_id="1" snapshot_id="3" measure_date="2008-12-05 08:00:00.00"
- snapshot_date="2008-12-05 12:00:00.00" metric_id="1" project_id="1"/>
-
+<dataset>
+
+ <snapshots period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="1" scope="PRJ" qualifier="TRK" created_at="2008-12-03 12:00: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 period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="2" scope="PRJ" qualifier="TRK" created_at="2008-12-04 12:00: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 period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="3" scope="PRJ" qualifier="TRK" created_at="2008-12-05 12:00: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]"/>
+
+ <!-- Assigned to snapshot 3 -->
+ <project_measures characteristic_id="[null]" url="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]"
+ rule_priority="[null]"
+ alert_text="[null]" id="1" project_id="1" metric_id="1" value="1"
+ measure_date="2008-12-05 08:00:00.00" rule_id="[null]"
+ snapshot_id="[null]" rules_category_id="[null]" text_value="[null]" tendency="[null]"/>
+ <!-- Past measure inserted, have to be assigned only to snapshot 1 and 2 -->
+ <project_measures characteristic_id="[null]" url="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]"
+ rule_priority="[null]"
+ alert_text="[null]" id="2" project_id="1" metric_id="1" value="8"
+ measure_date="2008-12-03 08:00:00.00" rule_id="[null]"
+ snapshot_id="[null]" rules_category_id="[null]" text_value="[null]" tendency="[null]"/>
+
+
+ <async_measure_snapshots id="1" project_measure_id="1" snapshot_id="3" measure_date="2008-12-05 08:00:00.00"
+ snapshot_date="2008-12-05 12:00:00.00" metric_id="1" project_id="1"/>
+
</dataset> \ No newline at end of file
diff --git a/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/assignLatestMeasuresToLastSnapshot-result.xml b/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/assignLatestMeasuresToLastSnapshot-result.xml
index 91a93f2d2c0..d881a39193f 100644
--- a/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/assignLatestMeasuresToLastSnapshot-result.xml
+++ b/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/assignLatestMeasuresToLastSnapshot-result.xml
@@ -1,42 +1,42 @@
-<dataset>
-
- <!-- Previous snapshot -->
- <snapshots period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="1" scope="PRJ" qualifier="TRK" created_at="2008-12-03 12:00: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]"/>
- <!-- New snapshot -->
- <snapshots period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="2" scope="PRJ" qualifier="TRK" created_at="2008-12-04 12:00: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]"/>
-
- <project_measures characteristic_id="[null]" url="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]"
- rule_priority="[null]"
- alert_text="[null]" id="1" project_id="1" metric_id="1" value="1"
- measure_date="2008-12-02 08:00:00.00" rule_id="[null]"
- snapshot_id="[null]" rules_category_id="[null]" text_value="[null]" tendency="[null]"/>
- <project_measures characteristic_id="[null]" url="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]"
- rule_priority="[null]"
- alert_text="[null]" id="2" project_id="1" metric_id="1" value="2"
- measure_date="2008-12-02 10:00:00.00" rule_id="[null]"
- snapshot_id="[null]" rules_category_id="[null]" text_value="[null]" tendency="[null]"/>
- <project_measures characteristic_id="[null]" url="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]"
- rule_priority="[null]"
- alert_text="[null]" id="3" project_id="1" metric_id="2" value="5"
- measure_date="2008-12-03 10:00:00.00" rule_id="[null]"
- snapshot_id="[null]" rules_category_id="[null]" text_value="[null]" tendency="[null]"/>
-
- <!-- Previous async_measure_snapshots, attached to first snapshot -->
- <async_measure_snapshots id="1" project_measure_id="2" snapshot_id="1" measure_date="2008-12-02 10:00:00.00"
- snapshot_date="2008-12-03 12:00:00.00" metric_id="1" project_id="1"/>
- <async_measure_snapshots id="2" project_measure_id="3" snapshot_id="1" measure_date="2008-12-03 10:00:00.00"
- snapshot_date="2008-12-03 12:00:00.00" metric_id="2" project_id="1"/>
-
- <!--async_measure_snapshots from previous snapshot created for last snapshot -->
- <async_measure_snapshots id="3" project_measure_id="2" snapshot_id="2" measure_date="2008-12-02 10:00:00.00"
- snapshot_date="2008-12-04 12:00:00.00" metric_id="1" project_id="1"/>
- <async_measure_snapshots id="4" project_measure_id="3" snapshot_id="2" measure_date="2008-12-03 10:00:00.00"
- snapshot_date="2008-12-04 12:00:00.00" metric_id="2" project_id="1"/>
-
+<dataset>
+
+ <!-- Previous snapshot -->
+ <snapshots period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="1" scope="PRJ" qualifier="TRK" created_at="2008-12-03 12:00: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]"/>
+ <!-- New snapshot -->
+ <snapshots period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="2" scope="PRJ" qualifier="TRK" created_at="2008-12-04 12:00: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]"/>
+
+ <project_measures characteristic_id="[null]" url="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]"
+ rule_priority="[null]"
+ alert_text="[null]" id="1" project_id="1" metric_id="1" value="1"
+ measure_date="2008-12-02 08:00:00.00" rule_id="[null]"
+ snapshot_id="[null]" rules_category_id="[null]" text_value="[null]" tendency="[null]"/>
+ <project_measures characteristic_id="[null]" url="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]"
+ rule_priority="[null]"
+ alert_text="[null]" id="2" project_id="1" metric_id="1" value="2"
+ measure_date="2008-12-02 10:00:00.00" rule_id="[null]"
+ snapshot_id="[null]" rules_category_id="[null]" text_value="[null]" tendency="[null]"/>
+ <project_measures characteristic_id="[null]" url="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]"
+ rule_priority="[null]"
+ alert_text="[null]" id="3" project_id="1" metric_id="2" value="5"
+ measure_date="2008-12-03 10:00:00.00" rule_id="[null]"
+ snapshot_id="[null]" rules_category_id="[null]" text_value="[null]" tendency="[null]"/>
+
+ <!-- Previous async_measure_snapshots, attached to first snapshot -->
+ <async_measure_snapshots id="1" project_measure_id="2" snapshot_id="1" measure_date="2008-12-02 10:00:00.00"
+ snapshot_date="2008-12-03 12:00:00.00" metric_id="1" project_id="1"/>
+ <async_measure_snapshots id="2" project_measure_id="3" snapshot_id="1" measure_date="2008-12-03 10:00:00.00"
+ snapshot_date="2008-12-03 12:00:00.00" metric_id="2" project_id="1"/>
+
+ <!--async_measure_snapshots from previous snapshot created for last snapshot -->
+ <async_measure_snapshots id="3" project_measure_id="2" snapshot_id="2" measure_date="2008-12-02 10:00:00.00"
+ snapshot_date="2008-12-04 12:00:00.00" metric_id="1" project_id="1"/>
+ <async_measure_snapshots id="4" project_measure_id="3" snapshot_id="2" measure_date="2008-12-03 10:00:00.00"
+ snapshot_date="2008-12-04 12:00:00.00" metric_id="2" project_id="1"/>
+
</dataset> \ No newline at end of file
diff --git a/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/assignLatestMeasuresToLastSnapshot.xml b/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/assignLatestMeasuresToLastSnapshot.xml
index ff376655173..13c290cb14d 100644
--- a/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/assignLatestMeasuresToLastSnapshot.xml
+++ b/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/assignLatestMeasuresToLastSnapshot.xml
@@ -1,36 +1,36 @@
-<dataset>
-
- <!-- Previous snapshot -->
- <snapshots period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="1" scope="PRJ" qualifier="TRK" created_at="2008-12-03 12:00: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]"/>
- <!-- New snapshot -->
- <snapshots period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="2" scope="PRJ" qualifier="TRK" created_at="2008-12-04 12:00: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]"/>
-
- <project_measures characteristic_id="[null]" url="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]"
- rule_priority="[null]"
- alert_text="[null]" id="1" project_id="1" metric_id="1" value="1"
- measure_date="2008-12-02 08:00:00.00" rule_id="[null]"
- snapshot_id="[null]" rules_category_id="[null]" text_value="[null]" tendency="[null]"/>
- <project_measures characteristic_id="[null]" url="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]"
- rule_priority="[null]"
- alert_text="[null]" id="2" project_id="1" metric_id="1" value="2"
- measure_date="2008-12-02 10:00:00.00" rule_id="[null]"
- snapshot_id="[null]" rules_category_id="[null]" text_value="[null]" tendency="[null]"/>
- <project_measures characteristic_id="[null]" url="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]"
- rule_priority="[null]"
- alert_text="[null]" id="3" project_id="1" metric_id="2" value="5"
- measure_date="2008-12-03 10:00:00.00" rule_id="[null]"
- snapshot_id="[null]" rules_category_id="[null]" text_value="[null]" tendency="[null]"/>
-
- <!-- Previous async_measure_snapshots, attached to first snapshot -->
- <async_measure_snapshots id="1" project_measure_id="2" snapshot_id="1" measure_date="2008-12-02 10:00:00.00"
- snapshot_date="2008-12-03 12:00:00.00" metric_id="1" project_id="1"/>
- <async_measure_snapshots id="2" project_measure_id="3" snapshot_id="1" measure_date="2008-12-03 10:00:00.00"
- snapshot_date="2008-12-03 12:00:00.00" metric_id="2" project_id="1"/>
-
+<dataset>
+
+ <!-- Previous snapshot -->
+ <snapshots period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="1" scope="PRJ" qualifier="TRK" created_at="2008-12-03 12:00: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]"/>
+ <!-- New snapshot -->
+ <snapshots period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="2" scope="PRJ" qualifier="TRK" created_at="2008-12-04 12:00: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]"/>
+
+ <project_measures characteristic_id="[null]" url="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]"
+ rule_priority="[null]"
+ alert_text="[null]" id="1" project_id="1" metric_id="1" value="1"
+ measure_date="2008-12-02 08:00:00.00" rule_id="[null]"
+ snapshot_id="[null]" rules_category_id="[null]" text_value="[null]" tendency="[null]"/>
+ <project_measures characteristic_id="[null]" url="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]"
+ rule_priority="[null]"
+ alert_text="[null]" id="2" project_id="1" metric_id="1" value="2"
+ measure_date="2008-12-02 10:00:00.00" rule_id="[null]"
+ snapshot_id="[null]" rules_category_id="[null]" text_value="[null]" tendency="[null]"/>
+ <project_measures characteristic_id="[null]" url="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]"
+ rule_priority="[null]"
+ alert_text="[null]" id="3" project_id="1" metric_id="2" value="5"
+ measure_date="2008-12-03 10:00:00.00" rule_id="[null]"
+ snapshot_id="[null]" rules_category_id="[null]" text_value="[null]" tendency="[null]"/>
+
+ <!-- Previous async_measure_snapshots, attached to first snapshot -->
+ <async_measure_snapshots id="1" project_measure_id="2" snapshot_id="1" measure_date="2008-12-02 10:00:00.00"
+ snapshot_date="2008-12-03 12:00:00.00" metric_id="1" project_id="1"/>
+ <async_measure_snapshots id="2" project_measure_id="3" snapshot_id="1" measure_date="2008-12-03 10:00:00.00"
+ snapshot_date="2008-12-03 12:00:00.00" metric_id="2" project_id="1"/>
+
</dataset> \ No newline at end of file
diff --git a/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/assignLatestMeasuresWhenNoPreviousSnapshot-result.xml b/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/assignLatestMeasuresWhenNoPreviousSnapshot-result.xml
index 1fd4e3cb408..99475dfb9d1 100644
--- a/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/assignLatestMeasuresWhenNoPreviousSnapshot-result.xml
+++ b/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/assignLatestMeasuresWhenNoPreviousSnapshot-result.xml
@@ -1,45 +1,45 @@
-<dataset>
-
- <!-- new snapshot -->
- <snapshots period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="1" scope="PRJ" qualifier="TRK" created_at="2008-12-04 12:00: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]"/>
-
- <project_measures characteristic_id="[null]" url="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]"
- rule_priority="[null]"
- alert_text="[null]" id="1" project_id="1" metric_id="1" value="2"
- measure_date="2008-12-02 12:00:00.00" rule_id="[null]"
- snapshot_id="[null]" rules_category_id="[null]" text_value="[null]" tendency="[null]"/>
- <!--latest-->
- <project_measures characteristic_id="[null]" url="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]"
- rule_priority="[null]"
- alert_text="[null]" id="2" project_id="1" metric_id="1" value="5"
- measure_date="2008-12-03 12:00:00.00" rule_id="[null]"
- snapshot_id="[null]" rules_category_id="[null]" text_value="[null]" tendency="[null]"/>
-
- <project_measures characteristic_id="[null]" url="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]"
- rule_priority="[null]"
- alert_text="[null]" id="3" project_id="1" metric_id="2" value="6"
- measure_date="2008-12-02 12:00:00.00" rule_id="[null]"
- snapshot_id="[null]" rules_category_id="[null]" text_value="[null]" tendency="[null]"/>
- <!--latest-->
- <project_measures characteristic_id="[null]" url="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]"
- rule_priority="[null]"
- alert_text="[null]" id="4" project_id="1" metric_id="2" value="7"
- measure_date="2008-12-03 12:00:00.00" rule_id="[null]"
- snapshot_id="[null]" rules_category_id="[null]" text_value="[null]" tendency="[null]"/>
-
-
- <async_measure_snapshots id="1" project_measure_id="1" snapshot_id="[null]" measure_date="2008-12-02 12:00:00.00"
- snapshot_date="[null]" metric_id="1" project_id="1"/>
- <!-- attached -->
- <async_measure_snapshots id="2" project_measure_id="2" snapshot_id="1" measure_date="2008-12-03 12:00:00.00"
- snapshot_date="2008-12-04 12:00:00.00" metric_id="1" project_id="1"/>
- <async_measure_snapshots id="3" project_measure_id="3" snapshot_id="[null]" measure_date="2008-12-02 12:00:00.00"
- snapshot_date="[null]" metric_id="2" project_id="1"/>
- <!-- attached -->
- <async_measure_snapshots id="4" project_measure_id="4" snapshot_id="1" measure_date="2008-12-03 12:00:00.00"
- snapshot_date="2008-12-04 12:00:00.00" metric_id="2" project_id="1"/>
-
+<dataset>
+
+ <!-- new snapshot -->
+ <snapshots period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="1" scope="PRJ" qualifier="TRK" created_at="2008-12-04 12:00: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]"/>
+
+ <project_measures characteristic_id="[null]" url="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]"
+ rule_priority="[null]"
+ alert_text="[null]" id="1" project_id="1" metric_id="1" value="2"
+ measure_date="2008-12-02 12:00:00.00" rule_id="[null]"
+ snapshot_id="[null]" rules_category_id="[null]" text_value="[null]" tendency="[null]"/>
+ <!--latest-->
+ <project_measures characteristic_id="[null]" url="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]"
+ rule_priority="[null]"
+ alert_text="[null]" id="2" project_id="1" metric_id="1" value="5"
+ measure_date="2008-12-03 12:00:00.00" rule_id="[null]"
+ snapshot_id="[null]" rules_category_id="[null]" text_value="[null]" tendency="[null]"/>
+
+ <project_measures characteristic_id="[null]" url="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]"
+ rule_priority="[null]"
+ alert_text="[null]" id="3" project_id="1" metric_id="2" value="6"
+ measure_date="2008-12-02 12:00:00.00" rule_id="[null]"
+ snapshot_id="[null]" rules_category_id="[null]" text_value="[null]" tendency="[null]"/>
+ <!--latest-->
+ <project_measures characteristic_id="[null]" url="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]"
+ rule_priority="[null]"
+ alert_text="[null]" id="4" project_id="1" metric_id="2" value="7"
+ measure_date="2008-12-03 12:00:00.00" rule_id="[null]"
+ snapshot_id="[null]" rules_category_id="[null]" text_value="[null]" tendency="[null]"/>
+
+
+ <async_measure_snapshots id="1" project_measure_id="1" snapshot_id="[null]" measure_date="2008-12-02 12:00:00.00"
+ snapshot_date="[null]" metric_id="1" project_id="1"/>
+ <!-- attached -->
+ <async_measure_snapshots id="2" project_measure_id="2" snapshot_id="1" measure_date="2008-12-03 12:00:00.00"
+ snapshot_date="2008-12-04 12:00:00.00" metric_id="1" project_id="1"/>
+ <async_measure_snapshots id="3" project_measure_id="3" snapshot_id="[null]" measure_date="2008-12-02 12:00:00.00"
+ snapshot_date="[null]" metric_id="2" project_id="1"/>
+ <!-- attached -->
+ <async_measure_snapshots id="4" project_measure_id="4" snapshot_id="1" measure_date="2008-12-03 12:00:00.00"
+ snapshot_date="2008-12-04 12:00:00.00" metric_id="2" project_id="1"/>
+
</dataset> \ No newline at end of file
diff --git a/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/assignLatestMeasuresWhenNoPreviousSnapshot.xml b/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/assignLatestMeasuresWhenNoPreviousSnapshot.xml
index 6fde2608711..7ea8aa5fbaa 100644
--- a/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/assignLatestMeasuresWhenNoPreviousSnapshot.xml
+++ b/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/assignLatestMeasuresWhenNoPreviousSnapshot.xml
@@ -1,43 +1,43 @@
-<dataset>
-
- <!-- new snapshot -->
- <snapshots period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="1" scope="PRJ" qualifier="TRK" created_at="2008-12-04 12:00: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]"/>
-
- <project_measures characteristic_id="[null]" url="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]"
- rule_priority="[null]"
- alert_text="[null]" id="1" project_id="1" metric_id="1" value="2"
- measure_date="2008-12-02 12:00:00.00" rule_id="[null]"
- snapshot_id="[null]" rules_category_id="[null]" text_value="[null]" tendency="[null]"/>
- <!--latest-->
- <project_measures characteristic_id="[null]" url="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]"
- rule_priority="[null]"
- alert_text="[null]" id="2" project_id="1" metric_id="1" value="5"
- measure_date="2008-12-03 12:00:00.00" rule_id="[null]"
- snapshot_id="[null]" rules_category_id="[null]" text_value="[null]" tendency="[null]"/>
-
- <project_measures characteristic_id="[null]" url="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]"
- rule_priority="[null]"
- alert_text="[null]" id="3" project_id="1" metric_id="2" value="6"
- measure_date="2008-12-02 12:00:00.00" rule_id="[null]"
- snapshot_id="[null]" rules_category_id="[null]" text_value="[null]" tendency="[null]"/>
- <!--latest-->
- <project_measures characteristic_id="[null]" url="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]"
- rule_priority="[null]"
- alert_text="[null]" id="4" project_id="1" metric_id="2" value="7"
- measure_date="2008-12-03 12:00:00.00" rule_id="[null]"
- snapshot_id="[null]" rules_category_id="[null]" text_value="[null]" tendency="[null]"/>
-
-
- <async_measure_snapshots id="1" project_measure_id="1" snapshot_id="[null]" measure_date="2008-12-02 12:00:00.00"
- snapshot_date="[null]" metric_id="1" project_id="1"/>
- <async_measure_snapshots id="2" project_measure_id="2" snapshot_id="[null]" measure_date="2008-12-03 12:00:00.00"
- snapshot_date="[null]" metric_id="1" project_id="1"/>
- <async_measure_snapshots id="3" project_measure_id="3" snapshot_id="[null]" measure_date="2008-12-02 12:00:00.00"
- snapshot_date="[null]" metric_id="2" project_id="1"/>
- <async_measure_snapshots id="4" project_measure_id="4" snapshot_id="[null]" measure_date="2008-12-03 12:00:00.00"
- snapshot_date="[null]" metric_id="2" project_id="1"/>
-
+<dataset>
+
+ <!-- new snapshot -->
+ <snapshots period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="1" scope="PRJ" qualifier="TRK" created_at="2008-12-04 12:00: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]"/>
+
+ <project_measures characteristic_id="[null]" url="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]"
+ rule_priority="[null]"
+ alert_text="[null]" id="1" project_id="1" metric_id="1" value="2"
+ measure_date="2008-12-02 12:00:00.00" rule_id="[null]"
+ snapshot_id="[null]" rules_category_id="[null]" text_value="[null]" tendency="[null]"/>
+ <!--latest-->
+ <project_measures characteristic_id="[null]" url="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]"
+ rule_priority="[null]"
+ alert_text="[null]" id="2" project_id="1" metric_id="1" value="5"
+ measure_date="2008-12-03 12:00:00.00" rule_id="[null]"
+ snapshot_id="[null]" rules_category_id="[null]" text_value="[null]" tendency="[null]"/>
+
+ <project_measures characteristic_id="[null]" url="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]"
+ rule_priority="[null]"
+ alert_text="[null]" id="3" project_id="1" metric_id="2" value="6"
+ measure_date="2008-12-02 12:00:00.00" rule_id="[null]"
+ snapshot_id="[null]" rules_category_id="[null]" text_value="[null]" tendency="[null]"/>
+ <!--latest-->
+ <project_measures characteristic_id="[null]" url="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]"
+ rule_priority="[null]"
+ alert_text="[null]" id="4" project_id="1" metric_id="2" value="7"
+ measure_date="2008-12-03 12:00:00.00" rule_id="[null]"
+ snapshot_id="[null]" rules_category_id="[null]" text_value="[null]" tendency="[null]"/>
+
+
+ <async_measure_snapshots id="1" project_measure_id="1" snapshot_id="[null]" measure_date="2008-12-02 12:00:00.00"
+ snapshot_date="[null]" metric_id="1" project_id="1"/>
+ <async_measure_snapshots id="2" project_measure_id="2" snapshot_id="[null]" measure_date="2008-12-03 12:00:00.00"
+ snapshot_date="[null]" metric_id="1" project_id="1"/>
+ <async_measure_snapshots id="3" project_measure_id="3" snapshot_id="[null]" measure_date="2008-12-02 12:00:00.00"
+ snapshot_date="[null]" metric_id="2" project_id="1"/>
+ <async_measure_snapshots id="4" project_measure_id="4" snapshot_id="[null]" measure_date="2008-12-03 12:00:00.00"
+ snapshot_date="[null]" metric_id="2" project_id="1"/>
+
</dataset> \ No newline at end of file
diff --git a/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/assignMeasureToFutureSnapshotsWithDifferentMetric-result.xml b/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/assignMeasureToFutureSnapshotsWithDifferentMetric-result.xml
index 6632b151e3f..d2b62cbf6d8 100644
--- a/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/assignMeasureToFutureSnapshotsWithDifferentMetric-result.xml
+++ b/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/assignMeasureToFutureSnapshotsWithDifferentMetric-result.xml
@@ -1,59 +1,59 @@
-<dataset>
-
- <snapshots period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="1" scope="PRJ" qualifier="TRK" created_at="2008-12-03 12:00: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 period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="2" scope="PRJ" qualifier="TRK" created_at="2008-12-04 12:00: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 period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="3" scope="PRJ" qualifier="TRK" created_at="2008-12-05 12:00: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 period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="4" scope="PRJ" qualifier="TRK" created_at="2008-12-06 12:00: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]"/>
-
- <!-- Assigned to snapshot 1, 2 and 3 -->
- <project_measures characteristic_id="[null]" url="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]"
- rule_priority="[null]"
- alert_text="[null]" id="1" project_id="1" metric_id="1" value="1"
- measure_date="2008-12-03 08:00:00.00" rule_id="[null]"
- snapshot_id="[null]" rules_category_id="[null]" text_value="[null]" tendency="[null]"/>
- <!-- Assigned to snapshot 4 -->
- <project_measures characteristic_id="[null]" url="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]"
- rule_priority="[null]"
- alert_text="[null]" id="2" project_id="1" metric_id="1" value="8"
- measure_date="2008-12-06 08:00:00.00" rule_id="[null]"
- snapshot_id="[null]" rules_category_id="[null]" text_value="[null]" tendency="[null]"/>
- <!-- To be assigned only to snapshot 2 and 3 -->
- <project_measures characteristic_id="[null]" url="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]"
- rule_priority="[null]"
- alert_text="[null]" id="3" project_id="1" metric_id="1" value="8"
- measure_date="2008-12-04 08:00:00.00" rule_id="[null]"
- snapshot_id="[null]" rules_category_id="[null]" text_value="[null]" tendency="[null]"/>
-
-
- <async_measure_snapshots id="1" project_measure_id="1" snapshot_id="1" measure_date="2008-12-03 08:00:00.00"
- snapshot_date="2008-12-03 12:00:00.00" metric_id="1" project_id="1"/>
- <!-- Now assigned to no snapshot -->
- <async_measure_snapshots id="2" project_measure_id="1" snapshot_id="[null]" measure_date="2008-12-03 08:00:00.00"
- snapshot_date="[null]" metric_id="1" project_id="1"/>
- <!-- Now assigned to no snapshot -->
- <async_measure_snapshots id="3" project_measure_id="1" snapshot_id="[null]" measure_date="2008-12-03 08:00:00.00"
- snapshot_date="[null]" metric_id="1" project_id="1"/>
- <async_measure_snapshots id="4" project_measure_id="2" snapshot_id="4" measure_date="2008-12-06 08:00:00.00"
- snapshot_date="2008-12-06 12:00:00.00" metric_id="1" project_id="1"/>
-
- <!-- Now assigned to review 3 -->
- <async_measure_snapshots id="5" project_measure_id="3" snapshot_id="2" measure_date="2008-12-04 08:00:00.00"
- snapshot_date="2008-12-04 12:00:00.00" metric_id="1" project_id="1"/>
- <!-- Now assigned to review 3 -->
- <async_measure_snapshots id="6" project_measure_id="3" snapshot_id="3" measure_date="2008-12-04 08:00:00.00"
- snapshot_date="2008-12-05 12:00:00.00" metric_id="1" project_id="1"/>
-
-
+<dataset>
+
+ <snapshots period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="1" scope="PRJ" qualifier="TRK" created_at="2008-12-03 12:00: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 period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="2" scope="PRJ" qualifier="TRK" created_at="2008-12-04 12:00: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 period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="3" scope="PRJ" qualifier="TRK" created_at="2008-12-05 12:00: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 period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="4" scope="PRJ" qualifier="TRK" created_at="2008-12-06 12:00: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]"/>
+
+ <!-- Assigned to snapshot 1, 2 and 3 -->
+ <project_measures characteristic_id="[null]" url="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]"
+ rule_priority="[null]"
+ alert_text="[null]" id="1" project_id="1" metric_id="1" value="1"
+ measure_date="2008-12-03 08:00:00.00" rule_id="[null]"
+ snapshot_id="[null]" rules_category_id="[null]" text_value="[null]" tendency="[null]"/>
+ <!-- Assigned to snapshot 4 -->
+ <project_measures characteristic_id="[null]" url="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]"
+ rule_priority="[null]"
+ alert_text="[null]" id="2" project_id="1" metric_id="1" value="8"
+ measure_date="2008-12-06 08:00:00.00" rule_id="[null]"
+ snapshot_id="[null]" rules_category_id="[null]" text_value="[null]" tendency="[null]"/>
+ <!-- To be assigned only to snapshot 2 and 3 -->
+ <project_measures characteristic_id="[null]" url="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]"
+ rule_priority="[null]"
+ alert_text="[null]" id="3" project_id="1" metric_id="1" value="8"
+ measure_date="2008-12-04 08:00:00.00" rule_id="[null]"
+ snapshot_id="[null]" rules_category_id="[null]" text_value="[null]" tendency="[null]"/>
+
+
+ <async_measure_snapshots id="1" project_measure_id="1" snapshot_id="1" measure_date="2008-12-03 08:00:00.00"
+ snapshot_date="2008-12-03 12:00:00.00" metric_id="1" project_id="1"/>
+ <!-- Now assigned to no snapshot -->
+ <async_measure_snapshots id="2" project_measure_id="1" snapshot_id="[null]" measure_date="2008-12-03 08:00:00.00"
+ snapshot_date="[null]" metric_id="1" project_id="1"/>
+ <!-- Now assigned to no snapshot -->
+ <async_measure_snapshots id="3" project_measure_id="1" snapshot_id="[null]" measure_date="2008-12-03 08:00:00.00"
+ snapshot_date="[null]" metric_id="1" project_id="1"/>
+ <async_measure_snapshots id="4" project_measure_id="2" snapshot_id="4" measure_date="2008-12-06 08:00:00.00"
+ snapshot_date="2008-12-06 12:00:00.00" metric_id="1" project_id="1"/>
+
+ <!-- Now assigned to review 3 -->
+ <async_measure_snapshots id="5" project_measure_id="3" snapshot_id="2" measure_date="2008-12-04 08:00:00.00"
+ snapshot_date="2008-12-04 12:00:00.00" metric_id="1" project_id="1"/>
+ <!-- Now assigned to review 3 -->
+ <async_measure_snapshots id="6" project_measure_id="3" snapshot_id="3" measure_date="2008-12-04 08:00:00.00"
+ snapshot_date="2008-12-05 12:00:00.00" metric_id="1" project_id="1"/>
+
+
</dataset> \ No newline at end of file
diff --git a/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/assignMeasureToFutureSnapshotsWithDifferentMetric.xml b/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/assignMeasureToFutureSnapshotsWithDifferentMetric.xml
index d3165dc2f7c..9d343211f29 100644
--- a/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/assignMeasureToFutureSnapshotsWithDifferentMetric.xml
+++ b/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/assignMeasureToFutureSnapshotsWithDifferentMetric.xml
@@ -1,49 +1,49 @@
-<dataset>
-
- <snapshots period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="1" scope="PRJ" qualifier="TRK" created_at="2008-12-03 12:00: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 period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="2" scope="PRJ" qualifier="TRK" created_at="2008-12-04 12:00: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 period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="3" scope="PRJ" qualifier="TRK" created_at="2008-12-05 12:00: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 period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="4" scope="PRJ" qualifier="TRK" created_at="2008-12-06 12:00: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]"/>
-
- <!-- Assigned to snapshot 1, 2 and 3 -->
- <project_measures characteristic_id="[null]" url="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]"
- rule_priority="[null]"
- alert_text="[null]" id="1" project_id="1" metric_id="1" value="1"
- measure_date="2008-12-03 08:00:00.00" rule_id="[null]"
- snapshot_id="[null]" rules_category_id="[null]" text_value="[null]" tendency="[null]"/>
- <!-- Assigned to snapshot 4 -->
- <project_measures characteristic_id="[null]" url="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]"
- rule_priority="[null]"
- alert_text="[null]" id="2" project_id="1" metric_id="1" value="8"
- measure_date="2008-12-06 08:00:00.00" rule_id="[null]"
- snapshot_id="[null]" rules_category_id="[null]" text_value="[null]" tendency="[null]"/>
- <!-- To be assigned only to snapshot 2 and 3 -->
- <project_measures characteristic_id="[null]" url="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]"
- rule_priority="[null]"
- alert_text="[null]" id="3" project_id="1" metric_id="1" value="8"
- measure_date="2008-12-04 08:00:00.00" rule_id="[null]"
- snapshot_id="[null]" rules_category_id="[null]" text_value="[null]" tendency="[null]"/>
-
-
- <async_measure_snapshots id="1" project_measure_id="1" snapshot_id="1" measure_date="2008-12-03 08:00:00.00"
- snapshot_date="2008-12-03 12:00:00.00" metric_id="1" project_id="1"/>
- <async_measure_snapshots id="2" project_measure_id="1" snapshot_id="2" measure_date="2008-12-03 08:00:00.00"
- snapshot_date="2008-12-04 12:00:00.00" metric_id="1" project_id="1"/>
- <async_measure_snapshots id="3" project_measure_id="1" snapshot_id="3" measure_date="2008-12-03 08:00:00.00"
- snapshot_date="2008-12-05 12:00:00.00" metric_id="1" project_id="1"/>
- <async_measure_snapshots id="4" project_measure_id="2" snapshot_id="4" measure_date="2008-12-06 08:00:00.00"
- snapshot_date="2008-12-06 12:00:00.00" metric_id="1" project_id="1"/>
-
+<dataset>
+
+ <snapshots period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="1" scope="PRJ" qualifier="TRK" created_at="2008-12-03 12:00: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 period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="2" scope="PRJ" qualifier="TRK" created_at="2008-12-04 12:00: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 period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="3" scope="PRJ" qualifier="TRK" created_at="2008-12-05 12:00: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 period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="4" scope="PRJ" qualifier="TRK" created_at="2008-12-06 12:00: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]"/>
+
+ <!-- Assigned to snapshot 1, 2 and 3 -->
+ <project_measures characteristic_id="[null]" url="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]"
+ rule_priority="[null]"
+ alert_text="[null]" id="1" project_id="1" metric_id="1" value="1"
+ measure_date="2008-12-03 08:00:00.00" rule_id="[null]"
+ snapshot_id="[null]" rules_category_id="[null]" text_value="[null]" tendency="[null]"/>
+ <!-- Assigned to snapshot 4 -->
+ <project_measures characteristic_id="[null]" url="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]"
+ rule_priority="[null]"
+ alert_text="[null]" id="2" project_id="1" metric_id="1" value="8"
+ measure_date="2008-12-06 08:00:00.00" rule_id="[null]"
+ snapshot_id="[null]" rules_category_id="[null]" text_value="[null]" tendency="[null]"/>
+ <!-- To be assigned only to snapshot 2 and 3 -->
+ <project_measures characteristic_id="[null]" url="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]"
+ rule_priority="[null]"
+ alert_text="[null]" id="3" project_id="1" metric_id="1" value="8"
+ measure_date="2008-12-04 08:00:00.00" rule_id="[null]"
+ snapshot_id="[null]" rules_category_id="[null]" text_value="[null]" tendency="[null]"/>
+
+
+ <async_measure_snapshots id="1" project_measure_id="1" snapshot_id="1" measure_date="2008-12-03 08:00:00.00"
+ snapshot_date="2008-12-03 12:00:00.00" metric_id="1" project_id="1"/>
+ <async_measure_snapshots id="2" project_measure_id="1" snapshot_id="2" measure_date="2008-12-03 08:00:00.00"
+ snapshot_date="2008-12-04 12:00:00.00" metric_id="1" project_id="1"/>
+ <async_measure_snapshots id="3" project_measure_id="1" snapshot_id="3" measure_date="2008-12-03 08:00:00.00"
+ snapshot_date="2008-12-05 12:00:00.00" metric_id="1" project_id="1"/>
+ <async_measure_snapshots id="4" project_measure_id="2" snapshot_id="4" measure_date="2008-12-06 08:00:00.00"
+ snapshot_date="2008-12-06 12:00:00.00" metric_id="1" project_id="1"/>
+
</dataset> \ No newline at end of file
diff --git a/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/assignMeasuresWhenNoPreviousSnapshot-result.xml b/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/assignMeasuresWhenNoPreviousSnapshot-result.xml
index b63a7063f31..f8df127f391 100644
--- a/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/assignMeasuresWhenNoPreviousSnapshot-result.xml
+++ b/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/assignMeasuresWhenNoPreviousSnapshot-result.xml
@@ -1,24 +1,24 @@
-<dataset>
-
- <snapshots period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="1" scope="PRJ" qualifier="TRK" created_at="2008-12-04 12:00: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]"/>
-
- <project_measures characteristic_id="[null]" url="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]"
- rule_priority="[null]"
- alert_text="[null]" id="1" project_id="1" metric_id="1" value="2"
- measure_date="2008-12-03 14:00:00.00" rule_id="[null]"
- snapshot_id="[null]" rules_category_id="[null]" text_value="[null]" tendency="[null]"/>
- <project_measures characteristic_id="[null]" url="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]"
- rule_priority="[null]"
- alert_text="[null]" id="2" project_id="1" metric_id="2" value="5"
- measure_date="2008-12-03 15:00:00.00" rule_id="[null]"
- snapshot_id="[null]" rules_category_id="[null]" text_value="[null]" tendency="[null]"/>
-
- <async_measure_snapshots id="1" project_measure_id="1" snapshot_id="1" measure_date="2008-12-03 14:00:00.00"
- snapshot_date="2008-12-04 12:00:00.00" metric_id="1" project_id="1"/>
- <async_measure_snapshots id="2" project_measure_id="2" snapshot_id="1" measure_date="2008-12-03 15:00:00.00"
- snapshot_date="2008-12-04 12:00:00.00" metric_id="2" project_id="1"/>
-
+<dataset>
+
+ <snapshots period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="1" scope="PRJ" qualifier="TRK" created_at="2008-12-04 12:00: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]"/>
+
+ <project_measures characteristic_id="[null]" url="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]"
+ rule_priority="[null]"
+ alert_text="[null]" id="1" project_id="1" metric_id="1" value="2"
+ measure_date="2008-12-03 14:00:00.00" rule_id="[null]"
+ snapshot_id="[null]" rules_category_id="[null]" text_value="[null]" tendency="[null]"/>
+ <project_measures characteristic_id="[null]" url="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]"
+ rule_priority="[null]"
+ alert_text="[null]" id="2" project_id="1" metric_id="2" value="5"
+ measure_date="2008-12-03 15:00:00.00" rule_id="[null]"
+ snapshot_id="[null]" rules_category_id="[null]" text_value="[null]" tendency="[null]"/>
+
+ <async_measure_snapshots id="1" project_measure_id="1" snapshot_id="1" measure_date="2008-12-03 14:00:00.00"
+ snapshot_date="2008-12-04 12:00:00.00" metric_id="1" project_id="1"/>
+ <async_measure_snapshots id="2" project_measure_id="2" snapshot_id="1" measure_date="2008-12-03 15:00:00.00"
+ snapshot_date="2008-12-04 12:00:00.00" metric_id="2" project_id="1"/>
+
</dataset> \ No newline at end of file
diff --git a/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/assignMeasuresWhenNoPreviousSnapshot.xml b/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/assignMeasuresWhenNoPreviousSnapshot.xml
index 2c6b73de1a7..036b21882df 100644
--- a/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/assignMeasuresWhenNoPreviousSnapshot.xml
+++ b/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/assignMeasuresWhenNoPreviousSnapshot.xml
@@ -1,24 +1,24 @@
-<dataset>
-
- <snapshots period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="1" scope="PRJ" qualifier="TRK" created_at="2008-12-04 12:00: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]"/>
-
- <project_measures characteristic_id="[null]" url="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]"
- rule_priority="[null]"
- alert_text="[null]" id="1" project_id="1" metric_id="1" value="2"
- measure_date="2008-12-03 14:00:00.00" rule_id="[null]"
- snapshot_id="[null]" rules_category_id="[null]" text_value="[null]" tendency="[null]"/>
- <project_measures characteristic_id="[null]" url="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]"
- rule_priority="[null]"
- alert_text="[null]" id="2" project_id="1" metric_id="2" value="5"
- measure_date="2008-12-03 15:00:00.00" rule_id="[null]"
- snapshot_id="[null]" rules_category_id="[null]" text_value="[null]" tendency="[null]"/>
-
- <async_measure_snapshots id="1" project_measure_id="1" snapshot_id="[null]" measure_date="2008-12-03 14:00:00.00"
- snapshot_date="[null]" metric_id="1" project_id="1"/>
- <async_measure_snapshots id="2" project_measure_id="2" snapshot_id="[null]" measure_date="2008-12-03 15:00:00.00"
- snapshot_date="[null]" metric_id="2" project_id="1"/>
-
+<dataset>
+
+ <snapshots period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="1" scope="PRJ" qualifier="TRK" created_at="2008-12-04 12:00: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]"/>
+
+ <project_measures characteristic_id="[null]" url="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]"
+ rule_priority="[null]"
+ alert_text="[null]" id="1" project_id="1" metric_id="1" value="2"
+ measure_date="2008-12-03 14:00:00.00" rule_id="[null]"
+ snapshot_id="[null]" rules_category_id="[null]" text_value="[null]" tendency="[null]"/>
+ <project_measures characteristic_id="[null]" url="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]"
+ rule_priority="[null]"
+ alert_text="[null]" id="2" project_id="1" metric_id="2" value="5"
+ measure_date="2008-12-03 15:00:00.00" rule_id="[null]"
+ snapshot_id="[null]" rules_category_id="[null]" text_value="[null]" tendency="[null]"/>
+
+ <async_measure_snapshots id="1" project_measure_id="1" snapshot_id="[null]" measure_date="2008-12-03 14:00:00.00"
+ snapshot_date="[null]" metric_id="1" project_id="1"/>
+ <async_measure_snapshots id="2" project_measure_id="2" snapshot_id="[null]" measure_date="2008-12-03 15:00:00.00"
+ snapshot_date="[null]" metric_id="2" project_id="1"/>
+
</dataset> \ No newline at end of file
diff --git a/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/assignNewMeasureToFutureSnapshots-result.xml b/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/assignNewMeasureToFutureSnapshots-result.xml
index 7663f7b1f30..36a166be735 100644
--- a/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/assignNewMeasureToFutureSnapshots-result.xml
+++ b/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/assignNewMeasureToFutureSnapshots-result.xml
@@ -1,44 +1,44 @@
-<dataset>
-
- <snapshots period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="1" scope="PRJ" qualifier="TRK" created_at="2008-12-03 12:00: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 period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="2" scope="PRJ" qualifier="TRK" created_at="2008-12-04 12:00: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 period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="3" scope="PRJ" qualifier="TRK" created_at="2008-12-05 12:00: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]"/>
-
- <project_measures characteristic_id="[null]" url="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]"
- rule_priority="[null]"
- alert_text="[null]" id="1" project_id="1" metric_id="1" value="10"
- measure_date="2008-12-03 8:00:00.00" rule_id="[null]"
- snapshot_id="[null]" rules_category_id="[null]" text_value="[null]" tendency="[null]"/>
- <!-- New measure -->
- <project_measures characteristic_id="[null]" url="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]"
- rule_priority="[null]"
- alert_text="[null]" id="2" project_id="1" metric_id="1" value="8"
- measure_date="2008-12-04 8:00:00.00" rule_id="[null]"
- snapshot_id="[null]" rules_category_id="[null]" text_value="[null]" tendency="[null]"/>
-
-
- <async_measure_snapshots id="1" project_measure_id="1" snapshot_id="1" measure_date="2008-12-03 8:00:00.00"
- snapshot_date="2008-12-03 12:00:00.00" metric_id="1" project_id="1"/>
-
- <!-- Now assigned to no snapshot -->
- <async_measure_snapshots id="2" project_measure_id="2" snapshot_id="[null]" measure_date="2008-12-03 8:00:00.00"
- snapshot_date="[null]" metric_id="1" project_id="1"/>
- <async_measure_snapshots id="3" project_measure_id="3" snapshot_id="[null]" measure_date="2008-12-03 8:00:00.00"
- snapshot_date="[null]" metric_id="1" project_id="1"/>
-
- <!-- Now assigned to snapshot 2 and 3 -->
- <async_measure_snapshots id="4" project_measure_id="2" snapshot_id="2" measure_date="2008-12-04 8:00:00.00"
- snapshot_date="2008-12-04 12:00:00.00" metric_id="1" project_id="1"/>
- <async_measure_snapshots id="5" project_measure_id="2" snapshot_id="3" measure_date="2008-12-04 8:00:00.00"
- snapshot_date="2008-12-05 12:00:00.00" metric_id="1" project_id="1"/>
-
+<dataset>
+
+ <snapshots period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="1" scope="PRJ" qualifier="TRK" created_at="2008-12-03 12:00: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 period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="2" scope="PRJ" qualifier="TRK" created_at="2008-12-04 12:00: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 period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="3" scope="PRJ" qualifier="TRK" created_at="2008-12-05 12:00: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]"/>
+
+ <project_measures characteristic_id="[null]" url="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]"
+ rule_priority="[null]"
+ alert_text="[null]" id="1" project_id="1" metric_id="1" value="10"
+ measure_date="2008-12-03 8:00:00.00" rule_id="[null]"
+ snapshot_id="[null]" rules_category_id="[null]" text_value="[null]" tendency="[null]"/>
+ <!-- New measure -->
+ <project_measures characteristic_id="[null]" url="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]"
+ rule_priority="[null]"
+ alert_text="[null]" id="2" project_id="1" metric_id="1" value="8"
+ measure_date="2008-12-04 8:00:00.00" rule_id="[null]"
+ snapshot_id="[null]" rules_category_id="[null]" text_value="[null]" tendency="[null]"/>
+
+
+ <async_measure_snapshots id="1" project_measure_id="1" snapshot_id="1" measure_date="2008-12-03 8:00:00.00"
+ snapshot_date="2008-12-03 12:00:00.00" metric_id="1" project_id="1"/>
+
+ <!-- Now assigned to no snapshot -->
+ <async_measure_snapshots id="2" project_measure_id="2" snapshot_id="[null]" measure_date="2008-12-03 8:00:00.00"
+ snapshot_date="[null]" metric_id="1" project_id="1"/>
+ <async_measure_snapshots id="3" project_measure_id="3" snapshot_id="[null]" measure_date="2008-12-03 8:00:00.00"
+ snapshot_date="[null]" metric_id="1" project_id="1"/>
+
+ <!-- Now assigned to snapshot 2 and 3 -->
+ <async_measure_snapshots id="4" project_measure_id="2" snapshot_id="2" measure_date="2008-12-04 8:00:00.00"
+ snapshot_date="2008-12-04 12:00:00.00" metric_id="1" project_id="1"/>
+ <async_measure_snapshots id="5" project_measure_id="2" snapshot_id="3" measure_date="2008-12-04 8:00:00.00"
+ snapshot_date="2008-12-05 12:00:00.00" metric_id="1" project_id="1"/>
+
</dataset> \ No newline at end of file
diff --git a/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/assignNewMeasureToFutureSnapshots.xml b/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/assignNewMeasureToFutureSnapshots.xml
index 177f4a1eed3..5478f7f10bc 100644
--- a/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/assignNewMeasureToFutureSnapshots.xml
+++ b/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/assignNewMeasureToFutureSnapshots.xml
@@ -1,36 +1,36 @@
-<dataset>
-
- <snapshots period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="1" scope="PRJ" qualifier="TRK" created_at="2008-12-03 12:00: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 period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="2" scope="PRJ" qualifier="TRK" created_at="2008-12-04 12:00: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 period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="3" scope="PRJ" qualifier="TRK" created_at="2008-12-05 12:00: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]"/>
-
- <project_measures characteristic_id="[null]" url="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]"
- rule_priority="[null]"
- alert_text="[null]" id="1" project_id="1" metric_id="1" value="10"
- measure_date="2008-12-03 8:00:00.00" rule_id="[null]"
- snapshot_id="[null]" rules_category_id="[null]" text_value="[null]" tendency="[null]"/>
- <!-- New measure -->
- <project_measures characteristic_id="[null]" url="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]"
- rule_priority="[null]"
- alert_text="[null]" id="2" project_id="1" metric_id="1" value="8"
- measure_date="2008-12-04 8:00:00.00" rule_id="[null]"
- snapshot_id="[null]" rules_category_id="[null]" text_value="[null]" tendency="[null]"/>
-
-
- <async_measure_snapshots id="1" project_measure_id="1" snapshot_id="1" measure_date="2008-12-03 8:00:00.00"
- snapshot_date="2008-12-03 12:00:00.00" metric_id="1" project_id="1"/>
- <async_measure_snapshots id="2" project_measure_id="2" snapshot_id="2" measure_date="2008-12-03 8:00:00.00"
- snapshot_date="2008-12-04 12:00:00.00" metric_id="1" project_id="1"/>
- <async_measure_snapshots id="3" project_measure_id="3" snapshot_id="3" measure_date="2008-12-03 8:00:00.00"
- snapshot_date="2008-12-05 12:00:00.00" metric_id="1" project_id="1"/>
-
+<dataset>
+
+ <snapshots period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="1" scope="PRJ" qualifier="TRK" created_at="2008-12-03 12:00: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 period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="2" scope="PRJ" qualifier="TRK" created_at="2008-12-04 12:00: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 period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="3" scope="PRJ" qualifier="TRK" created_at="2008-12-05 12:00: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]"/>
+
+ <project_measures characteristic_id="[null]" url="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]"
+ rule_priority="[null]"
+ alert_text="[null]" id="1" project_id="1" metric_id="1" value="10"
+ measure_date="2008-12-03 8:00:00.00" rule_id="[null]"
+ snapshot_id="[null]" rules_category_id="[null]" text_value="[null]" tendency="[null]"/>
+ <!-- New measure -->
+ <project_measures characteristic_id="[null]" url="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]"
+ rule_priority="[null]"
+ alert_text="[null]" id="2" project_id="1" metric_id="1" value="8"
+ measure_date="2008-12-04 8:00:00.00" rule_id="[null]"
+ snapshot_id="[null]" rules_category_id="[null]" text_value="[null]" tendency="[null]"/>
+
+
+ <async_measure_snapshots id="1" project_measure_id="1" snapshot_id="1" measure_date="2008-12-03 8:00:00.00"
+ snapshot_date="2008-12-03 12:00:00.00" metric_id="1" project_id="1"/>
+ <async_measure_snapshots id="2" project_measure_id="2" snapshot_id="2" measure_date="2008-12-03 8:00:00.00"
+ snapshot_date="2008-12-04 12:00:00.00" metric_id="1" project_id="1"/>
+ <async_measure_snapshots id="3" project_measure_id="3" snapshot_id="3" measure_date="2008-12-03 8:00:00.00"
+ snapshot_date="2008-12-05 12:00:00.00" metric_id="1" project_id="1"/>
+
</dataset> \ No newline at end of file
diff --git a/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/assignNewMeasuresToLastSnapshot-result.xml b/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/assignNewMeasuresToLastSnapshot-result.xml
index 3283a09d2ef..977d0365d79 100644
--- a/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/assignNewMeasuresToLastSnapshot-result.xml
+++ b/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/assignNewMeasuresToLastSnapshot-result.xml
@@ -1,43 +1,43 @@
-<dataset>
-
- <!-- Previous snapshot -->
- <snapshots period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="1" scope="PRJ" qualifier="TRK" created_at="2008-12-03 12:00: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]"/>
- <!-- New snapshot -->
- <snapshots period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="2" scope="PRJ" qualifier="TRK" created_at="2008-12-04 12:00: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]"/>
-
- <!-- Assigned to first sanspshot -->
- <project_measures characteristic_id="[null]" url="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]"
- rule_priority="[null]"
- alert_text="[null]" id="1" project_id="1" metric_id="1" value="1"
- measure_date="2008-12-02 12:00:00.00" rule_id="[null]"
- snapshot_id="[null]" rules_category_id="[null]" text_value="[null]" tendency="[null]"/>
-
- <!-- Assigmed to no snapshot, because its new reviews -->
- <project_measures characteristic_id="[null]" url="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]"
- rule_priority="[null]"
- alert_text="[null]" id="2" project_id="1" metric_id="1" value="2"
- measure_date="2008-12-03 18:00:00.00" rule_id="[null]"
- snapshot_id="[null]" rules_category_id="[null]" text_value="[null]" tendency="[null]"/>
- <project_measures characteristic_id="[null]" url="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]"
- rule_priority="[null]"
- alert_text="[null]" id="3" project_id="1" metric_id="2" value="5"
- measure_date="2008-12-04 10:00:00.00" rule_id="[null]"
- snapshot_id="[null]" rules_category_id="[null]" text_value="[null]" tendency="[null]"/>
-
- <!-- async_measure_snapshots attached to first snapshot -->
- <async_measure_snapshots id="1" project_measure_id="1" snapshot_id="1" measure_date="2008-12-02 12:00:00.00"
- snapshot_date="2008-12-03 12:00:00.00" metric_id="1" project_id="1"/>
-
- <!-- async_measure_snapshots now attached to last snapshot -->
- <async_measure_snapshots id="2" project_measure_id="2" snapshot_id="2" measure_date="2008-12-03 18:00:00.00"
- snapshot_date="2008-12-04 12:00:00.00" metric_id="1" project_id="1"/>
- <async_measure_snapshots id="3" project_measure_id="3" snapshot_id="2" measure_date="2008-12-04 10:00:00.00"
- snapshot_date="2008-12-04 12:00:00.00" metric_id="2" project_id="1"/>
-
+<dataset>
+
+ <!-- Previous snapshot -->
+ <snapshots period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="1" scope="PRJ" qualifier="TRK" created_at="2008-12-03 12:00: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]"/>
+ <!-- New snapshot -->
+ <snapshots period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="2" scope="PRJ" qualifier="TRK" created_at="2008-12-04 12:00: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]"/>
+
+ <!-- Assigned to first sanspshot -->
+ <project_measures characteristic_id="[null]" url="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]"
+ rule_priority="[null]"
+ alert_text="[null]" id="1" project_id="1" metric_id="1" value="1"
+ measure_date="2008-12-02 12:00:00.00" rule_id="[null]"
+ snapshot_id="[null]" rules_category_id="[null]" text_value="[null]" tendency="[null]"/>
+
+ <!-- Assigmed to no snapshot, because its new reviews -->
+ <project_measures characteristic_id="[null]" url="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]"
+ rule_priority="[null]"
+ alert_text="[null]" id="2" project_id="1" metric_id="1" value="2"
+ measure_date="2008-12-03 18:00:00.00" rule_id="[null]"
+ snapshot_id="[null]" rules_category_id="[null]" text_value="[null]" tendency="[null]"/>
+ <project_measures characteristic_id="[null]" url="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]"
+ rule_priority="[null]"
+ alert_text="[null]" id="3" project_id="1" metric_id="2" value="5"
+ measure_date="2008-12-04 10:00:00.00" rule_id="[null]"
+ snapshot_id="[null]" rules_category_id="[null]" text_value="[null]" tendency="[null]"/>
+
+ <!-- async_measure_snapshots attached to first snapshot -->
+ <async_measure_snapshots id="1" project_measure_id="1" snapshot_id="1" measure_date="2008-12-02 12:00:00.00"
+ snapshot_date="2008-12-03 12:00:00.00" metric_id="1" project_id="1"/>
+
+ <!-- async_measure_snapshots now attached to last snapshot -->
+ <async_measure_snapshots id="2" project_measure_id="2" snapshot_id="2" measure_date="2008-12-03 18:00:00.00"
+ snapshot_date="2008-12-04 12:00:00.00" metric_id="1" project_id="1"/>
+ <async_measure_snapshots id="3" project_measure_id="3" snapshot_id="2" measure_date="2008-12-04 10:00:00.00"
+ snapshot_date="2008-12-04 12:00:00.00" metric_id="2" project_id="1"/>
+
</dataset> \ No newline at end of file
diff --git a/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/assignNewMeasuresToLastSnapshot.xml b/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/assignNewMeasuresToLastSnapshot.xml
index 634cafee24c..c73190edccd 100644
--- a/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/assignNewMeasuresToLastSnapshot.xml
+++ b/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/assignNewMeasuresToLastSnapshot.xml
@@ -1,42 +1,42 @@
-<dataset>
-
- <!-- Previous snapshot -->
- <snapshots period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="1" scope="PRJ" qualifier="TRK" created_at="2008-12-03 12:00: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]"/>
- <!-- New snapshot -->
- <snapshots period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="2" scope="PRJ" qualifier="TRK" created_at="2008-12-04 12:00:00.00" version="[null]"
- project_id="1"
- parent_snapshot_id="[null]" root_project_id="[null]" root_snapshot_id="[null]" status="P" islast="true"/>
-
- <!-- Assigned to first sanspshot -->
- <project_measures characteristic_id="[null]" url="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]"
- rule_priority="[null]"
- alert_text="[null]" id="1" project_id="1" metric_id="1" value="1"
- measure_date="2008-12-02 12:00:00.00" rule_id="[null]"
- snapshot_id="[null]" rules_category_id="[null]" text_value="[null]" tendency="[null]"/>
-
- <!-- Assigmed to no snapshot, because its new reviews -->
- <project_measures characteristic_id="[null]" url="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]"
- rule_priority="[null]"
- alert_text="[null]" id="2" project_id="1" metric_id="1" value="2"
- measure_date="2008-12-03 18:00:00.00" rule_id="[null]"
- snapshot_id="[null]" rules_category_id="[null]" text_value="[null]" tendency="[null]"/>
- <project_measures characteristic_id="[null]" url="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]"
- rule_priority="[null]"
- alert_text="[null]" id="3" project_id="1" metric_id="2" value="5"
- measure_date="2008-12-04 10:00:00.00" rule_id="[null]"
- snapshot_id="[null]" rules_category_id="[null]" text_value="[null]" tendency="[null]"/>
-
- <!-- async_measure_snapshots attached to first snapshot -->
- <async_measure_snapshots id="1" project_measure_id="1" snapshot_id="1" measure_date="2008-12-02 12:00:00.00"
- snapshot_date="2008-12-03 12:00:00.00" metric_id="1" project_id="1"/>
-
- <!-- async_measure_snapshots attached to no snapshot -->
- <async_measure_snapshots id="2" project_measure_id="2" snapshot_id="[null]" measure_date="2008-12-03 18:00:00.00"
- snapshot_date="[null]" metric_id="1" project_id="1"/>
- <async_measure_snapshots id="3" project_measure_id="3" snapshot_id="[null]" measure_date="2008-12-04 10:00:00.00"
- snapshot_date="[null]" metric_id="2" project_id="1"/>
-
+<dataset>
+
+ <!-- Previous snapshot -->
+ <snapshots period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="1" scope="PRJ" qualifier="TRK" created_at="2008-12-03 12:00: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]"/>
+ <!-- New snapshot -->
+ <snapshots period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="2" scope="PRJ" qualifier="TRK" created_at="2008-12-04 12:00:00.00" version="[null]"
+ project_id="1"
+ parent_snapshot_id="[null]" root_project_id="[null]" root_snapshot_id="[null]" status="P" islast="true"/>
+
+ <!-- Assigned to first sanspshot -->
+ <project_measures characteristic_id="[null]" url="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]"
+ rule_priority="[null]"
+ alert_text="[null]" id="1" project_id="1" metric_id="1" value="1"
+ measure_date="2008-12-02 12:00:00.00" rule_id="[null]"
+ snapshot_id="[null]" rules_category_id="[null]" text_value="[null]" tendency="[null]"/>
+
+ <!-- Assigmed to no snapshot, because its new reviews -->
+ <project_measures characteristic_id="[null]" url="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]"
+ rule_priority="[null]"
+ alert_text="[null]" id="2" project_id="1" metric_id="1" value="2"
+ measure_date="2008-12-03 18:00:00.00" rule_id="[null]"
+ snapshot_id="[null]" rules_category_id="[null]" text_value="[null]" tendency="[null]"/>
+ <project_measures characteristic_id="[null]" url="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]"
+ rule_priority="[null]"
+ alert_text="[null]" id="3" project_id="1" metric_id="2" value="5"
+ measure_date="2008-12-04 10:00:00.00" rule_id="[null]"
+ snapshot_id="[null]" rules_category_id="[null]" text_value="[null]" tendency="[null]"/>
+
+ <!-- async_measure_snapshots attached to first snapshot -->
+ <async_measure_snapshots id="1" project_measure_id="1" snapshot_id="1" measure_date="2008-12-02 12:00:00.00"
+ snapshot_date="2008-12-03 12:00:00.00" metric_id="1" project_id="1"/>
+
+ <!-- async_measure_snapshots attached to no snapshot -->
+ <async_measure_snapshots id="2" project_measure_id="2" snapshot_id="[null]" measure_date="2008-12-03 18:00:00.00"
+ snapshot_date="[null]" metric_id="1" project_id="1"/>
+ <async_measure_snapshots id="3" project_measure_id="3" snapshot_id="[null]" measure_date="2008-12-04 10:00:00.00"
+ snapshot_date="[null]" metric_id="2" project_id="1"/>
+
</dataset> \ No newline at end of file
diff --git a/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/assignPastMeasuresToPastSnapshot-result.xml b/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/assignPastMeasuresToPastSnapshot-result.xml
index 57705a616ba..04ea0cd38d6 100644
--- a/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/assignPastMeasuresToPastSnapshot-result.xml
+++ b/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/assignPastMeasuresToPastSnapshot-result.xml
@@ -1,47 +1,47 @@
-<dataset>
-
- <!-- First snapshot -->
- <snapshots period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="1" scope="PRJ" qualifier="TRK" created_at="2008-12-02 12:00: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]"/>
- <!-- Last snapshot -->
- <snapshots period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="2" scope="PRJ" qualifier="TRK" created_at="2008-12-05 12:00: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]"/>
-
- <!-- New snapshot, inserted between last two -->
- <snapshots period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="3" scope="PRJ" qualifier="TRK" created_at="2008-12-03 12:00: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]"/>
-
-
- <!-- reviews attached to first snapshot -->
- <project_measures characteristic_id="[null]" url="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]"
- rule_priority="[null]"
- alert_text="[null]" id="1" project_id="1" metric_id="1" value="1"
- measure_date="2008-12-01 12:00:00.00" rule_id="[null]"
- snapshot_id="[null]" rules_category_id="[null]" text_value="[null]" tendency="[null]"/>
- <!-- reviews attached to last snapshot -->
- <project_measures characteristic_id="[null]" url="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]"
- rule_priority="[null]"
- alert_text="[null]" id="2" project_id="1" metric_id="1" value="5"
- measure_date="2008-12-04 12:00:00.00" rule_id="[null]"
- snapshot_id="[null]" rules_category_id="[null]" text_value="[null]" tendency="[null]"/>
-
-
- <!-- async_measure_snapshots attached to first snapshot -->
- <async_measure_snapshots id="1" project_measure_id="1" snapshot_id="1" measure_date="2008-12-01 12:00:00.00"
- snapshot_date="2008-12-02 12:00:00.00" metric_id="1" project_id="1"/>
- <!-- async_measure_snapshots attached to last snapshot -->
- <async_measure_snapshots id="2" project_measure_id="2" snapshot_id="2" measure_date="2008-12-04 12:00:00.00"
- snapshot_date="2008-12-05 12:00:00.00" metric_id="1" project_id="1"/>
-
-
- <!-- async_measure_snapshots created for the new snapshot -->
- <async_measure_snapshots id="3" project_measure_id="1" snapshot_id="3" measure_date="2008-12-01 12:00:00.00"
- snapshot_date="2008-12-03 12:00:00.00" metric_id="1" project_id="1"/>
-
+<dataset>
+
+ <!-- First snapshot -->
+ <snapshots period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="1" scope="PRJ" qualifier="TRK" created_at="2008-12-02 12:00: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]"/>
+ <!-- Last snapshot -->
+ <snapshots period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="2" scope="PRJ" qualifier="TRK" created_at="2008-12-05 12:00: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]"/>
+
+ <!-- New snapshot, inserted between last two -->
+ <snapshots period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="3" scope="PRJ" qualifier="TRK" created_at="2008-12-03 12:00: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]"/>
+
+
+ <!-- reviews attached to first snapshot -->
+ <project_measures characteristic_id="[null]" url="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]"
+ rule_priority="[null]"
+ alert_text="[null]" id="1" project_id="1" metric_id="1" value="1"
+ measure_date="2008-12-01 12:00:00.00" rule_id="[null]"
+ snapshot_id="[null]" rules_category_id="[null]" text_value="[null]" tendency="[null]"/>
+ <!-- reviews attached to last snapshot -->
+ <project_measures characteristic_id="[null]" url="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]"
+ rule_priority="[null]"
+ alert_text="[null]" id="2" project_id="1" metric_id="1" value="5"
+ measure_date="2008-12-04 12:00:00.00" rule_id="[null]"
+ snapshot_id="[null]" rules_category_id="[null]" text_value="[null]" tendency="[null]"/>
+
+
+ <!-- async_measure_snapshots attached to first snapshot -->
+ <async_measure_snapshots id="1" project_measure_id="1" snapshot_id="1" measure_date="2008-12-01 12:00:00.00"
+ snapshot_date="2008-12-02 12:00:00.00" metric_id="1" project_id="1"/>
+ <!-- async_measure_snapshots attached to last snapshot -->
+ <async_measure_snapshots id="2" project_measure_id="2" snapshot_id="2" measure_date="2008-12-04 12:00:00.00"
+ snapshot_date="2008-12-05 12:00:00.00" metric_id="1" project_id="1"/>
+
+
+ <!-- async_measure_snapshots created for the new snapshot -->
+ <async_measure_snapshots id="3" project_measure_id="1" snapshot_id="3" measure_date="2008-12-01 12:00:00.00"
+ snapshot_date="2008-12-03 12:00:00.00" metric_id="1" project_id="1"/>
+
</dataset> \ No newline at end of file
diff --git a/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/assignPastMeasuresToPastSnapshot.xml b/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/assignPastMeasuresToPastSnapshot.xml
index 7342409a29c..1916d0b87f4 100644
--- a/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/assignPastMeasuresToPastSnapshot.xml
+++ b/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/assignPastMeasuresToPastSnapshot.xml
@@ -1,42 +1,42 @@
-<dataset>
-
- <!-- First snapshot -->
- <snapshots period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="1" scope="PRJ" qualifier="TRK" created_at="2008-12-02 12:00: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]"/>
- <!-- Last snapshot -->
- <snapshots period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="2" scope="PRJ" qualifier="TRK" created_at="2008-12-05 12:00: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]"/>
-
- <!-- New snapshot, inserted between last two -->
- <snapshots period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="3" scope="PRJ" qualifier="TRK" created_at="2008-12-03 12:00: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]"/>
-
-
- <!-- reviews attached to first snapshot -->
- <project_measures characteristic_id="[null]" url="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]"
- rule_priority="[null]"
- alert_text="[null]" id="1" project_id="1" metric_id="1" value="1"
- measure_date="2008-12-01 12:00:00.00" rule_id="[null]"
- snapshot_id="[null]" rules_category_id="[null]" text_value="[null]" tendency="[null]"/>
- <!-- reviews attached to last snapshot -->
- <project_measures characteristic_id="[null]" url="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]"
- rule_priority="[null]"
- alert_text="[null]" id="2" project_id="1" metric_id="1" value="5"
- measure_date="2008-12-04 12:00:00.00" rule_id="[null]"
- snapshot_id="[null]" rules_category_id="[null]" text_value="[null]" tendency="[null]"/>
-
-
- <!-- async_measure_snapshots attached to first snapshot -->
- <async_measure_snapshots id="1" project_measure_id="1" snapshot_id="1" measure_date="2008-12-01 12:00:00.00"
- snapshot_date="2008-12-02 12:00:00.00" metric_id="1" project_id="1"/>
- <!-- async_measure_snapshots attached to last snapshot -->
- <async_measure_snapshots id="2" project_measure_id="2" snapshot_id="2" measure_date="2008-12-04 12:00:00.00"
- snapshot_date="2008-12-05 12:00:00.00" metric_id="1" project_id="1"/>
-
+<dataset>
+
+ <!-- First snapshot -->
+ <snapshots period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="1" scope="PRJ" qualifier="TRK" created_at="2008-12-02 12:00: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]"/>
+ <!-- Last snapshot -->
+ <snapshots period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="2" scope="PRJ" qualifier="TRK" created_at="2008-12-05 12:00: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]"/>
+
+ <!-- New snapshot, inserted between last two -->
+ <snapshots period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="3" scope="PRJ" qualifier="TRK" created_at="2008-12-03 12:00: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]"/>
+
+
+ <!-- reviews attached to first snapshot -->
+ <project_measures characteristic_id="[null]" url="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]"
+ rule_priority="[null]"
+ alert_text="[null]" id="1" project_id="1" metric_id="1" value="1"
+ measure_date="2008-12-01 12:00:00.00" rule_id="[null]"
+ snapshot_id="[null]" rules_category_id="[null]" text_value="[null]" tendency="[null]"/>
+ <!-- reviews attached to last snapshot -->
+ <project_measures characteristic_id="[null]" url="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]"
+ rule_priority="[null]"
+ alert_text="[null]" id="2" project_id="1" metric_id="1" value="5"
+ measure_date="2008-12-04 12:00:00.00" rule_id="[null]"
+ snapshot_id="[null]" rules_category_id="[null]" text_value="[null]" tendency="[null]"/>
+
+
+ <!-- async_measure_snapshots attached to first snapshot -->
+ <async_measure_snapshots id="1" project_measure_id="1" snapshot_id="1" measure_date="2008-12-01 12:00:00.00"
+ snapshot_date="2008-12-02 12:00:00.00" metric_id="1" project_id="1"/>
+ <!-- async_measure_snapshots attached to last snapshot -->
+ <async_measure_snapshots id="2" project_measure_id="2" snapshot_id="2" measure_date="2008-12-04 12:00:00.00"
+ snapshot_date="2008-12-05 12:00:00.00" metric_id="1" project_id="1"/>
+
</dataset> \ No newline at end of file
diff --git a/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/deleteLastMeasure-result.xml b/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/deleteLastMeasure-result.xml
index fcd63b79325..bbfd4845003 100644
--- a/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/deleteLastMeasure-result.xml
+++ b/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/deleteLastMeasure-result.xml
@@ -1,30 +1,30 @@
-<dataset>
-
- <snapshots period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="1" scope="PRJ" qualifier="TRK" created_at="2008-12-03 12:00: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 period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="2" scope="PRJ" qualifier="TRK" created_at="2008-12-04 12:00: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 period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="3" scope="PRJ" qualifier="TRK" created_at="2008-12-05 12:00: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]"/>
-
- <!--<project_measures characteristic_id="[null]" url="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]" rule_priority="[null]" alert_text="[null]" id="1" project_id="1" metric_id="1" value="12" measure_date="2008-12-03 10:00:00.00" rule_id="[null]"
- snapshot_id="[null]" rules_category_id="[null]" text_value="[null]" tendency="[null]"/>-->
- <project_measures characteristic_id="[null]" url="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]"
- rule_priority="[null]"
- alert_text="[null]" id="2" project_id="1" metric_id="1" value="8"
- measure_date="2008-12-04 08:00:00.00" rule_id="[null]"
- snapshot_id="[null]" rules_category_id="[null]" text_value="[null]" tendency="[null]"/>
-
-
- <!--<async_measure_snapshots id="1" project_measure_id="1" snapshot_id="2" measure_date="2008-12-03 10:00:00.00"-->
- <!--snapshot_date="2008-12-04 12:00:00.00" metric_id="1" project_id="1"/>-->
- <async_measure_snapshots id="2" project_measure_id="2" snapshot_id="3" measure_date="2008-12-04 08:00:00.00"
- snapshot_date="2008-12-05 12:00:00.00" metric_id="1" project_id="1"/>
-
+<dataset>
+
+ <snapshots period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="1" scope="PRJ" qualifier="TRK" created_at="2008-12-03 12:00: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 period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="2" scope="PRJ" qualifier="TRK" created_at="2008-12-04 12:00: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 period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="3" scope="PRJ" qualifier="TRK" created_at="2008-12-05 12:00: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]"/>
+
+ <!--<project_measures characteristic_id="[null]" url="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]" rule_priority="[null]" alert_text="[null]" id="1" project_id="1" metric_id="1" value="12" measure_date="2008-12-03 10:00:00.00" rule_id="[null]"
+ snapshot_id="[null]" rules_category_id="[null]" text_value="[null]" tendency="[null]"/>-->
+ <project_measures characteristic_id="[null]" url="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]"
+ rule_priority="[null]"
+ alert_text="[null]" id="2" project_id="1" metric_id="1" value="8"
+ measure_date="2008-12-04 08:00:00.00" rule_id="[null]"
+ snapshot_id="[null]" rules_category_id="[null]" text_value="[null]" tendency="[null]"/>
+
+
+ <!--<async_measure_snapshots id="1" project_measure_id="1" snapshot_id="2" measure_date="2008-12-03 10:00:00.00"-->
+ <!--snapshot_date="2008-12-04 12:00:00.00" metric_id="1" project_id="1"/>-->
+ <async_measure_snapshots id="2" project_measure_id="2" snapshot_id="3" measure_date="2008-12-04 08:00:00.00"
+ snapshot_date="2008-12-05 12:00:00.00" metric_id="1" project_id="1"/>
+
</dataset> \ No newline at end of file
diff --git a/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/deleteLastMeasure.xml b/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/deleteLastMeasure.xml
index 0fe23dabe4b..d0a260f60f1 100644
--- a/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/deleteLastMeasure.xml
+++ b/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/deleteLastMeasure.xml
@@ -1,32 +1,32 @@
-<dataset>
-
- <snapshots period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="1" scope="PRJ" qualifier="TRK" created_at="2008-12-03 12:00: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 period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="2" scope="PRJ" qualifier="TRK" created_at="2008-12-04 12:00: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 period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="3" scope="PRJ" qualifier="TRK" created_at="2008-12-05 12:00: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]"/>
-
- <project_measures characteristic_id="[null]" url="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]"
- rule_priority="[null]"
- alert_text="[null]" id="1" project_id="1" metric_id="1" value="12"
- measure_date="2008-12-03 10:00:00.00" rule_id="[null]"
- snapshot_id="[null]" rules_category_id="[null]" text_value="[null]" tendency="[null]"/>
- <project_measures characteristic_id="[null]" url="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]"
- rule_priority="[null]"
- alert_text="[null]" id="2" project_id="1" metric_id="1" value="8"
- measure_date="2008-12-04 08:00:00.00" rule_id="[null]"
- snapshot_id="[null]" rules_category_id="[null]" text_value="[null]" tendency="[null]"/>
-
- <async_measure_snapshots id="1" project_measure_id="1" snapshot_id="2" measure_date="2008-12-03 10:00:00.00"
- snapshot_date="2008-12-04 12:00:00.00" metric_id="1" project_id="1"/>
- <async_measure_snapshots id="2" project_measure_id="2" snapshot_id="3" measure_date="2008-12-04 08:00:00.00"
- snapshot_date="2008-12-05 12:00:00.00" metric_id="1" project_id="1"/>
-
+<dataset>
+
+ <snapshots period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="1" scope="PRJ" qualifier="TRK" created_at="2008-12-03 12:00: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 period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="2" scope="PRJ" qualifier="TRK" created_at="2008-12-04 12:00: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 period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="3" scope="PRJ" qualifier="TRK" created_at="2008-12-05 12:00: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]"/>
+
+ <project_measures characteristic_id="[null]" url="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]"
+ rule_priority="[null]"
+ alert_text="[null]" id="1" project_id="1" metric_id="1" value="12"
+ measure_date="2008-12-03 10:00:00.00" rule_id="[null]"
+ snapshot_id="[null]" rules_category_id="[null]" text_value="[null]" tendency="[null]"/>
+ <project_measures characteristic_id="[null]" url="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]"
+ rule_priority="[null]"
+ alert_text="[null]" id="2" project_id="1" metric_id="1" value="8"
+ measure_date="2008-12-04 08:00:00.00" rule_id="[null]"
+ snapshot_id="[null]" rules_category_id="[null]" text_value="[null]" tendency="[null]"/>
+
+ <async_measure_snapshots id="1" project_measure_id="1" snapshot_id="2" measure_date="2008-12-03 10:00:00.00"
+ snapshot_date="2008-12-04 12:00:00.00" metric_id="1" project_id="1"/>
+ <async_measure_snapshots id="2" project_measure_id="2" snapshot_id="3" measure_date="2008-12-04 08:00:00.00"
+ snapshot_date="2008-12-05 12:00:00.00" metric_id="1" project_id="1"/>
+
</dataset> \ No newline at end of file
diff --git a/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/deleteMeasure-result.xml b/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/deleteMeasure-result.xml
index 252cfc25be1..ed2be1cb346 100644
--- a/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/deleteMeasure-result.xml
+++ b/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/deleteMeasure-result.xml
@@ -1,41 +1,41 @@
-<dataset>
-
- <snapshots period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="1" scope="PRJ" qualifier="TRK" created_at="2008-12-03 12:00:00.00" version="[null]"
- project_id="1"
- parent_snapshot_id="[null]" root_project_id="[null]" root_snapshot_id="[null]" status="P" islast="true"/>
- <snapshots period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="2" scope="PRJ" qualifier="TRK" created_at="2008-12-04 12:00:00.00" version="[null]"
- project_id="1"
- parent_snapshot_id="[null]" root_project_id="[null]" root_snapshot_id="[null]" status="P" islast="true"/>
- <snapshots period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="3" scope="PRJ" qualifier="TRK" created_at="2008-12-05 12:00: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]"/>
-
- <project_measures characteristic_id="[null]" url="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]"
- rule_priority="[null]"
- alert_text="[null]" id="1" project_id="1" metric_id="1" value="1"
- measure_date="2008-12-03 08:00:00.00" rule_id="[null]"
- snapshot_id="[null]" rules_category_id="[null]" text_value="[null]" tendency="[null]"/>
- <!-- async measure to be deleted -->
- <!--<project_measures characteristic_id="[null]" url="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]" rule_priority="[null]" alert_text="[null]" id="2" project_id="1" metric_id="1" value="2" measure_date="2008-12-05 08:00:00.00" rule_id="[null]"-->
- <!--snapshot_id="[null]" rules_category_id="[null]" text_value="[null]" tendency="[null]"/>-->
-
- <!-- old async measure snapshots -->
- <!--<async_measure_snapshots id="1" project_measure_id="1" snapshot_id="[null]" measure_date="2008-12-03 08:00:00.00"-->
- <!--snapshot_date="[null]" metric_id="1" project_id="1" />-->
-
- <!--<async_measure_snapshots id="2" project_measure_id="1" snapshot_id="1" measure_date="2008-12-03 08:00:00.00"-->
- <!--snapshot_date="2008-12-03 12:00:00.00" metric_id="1" project_id="1" />-->
- <!--<async_measure_snapshots id="3" project_measure_id="1" snapshot_id="2" measure_date="2008-12-03 08:00:00.00"-->
- <!--snapshot_date="2008-12-04 12:00:00.00" metric_id="1" project_id="1" />-->
- <!--<async_measure_snapshots id="4" project_measure_id="2" snapshot_id="3" measure_date="2008-12-05 08:00:00.00"-->
- <!--snapshot_date="2008-12-05 12:00:00.00" metric_id="1" project_id="1" />-->
-
- <async_measure_snapshots id="5" project_measure_id="1" snapshot_id="1" measure_date="2008-12-03 08:00:00.00"
- snapshot_date="2008-12-03 12:00:00.00" metric_id="1" project_id="1"/>
- <async_measure_snapshots id="6" project_measure_id="1" snapshot_id="2" measure_date="2008-12-03 08:00:00.00"
- snapshot_date="2008-12-04 12:00:00.00" metric_id="1" project_id="1"/>
- <async_measure_snapshots id="7" project_measure_id="1" snapshot_id="3" measure_date="2008-12-03 08:00:00.00"
- snapshot_date="2008-12-05 12:00:00.00" metric_id="1" project_id="1"/>
-
+<dataset>
+
+ <snapshots period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="1" scope="PRJ" qualifier="TRK" created_at="2008-12-03 12:00:00.00" version="[null]"
+ project_id="1"
+ parent_snapshot_id="[null]" root_project_id="[null]" root_snapshot_id="[null]" status="P" islast="true"/>
+ <snapshots period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="2" scope="PRJ" qualifier="TRK" created_at="2008-12-04 12:00:00.00" version="[null]"
+ project_id="1"
+ parent_snapshot_id="[null]" root_project_id="[null]" root_snapshot_id="[null]" status="P" islast="true"/>
+ <snapshots period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="3" scope="PRJ" qualifier="TRK" created_at="2008-12-05 12:00: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]"/>
+
+ <project_measures characteristic_id="[null]" url="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]"
+ rule_priority="[null]"
+ alert_text="[null]" id="1" project_id="1" metric_id="1" value="1"
+ measure_date="2008-12-03 08:00:00.00" rule_id="[null]"
+ snapshot_id="[null]" rules_category_id="[null]" text_value="[null]" tendency="[null]"/>
+ <!-- async measure to be deleted -->
+ <!--<project_measures characteristic_id="[null]" url="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]" rule_priority="[null]" alert_text="[null]" id="2" project_id="1" metric_id="1" value="2" measure_date="2008-12-05 08:00:00.00" rule_id="[null]"-->
+ <!--snapshot_id="[null]" rules_category_id="[null]" text_value="[null]" tendency="[null]"/>-->
+
+ <!-- old async measure snapshots -->
+ <!--<async_measure_snapshots id="1" project_measure_id="1" snapshot_id="[null]" measure_date="2008-12-03 08:00:00.00"-->
+ <!--snapshot_date="[null]" metric_id="1" project_id="1" />-->
+
+ <!--<async_measure_snapshots id="2" project_measure_id="1" snapshot_id="1" measure_date="2008-12-03 08:00:00.00"-->
+ <!--snapshot_date="2008-12-03 12:00:00.00" metric_id="1" project_id="1" />-->
+ <!--<async_measure_snapshots id="3" project_measure_id="1" snapshot_id="2" measure_date="2008-12-03 08:00:00.00"-->
+ <!--snapshot_date="2008-12-04 12:00:00.00" metric_id="1" project_id="1" />-->
+ <!--<async_measure_snapshots id="4" project_measure_id="2" snapshot_id="3" measure_date="2008-12-05 08:00:00.00"-->
+ <!--snapshot_date="2008-12-05 12:00:00.00" metric_id="1" project_id="1" />-->
+
+ <async_measure_snapshots id="5" project_measure_id="1" snapshot_id="1" measure_date="2008-12-03 08:00:00.00"
+ snapshot_date="2008-12-03 12:00:00.00" metric_id="1" project_id="1"/>
+ <async_measure_snapshots id="6" project_measure_id="1" snapshot_id="2" measure_date="2008-12-03 08:00:00.00"
+ snapshot_date="2008-12-04 12:00:00.00" metric_id="1" project_id="1"/>
+ <async_measure_snapshots id="7" project_measure_id="1" snapshot_id="3" measure_date="2008-12-03 08:00:00.00"
+ snapshot_date="2008-12-05 12:00:00.00" metric_id="1" project_id="1"/>
+
</dataset> \ No newline at end of file
diff --git a/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/deleteMeasure.xml b/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/deleteMeasure.xml
index 6e1e6e87b2c..17b279547f2 100644
--- a/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/deleteMeasure.xml
+++ b/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/deleteMeasure.xml
@@ -1,39 +1,39 @@
-<dataset>
-
- <snapshots period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="1" scope="PRJ" qualifier="TRK" created_at="2008-12-03 12:00: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 period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="2" scope="PRJ" qualifier="TRK" created_at="2008-12-04 12:00: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 period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="3" scope="PRJ" qualifier="TRK" created_at="2008-12-05 12:00: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]"/>
-
- <project_measures characteristic_id="[null]" url="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]"
- rule_priority="[null]"
- alert_text="[null]" id="1" project_id="1" metric_id="1" value="1"
- measure_date="2008-12-03 08:00:00.00" rule_id="[null]"
- snapshot_id="[null]" rules_category_id="[null]" text_value="[null]" tendency="[null]"/>
- <!-- async measure to be deleted -->
- <project_measures characteristic_id="[null]" url="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]"
- rule_priority="[null]"
- alert_text="[null]" id="2" project_id="1" metric_id="1" value="2"
- measure_date="2008-12-05 08:00:00.00" rule_id="[null]"
- snapshot_id="[null]" rules_category_id="[null]" text_value="[null]" tendency="[null]"/>
-
- <!-- old async measure snapshots -->
- <async_measure_snapshots id="1" project_measure_id="1" snapshot_id="[null]" measure_date="2008-12-03 08:00:00.00"
- snapshot_date="[null]" metric_id="1" project_id="1"/>
-
- <async_measure_snapshots id="2" project_measure_id="1" snapshot_id="1" measure_date="2008-12-03 08:00:00.00"
- snapshot_date="2008-12-03 12:00:00.00" metric_id="1" project_id="1"/>
- <async_measure_snapshots id="3" project_measure_id="1" snapshot_id="2" measure_date="2008-12-03 08:00:00.00"
- snapshot_date="2008-12-04 12:00:00.00" metric_id="1" project_id="1"/>
- <async_measure_snapshots id="4" project_measure_id="2" snapshot_id="3" measure_date="2008-12-05 08:00:00.00"
- snapshot_date="2008-12-05 12:00:00.00" metric_id="1" project_id="1"/>
-
+<dataset>
+
+ <snapshots period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="1" scope="PRJ" qualifier="TRK" created_at="2008-12-03 12:00: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 period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="2" scope="PRJ" qualifier="TRK" created_at="2008-12-04 12:00: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 period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="3" scope="PRJ" qualifier="TRK" created_at="2008-12-05 12:00: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]"/>
+
+ <project_measures characteristic_id="[null]" url="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]"
+ rule_priority="[null]"
+ alert_text="[null]" id="1" project_id="1" metric_id="1" value="1"
+ measure_date="2008-12-03 08:00:00.00" rule_id="[null]"
+ snapshot_id="[null]" rules_category_id="[null]" text_value="[null]" tendency="[null]"/>
+ <!-- async measure to be deleted -->
+ <project_measures characteristic_id="[null]" url="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]"
+ rule_priority="[null]"
+ alert_text="[null]" id="2" project_id="1" metric_id="1" value="2"
+ measure_date="2008-12-05 08:00:00.00" rule_id="[null]"
+ snapshot_id="[null]" rules_category_id="[null]" text_value="[null]" tendency="[null]"/>
+
+ <!-- old async measure snapshots -->
+ <async_measure_snapshots id="1" project_measure_id="1" snapshot_id="[null]" measure_date="2008-12-03 08:00:00.00"
+ snapshot_date="[null]" metric_id="1" project_id="1"/>
+
+ <async_measure_snapshots id="2" project_measure_id="1" snapshot_id="1" measure_date="2008-12-03 08:00:00.00"
+ snapshot_date="2008-12-03 12:00:00.00" metric_id="1" project_id="1"/>
+ <async_measure_snapshots id="3" project_measure_id="1" snapshot_id="2" measure_date="2008-12-03 08:00:00.00"
+ snapshot_date="2008-12-04 12:00:00.00" metric_id="1" project_id="1"/>
+ <async_measure_snapshots id="4" project_measure_id="2" snapshot_id="3" measure_date="2008-12-05 08:00:00.00"
+ snapshot_date="2008-12-05 12:00:00.00" metric_id="1" project_id="1"/>
+
</dataset> \ No newline at end of file
diff --git a/sonar-core/src/test/resources/org/sonar/jpa/dao/ProfilesDaoTest/shouldGetProfiles.xml b/sonar-core/src/test/resources/org/sonar/jpa/dao/ProfilesDaoTest/shouldGetProfiles.xml
index 3325d8baf74..ca00e8cb5c4 100644
--- a/sonar-core/src/test/resources/org/sonar/jpa/dao/ProfilesDaoTest/shouldGetProfiles.xml
+++ b/sonar-core/src/test/resources/org/sonar/jpa/dao/ProfilesDaoTest/shouldGetProfiles.xml
@@ -1,7 +1,7 @@
-<dataset>
-
- <rules_profiles id="1" provided="true" name="profile one" default_profile="0" language="java" enabled="true"/>
- <rules_profiles id="2" provided="true" name="profile two" default_profile="0" language="java" enabled="true"/>
- <rules_profiles id="3" provided="true" name="profile three" default_profile="0" language="plsql" enabled="true"/>
-
+<dataset>
+
+ <rules_profiles id="1" provided="true" name="profile one" default_profile="0" language="java" enabled="true"/>
+ <rules_profiles id="2" provided="true" name="profile two" default_profile="0" language="java" enabled="true"/>
+ <rules_profiles id="3" provided="true" name="profile three" default_profile="0" language="plsql" enabled="true"/>
+
</dataset> \ No newline at end of file
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 94757dbf118..c749a99827e 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,19 +1,19 @@
-<dataset>
-
- <rules_categories id="1" name="category one" description="[null]"/>
-
- <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"/>
-
- <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]"/>
- <rules id="2" name="bar" description="test" plugin_config_key="checker/bar"
- plugin_rule_key="checkstyle.rule2" plugin_name="plugin" enabled="true" cardinality="SINGLE" parent_id="[null]"/>
- <rules id="3" name="baz" description="test" plugin_config_key="checker/baz"
- plugin_rule_key="checkstyle.rule3" plugin_name="plugin" enabled="true" cardinality="SINGLE" parent_id="[null]"/>
-
- <active_rules id="1" profile_id="1" rule_id="1" failure_level="2"/>
- <active_rules id="2" profile_id="1" rule_id="2" failure_level="2"/>
- <active_rules id="3" profile_id="1" rule_id="3" failure_level="2"/>
-
+<dataset>
+
+ <rules_categories id="1" name="category one" description="[null]"/>
+
+ <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"/>
+
+ <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]"/>
+ <rules id="2" name="bar" description="test" plugin_config_key="checker/bar"
+ plugin_rule_key="checkstyle.rule2" plugin_name="plugin" enabled="true" cardinality="SINGLE" parent_id="[null]"/>
+ <rules id="3" name="baz" description="test" plugin_config_key="checker/baz"
+ plugin_rule_key="checkstyle.rule3" plugin_name="plugin" enabled="true" cardinality="SINGLE" parent_id="[null]"/>
+
+ <active_rules id="1" profile_id="1" rule_id="1" failure_level="2"/>
+ <active_rules id="2" profile_id="1" rule_id="2" failure_level="2"/>
+ <active_rules id="3" profile_id="1" rule_id="3" failure_level="2"/>
+
</dataset> \ No newline at end of file
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 de59da7e6e7..428fe6d8b44 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,23 +1,23 @@
-<dataset>
-
- <rules_categories id="1" name="category one" description="[null]"/>
-
- <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"/>
-
- <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]"/>
- <rules id="2" name="bar" description="test" plugin_config_key="checker/bar"
- plugin_rule_key="checkstyle.rule2" plugin_name="plugin" enabled="true" cardinality="SINGLE" parent_id="[null]"/>
- <rules id="3" name="baz" description="test" plugin_config_key="checker/baz"
- plugin_rule_key="checkstyle.rule3" plugin_name="plugin" enabled="true" cardinality="SINGLE" parent_id="[null]"/>
-
- <active_rules id="1" profile_id="1" rule_id="1" failure_level="2"/>
- <active_rules id="2" profile_id="1" rule_id="2" failure_level="2"/>
- <active_rules id="3" profile_id="1" rule_id="3" failure_level="2"/>
-
- <active_rules id="4" profile_id="2" rule_id="1" failure_level="2"/>
- <active_rules id="5" profile_id="2" rule_id="2" failure_level="2"/>
- <active_rules id="6" profile_id="2" rule_id="3" failure_level="2"/>
-
+<dataset>
+
+ <rules_categories id="1" name="category one" description="[null]"/>
+
+ <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"/>
+
+ <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]"/>
+ <rules id="2" name="bar" description="test" plugin_config_key="checker/bar"
+ plugin_rule_key="checkstyle.rule2" plugin_name="plugin" enabled="true" cardinality="SINGLE" parent_id="[null]"/>
+ <rules id="3" name="baz" description="test" plugin_config_key="checker/baz"
+ plugin_rule_key="checkstyle.rule3" plugin_name="plugin" enabled="true" cardinality="SINGLE" parent_id="[null]"/>
+
+ <active_rules id="1" profile_id="1" rule_id="1" failure_level="2"/>
+ <active_rules id="2" profile_id="1" rule_id="2" failure_level="2"/>
+ <active_rules id="3" profile_id="1" rule_id="3" failure_level="2"/>
+
+ <active_rules id="4" profile_id="2" rule_id="1" failure_level="2"/>
+ <active_rules id="5" profile_id="2" rule_id="2" failure_level="2"/>
+ <active_rules id="6" profile_id="2" rule_id="3" failure_level="2"/>
+
</dataset> \ No newline at end of file
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 94757dbf118..c749a99827e 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,19 +1,19 @@
-<dataset>
-
- <rules_categories id="1" name="category one" description="[null]"/>
-
- <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"/>
-
- <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]"/>
- <rules id="2" name="bar" description="test" plugin_config_key="checker/bar"
- plugin_rule_key="checkstyle.rule2" plugin_name="plugin" enabled="true" cardinality="SINGLE" parent_id="[null]"/>
- <rules id="3" name="baz" description="test" plugin_config_key="checker/baz"
- plugin_rule_key="checkstyle.rule3" plugin_name="plugin" enabled="true" cardinality="SINGLE" parent_id="[null]"/>
-
- <active_rules id="1" profile_id="1" rule_id="1" failure_level="2"/>
- <active_rules id="2" profile_id="1" rule_id="2" failure_level="2"/>
- <active_rules id="3" profile_id="1" rule_id="3" failure_level="2"/>
-
+<dataset>
+
+ <rules_categories id="1" name="category one" description="[null]"/>
+
+ <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"/>
+
+ <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]"/>
+ <rules id="2" name="bar" description="test" plugin_config_key="checker/bar"
+ plugin_rule_key="checkstyle.rule2" plugin_name="plugin" enabled="true" cardinality="SINGLE" parent_id="[null]"/>
+ <rules id="3" name="baz" description="test" plugin_config_key="checker/baz"
+ plugin_rule_key="checkstyle.rule3" plugin_name="plugin" enabled="true" cardinality="SINGLE" parent_id="[null]"/>
+
+ <active_rules id="1" profile_id="1" rule_id="1" failure_level="2"/>
+ <active_rules id="2" profile_id="1" rule_id="2" failure_level="2"/>
+ <active_rules id="3" profile_id="1" rule_id="3" failure_level="2"/>
+
</dataset> \ No newline at end of file
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 7df82f67476..97861d8b3f5 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,19 +1,19 @@
-<dataset>
-
- <rules_categories id="1" name="category one" description="[null]"/>
-
- <!-- Rules -->
- <rules id="1" name="new1" description="test1" plugin_config_key="checker/new1"
- plugin_rule_key="checkstyle.new1" plugin_name="PLUGIN_KEY" enabled="true" cardinality="SINGLE" parent_id="[null]"/>
- <rules id="2" name="new2" description="test2" plugin_config_key="checker/new2"
- plugin_rule_key="checkstyle.new2" plugin_name="PLUGIN_KEY" enabled="true" cardinality="SINGLE" parent_id="[null]"/>
-
- <!-- Rules parameters -->
- <rules_parameters id="1" rule_id="1" name="rule1_param1" description="rule1_desc1" param_type="r"
- />
- <rules_parameters id="2" rule_id="1" name="rule1_param2" description="rule1_desc2" param_type="r"
- />
- <rules_parameters id="3" rule_id="2" name="rule2_param1" description="rule2_desc1" param_type="r"
- />
-
+<dataset>
+
+ <rules_categories id="1" name="category one" description="[null]"/>
+
+ <!-- Rules -->
+ <rules id="1" name="new1" description="test1" plugin_config_key="checker/new1"
+ plugin_rule_key="checkstyle.new1" plugin_name="PLUGIN_KEY" enabled="true" cardinality="SINGLE" parent_id="[null]"/>
+ <rules id="2" name="new2" description="test2" plugin_config_key="checker/new2"
+ plugin_rule_key="checkstyle.new2" plugin_name="PLUGIN_KEY" enabled="true" cardinality="SINGLE" parent_id="[null]"/>
+
+ <!-- Rules parameters -->
+ <rules_parameters id="1" rule_id="1" name="rule1_param1" description="rule1_desc1" param_type="r"
+ />
+ <rules_parameters id="2" rule_id="1" name="rule1_param2" description="rule1_desc2" param_type="r"
+ />
+ <rules_parameters id="3" rule_id="2" name="rule2_param1" description="rule2_desc1" param_type="r"
+ />
+
</dataset> \ No newline at end of file
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 42176327e03..3ecb39c8d8d 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,8 +1,8 @@
-<dataset>
-
- <rules_categories id="1" name="category one" description="[null]"/>
-
- <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]"/>
-
+<dataset>
+
+ <rules_categories id="1" name="category one" description="[null]"/>
+
+ <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]"/>
+
</dataset> \ No newline at end of file
diff --git a/sonar-plugin-api/src/test/resources/META-INF/MANIFEST.MF b/sonar-plugin-api/src/test/resources/META-INF/MANIFEST.MF
index 1c312720b4d..ce807b4fa4a 100644
--- a/sonar-plugin-api/src/test/resources/META-INF/MANIFEST.MF
+++ b/sonar-plugin-api/src/test/resources/META-INF/MANIFEST.MF
@@ -1,6 +1,6 @@
-Manifest-Version: 1.0
-Archiver-Version: Plexus Archiver
-Created-By: Apache Maven
-Built-By: Sonar
-Build-Jdk: 1.5.0_09
-Plugin-Class: org.sonar.api.FakePlugin
+Manifest-Version: 1.0
+Archiver-Version: Plexus Archiver
+Created-By: Apache Maven
+Built-By: Sonar
+Build-Jdk: 1.5.0_09
+Plugin-Class: org.sonar.api.FakePlugin
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/components/_treemap_gradient.rhtml b/sonar-server/src/main/webapp/WEB-INF/app/views/components/_treemap_gradient.rhtml
index 220f4f9b7a9..635136285f6 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/views/components/_treemap_gradient.rhtml
+++ b/sonar-server/src/main/webapp/WEB-INF/app/views/components/_treemap_gradient.rhtml
@@ -1,20 +1,20 @@
-<%
-if color_metric && color_metric.worst_value && color_metric.best_value
- min=0
- max=0
- if color_metric.worst_value<color_metric.best_value
- min=color_metric.worst_value
- max=color_metric.best_value
- image = 'treemap_gradient.png'
- id = 'treemap_gradient_direction_positive'
- else
- min=color_metric.best_value
- max=color_metric.worst_value
- image = 'treemap_gradient_inverted.png'
- id = 'treemap_gradient_direction_negative'
- end
-%>
- <%= min -%><%= color_metric.suffix -%> <img id="<%= id -%>" src="<%= image_path image -%>" style="border: 1px solid #000; vertical-align:middle"> <%= max -%><%= color_metric.suffix -%>
-<%
-end
+<%
+if color_metric && color_metric.worst_value && color_metric.best_value
+ min=0
+ max=0
+ if color_metric.worst_value<color_metric.best_value
+ min=color_metric.worst_value
+ max=color_metric.best_value
+ image = 'treemap_gradient.png'
+ id = 'treemap_gradient_direction_positive'
+ else
+ min=color_metric.best_value
+ max=color_metric.worst_value
+ image = 'treemap_gradient_inverted.png'
+ id = 'treemap_gradient_direction_negative'
+ end
+%>
+ <%= min -%><%= color_metric.suffix -%> <img id="<%= id -%>" src="<%= image_path image -%>" style="border: 1px solid #000; vertical-align:middle"> <%= max -%><%= color_metric.suffix -%>
+<%
+end
%> \ No newline at end of file
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/components/_treemap_set_default.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/components/_treemap_set_default.html.erb
index 2b5d4679806..9b86f8d421f 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/views/components/_treemap_set_default.html.erb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/views/components/_treemap_set_default.html.erb
@@ -1,4 +1,4 @@
-<% form_tag(
- {:controller => controller, :action => "update_default_treemap_metrics", :size_metric => @treemap.size_metric.key, :color_metric => @treemap.color_metric.key, :rid => rid},
- :id => 'form_set_default') do %>
-<% end %>
+<% form_tag(
+ {:controller => controller, :action => "update_default_treemap_metrics", :size_metric => @treemap.size_metric.key, :color_metric => @treemap.color_metric.key, :rid => rid},
+ :id => 'form_set_default') do %>
+<% end %>
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/layouts/_breadcrumb.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/layouts/_breadcrumb.html.erb
index 55c23fab821..66344364c10 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/views/layouts/_breadcrumb.html.erb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/views/layouts/_breadcrumb.html.erb
@@ -1,26 +1,26 @@
-<ol id="crumbs">
- <li><a href="<%= ApplicationController.root_context -%>/">Home</a></li>
- <%
-if @snapshot
- resources=[]
- s=@snapshot
- while (s!=nil) do
- resources<<s.project
- s=s.parent
- end
-
- index=resources.size-1
- while (index>=0) do
- resource=resources[index]
-%>
- <li><%= qualifier_icon(resource) -%> <a href="<%= url_for :overwrite_params => { :id => resource.key } -%>"><%= h resource.name -%></a></li>
-<%
- index-=1
- end
-elsif @project
-%>
- <li><%= qualifier_icon(@project) -%> <a href="<%= url_for :overwrite_params => { :id => @project.key } -%>"><%= h @project.name -%></a></li>
-<%
-end
-%>
+<ol id="crumbs">
+ <li><a href="<%= ApplicationController.root_context -%>/">Home</a></li>
+ <%
+if @snapshot
+ resources=[]
+ s=@snapshot
+ while (s!=nil) do
+ resources<<s.project
+ s=s.parent
+ end
+
+ index=resources.size-1
+ while (index>=0) do
+ resource=resources[index]
+%>
+ <li><%= qualifier_icon(resource) -%> <a href="<%= url_for :overwrite_params => { :id => resource.key } -%>"><%= h resource.name -%></a></li>
+<%
+ index-=1
+ end
+elsif @project
+%>
+ <li><%= qualifier_icon(@project) -%> <a href="<%= url_for :overwrite_params => { :id => @project.key } -%>"><%= h @project.name -%></a></li>
+<%
+end
+%>
</ol> \ No newline at end of file
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/setup/dbdown.rhtml b/sonar-server/src/main/webapp/WEB-INF/app/views/setup/dbdown.rhtml
index 0cce193ad9f..cfb2a3049e9 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/views/setup/dbdown.rhtml
+++ b/sonar-server/src/main/webapp/WEB-INF/app/views/setup/dbdown.rhtml
@@ -1,21 +1,21 @@
-<h1>Database down.</h1>
-<div class="error">
- Database connection cannot be established. Check that you have a database running
- and configured for the following settings :
- <table>
- <tr>
- <td>URL: &nbsp;&nbsp;</td>
- <td><%= configuration('sonar.jdbc.url', '') -%>
- </tr>
- <tr>
- <td>Login: &nbsp;&nbsp;</td>
- <td><%= configuration('sonar.jdbc.username', '') -%>
- </tr>
- <tr>
- <td>Driver: &nbsp;&nbsp;</td>
- <td><%= configuration('sonar.jdbc.driverClassName', '') -%>
- </tr>
-</table>
- <br/><br/>
-<%= button_to "Try again", { :action => "index" }, :method => :get %>
+<h1>Database down.</h1>
+<div class="error">
+ Database connection cannot be established. Check that you have a database running
+ and configured for the following settings :
+ <table>
+ <tr>
+ <td>URL: &nbsp;&nbsp;</td>
+ <td><%= configuration('sonar.jdbc.url', '') -%>
+ </tr>
+ <tr>
+ <td>Login: &nbsp;&nbsp;</td>
+ <td><%= configuration('sonar.jdbc.username', '') -%>
+ </tr>
+ <tr>
+ <td>Driver: &nbsp;&nbsp;</td>
+ <td><%= configuration('sonar.jdbc.driverClassName', '') -%>
+ </tr>
+</table>
+ <br/><br/>
+<%= button_to "Try again", { :action => "index" }, :method => :get %>
</div> \ No newline at end of file
diff --git a/sonar-server/src/main/webapp/WEB-INF/config/locales/defaults/sk.yml b/sonar-server/src/main/webapp/WEB-INF/config/locales/defaults/sk.yml
index 14c6a282ebc..af659f50a9c 100755
--- a/sonar-server/src/main/webapp/WEB-INF/config/locales/defaults/sk.yml
+++ b/sonar-server/src/main/webapp/WEB-INF/config/locales/defaults/sk.yml
@@ -1,139 +1,139 @@
-# Sample localization file for English. Add more files in this directory for other locales.
-# See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points.
-
-# Slovak translations for Ruby on Rails (inspired by the Czech localization - thanx to Karel Minařík)
-# by Jozef Fulop (jofi-rails@silake.com)
-
-sk:
- # ActiveSupport
- support:
- array:
- words_connector: ', '
- two_words_connector: ' a '
- last_word_connector: ' a '
-
- # Date
- date:
- formats:
- default: "%d. %m. %Y"
- short: "%d %b"
- long: "%d. %B %Y"
- day_names: [NedeÄľa, Pondelok, Utorok, Streda, Ĺ tvrtok, Piatok, Sobota]
- abbr_day_names: [Ne, Po, Ut, St, Ĺ t, Pi, So]
- month_names: [~, Január, Február, Marec, Apríl, Máj, Jún, Júl, August, September, Október, November, December]
- abbr_month_names: [~, Jan, Feb, Mar, Apr, Máj, Jún, Júl, Aug, Sep, Okt, Nov, Dec]
- order: [:day, :month, :year]
-
- # Time
- time:
- formats:
- default: "%a %d. %B %Y %H:%M %z"
- short: "%d. %m. %H:%M"
- long: "%A %d. %B %Y %H:%M"
- am: 'dopoludnia'
- pm: 'popoludnĂ­'
-
- # Numbers
- number:
- format:
- precision: 3
- separator: '.'
- delimiter: ','
- currency:
- format:
- unit: '€'
- precision: 2
- format: '%n %u'
- separator: ","
- delimiter: " "
- human:
- format:
- precision: 1
- delimiter: ''
- storage_units:
- format: "%n %u"
- units:
- byte:
- other: "B"
- one: "B"
- kb: "KB"
- mb: "MB"
- gb: "GB"
- tb: "TB"
- percentage:
- format:
- delimiter: ''
- precision:
- format:
- delimiter: ''
-
- # Distance of time ... helper
- datetime:
- prompts:
- second: "Sekunda"
- minute: "MinĂşta"
- hour: "Hodina"
- day: "DeĹ"
- month: "Mesiac"
- year: "Rok"
- distance_in_words:
- half_a_minute: 'pol minutou'
- less_than_x_seconds:
- one: 'asi pred sekundou'
- other: 'asi pred {{count}} sekundami'
- x_seconds:
- one: 'sekundou'
- other: '{{count}} sekundami'
- less_than_x_minutes:
- one: 'pred necelou minĂştou'
- other: 'pred ani nie {{count}} minĂştami'
- x_minutes:
- one: 'minĂştou'
- other: '{{count}} minĂştami'
- about_x_hours:
- one: 'asi hodinou'
- other: 'asi {{count}} hodinami'
- x_days:
- one: '24 hodinami'
- other: '{{count}} dĹami'
- about_x_months:
- one: 'asi mesiacom'
- other: 'asi {{count}} mesiacmi'
- x_months:
- one: 'mesiacom'
- other: '{{count}} mesiacmi'
- about_x_years:
- one: 'asi rokom'
- other: 'asi {{count}} rokmi'
- over_x_years:
- one: 'pred viac ako rokom'
- other: 'viac ako {{count}} rokmi'
-
- # ActiveRecord validation messages
- activerecord:
- errors:
- messages:
- inclusion: "nie je v zozname povolených hodnôt"
- exclusion: "je vyhradené pre iný účel"
- invalid: "nie je platná hodnota"
- confirmation: "nebolo potvrdené"
- accepted: "musí byť potvrdené"
- empty: "nesmie byť prázdný/é"
- blank: "je povinná položka"
- too_long: "je príliš dlhá/ý (max. {{count}} znakov)"
- too_short: "je príliš krátký/á (min. {{count}} znakov)"
- wrong_length: "nemá správnu dĺžku (očakáva sa {{count}} znakov)"
- taken: "sa už nachádza v databáze"
- not_a_number: "nie je ÄŤĂ­slo"
- greater_than: "musí byť väčšíe ako {{count}}"
- greater_than_or_equal_to: "musí byť väčšie alebo rovnaké ako {{count}}"
- equal_to: "sa musĂ­ rovnaĹĄ {{count}}"
- less_than: "musí byť menšie ako {{count}}"
- less_than_or_equal_to: "musí byť menšie ako {{count}}"
- odd: "musí byť nepárne číslo"
- even: "musí byť párne číslo"
- template:
- header:
- one: "Pri ukladaní objektu {{model}} došlo k chybám a nebolo možné objekt uložiť"
- other: "Pri ukladaní objektu {{model}} došlo ku {{count}} chybe/ám a nebolo možné objekt uložiť"
- body: "Nasledujúce polia obsahujú chybne vyplnené údaje:"
+# Sample localization file for English. Add more files in this directory for other locales.
+# See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points.
+
+# Slovak translations for Ruby on Rails (inspired by the Czech localization - thanx to Karel Minařík)
+# by Jozef Fulop (jofi-rails@silake.com)
+
+sk:
+ # ActiveSupport
+ support:
+ array:
+ words_connector: ', '
+ two_words_connector: ' a '
+ last_word_connector: ' a '
+
+ # Date
+ date:
+ formats:
+ default: "%d. %m. %Y"
+ short: "%d %b"
+ long: "%d. %B %Y"
+ day_names: [NedeÄľa, Pondelok, Utorok, Streda, Ĺ tvrtok, Piatok, Sobota]
+ abbr_day_names: [Ne, Po, Ut, St, Ĺ t, Pi, So]
+ month_names: [~, Január, Február, Marec, Apríl, Máj, Jún, Júl, August, September, Október, November, December]
+ abbr_month_names: [~, Jan, Feb, Mar, Apr, Máj, Jún, Júl, Aug, Sep, Okt, Nov, Dec]
+ order: [:day, :month, :year]
+
+ # Time
+ time:
+ formats:
+ default: "%a %d. %B %Y %H:%M %z"
+ short: "%d. %m. %H:%M"
+ long: "%A %d. %B %Y %H:%M"
+ am: 'dopoludnia'
+ pm: 'popoludnĂ­'
+
+ # Numbers
+ number:
+ format:
+ precision: 3
+ separator: '.'
+ delimiter: ','
+ currency:
+ format:
+ unit: '€'
+ precision: 2
+ format: '%n %u'
+ separator: ","
+ delimiter: " "
+ human:
+ format:
+ precision: 1
+ delimiter: ''
+ storage_units:
+ format: "%n %u"
+ units:
+ byte:
+ other: "B"
+ one: "B"
+ kb: "KB"
+ mb: "MB"
+ gb: "GB"
+ tb: "TB"
+ percentage:
+ format:
+ delimiter: ''
+ precision:
+ format:
+ delimiter: ''
+
+ # Distance of time ... helper
+ datetime:
+ prompts:
+ second: "Sekunda"
+ minute: "MinĂşta"
+ hour: "Hodina"
+ day: "DeĹ"
+ month: "Mesiac"
+ year: "Rok"
+ distance_in_words:
+ half_a_minute: 'pol minutou'
+ less_than_x_seconds:
+ one: 'asi pred sekundou'
+ other: 'asi pred {{count}} sekundami'
+ x_seconds:
+ one: 'sekundou'
+ other: '{{count}} sekundami'
+ less_than_x_minutes:
+ one: 'pred necelou minĂştou'
+ other: 'pred ani nie {{count}} minĂştami'
+ x_minutes:
+ one: 'minĂştou'
+ other: '{{count}} minĂştami'
+ about_x_hours:
+ one: 'asi hodinou'
+ other: 'asi {{count}} hodinami'
+ x_days:
+ one: '24 hodinami'
+ other: '{{count}} dĹami'
+ about_x_months:
+ one: 'asi mesiacom'
+ other: 'asi {{count}} mesiacmi'
+ x_months:
+ one: 'mesiacom'
+ other: '{{count}} mesiacmi'
+ about_x_years:
+ one: 'asi rokom'
+ other: 'asi {{count}} rokmi'
+ over_x_years:
+ one: 'pred viac ako rokom'
+ other: 'viac ako {{count}} rokmi'
+
+ # ActiveRecord validation messages
+ activerecord:
+ errors:
+ messages:
+ inclusion: "nie je v zozname povolených hodnôt"
+ exclusion: "je vyhradené pre iný účel"
+ invalid: "nie je platná hodnota"
+ confirmation: "nebolo potvrdené"
+ accepted: "musí byť potvrdené"
+ empty: "nesmie byť prázdný/é"
+ blank: "je povinná položka"
+ too_long: "je príliš dlhá/ý (max. {{count}} znakov)"
+ too_short: "je príliš krátký/á (min. {{count}} znakov)"
+ wrong_length: "nemá správnu dĺžku (očakáva sa {{count}} znakov)"
+ taken: "sa už nachádza v databáze"
+ not_a_number: "nie je ÄŤĂ­slo"
+ greater_than: "musí byť väčšíe ako {{count}}"
+ greater_than_or_equal_to: "musí byť väčšie alebo rovnaké ako {{count}}"
+ equal_to: "sa musĂ­ rovnaĹĄ {{count}}"
+ less_than: "musí byť menšie ako {{count}}"
+ less_than_or_equal_to: "musí byť menšie ako {{count}}"
+ odd: "musí byť nepárne číslo"
+ even: "musí byť párne číslo"
+ template:
+ header:
+ one: "Pri ukladaní objektu {{model}} došlo k chybám a nebolo možné objekt uložiť"
+ other: "Pri ukladaní objektu {{model}} došlo ku {{count}} chybe/ám a nebolo možné objekt uložiť"
+ body: "Nasledujúce polia obsahujú chybne vyplnené údaje:"
diff --git a/sonar-server/src/main/webapp/javascripts/prototip.js b/sonar-server/src/main/webapp/javascripts/prototip.js
index b530fb3d092..d3e73862a3b 100644
--- a/sonar-server/src/main/webapp/javascripts/prototip.js
+++ b/sonar-server/src/main/webapp/javascripts/prototip.js
@@ -1,281 +1,281 @@
-// Prototip 1.0.2
-// by Nick Stakenburg - http://www.nickstakenburg.com
-// 08-08-2007
-//
-// More information on this project:
-// http://www.nickstakenburg.com/projects/prototip/
-//
-// Licensed under the Creative Commons Attribution 3.0 License
-// http://creativecommons.org/licenses/by/3.0/
-//
-
-var Tips = {
- tips: [],
- zIndex: 1200,
-
- add: function(tip) {
- this.tips.push(tip);
- },
-
- remove: function(element) {
- var tip = this.tips.find(function(t){ return t.element == $(element); });
- if (!tip) return;
-
- this.tips = this.tips.reject(function(t) { return t==tip; });
- tip.deactivate();
- if(tip.tooltip) tip.wrapper.remove();
- if(tip.underlay) tip.underlay.remove();
- }
-}
-
-var Tip = Class.create();
-Tip.prototype = {
-
- initialize: function(element, content) {
- this.element = $(element);
- Tips.remove(this.element);
-
- this.content = content;
-
- this.options = Object.extend({
- className: 'tooltip',
- duration: 0.3, // duration of the effect
- effect: false, // false, 'appear' or 'blind'
- hook: false, // { element: {'topLeft|topRight|bottomLeft|bottomRight'}, tip: {'topLeft|topRight|bottomLeft|bottomRight'}
- offset: (arguments[2] && arguments[2].hook) ? {x:0, y:0} : {x:16, y:16},
- fixed: false, // follow the mouse if false
- target: this.element, // or another element
- title: false,
- viewport: true // keep within viewport if mouse is followed
- }, arguments[2] || {});
-
- this.target = $(this.options.target);
-
- if (this.options.hook) {
- this.options.fixed = true;
- this.options.viewport = false;
- }
-
- if (this.options.effect) {
- this.queue = { position: 'end', limit: 1, scope: ''}
- var c = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz";
- for (var i=0; i<6; i++) {
- var r = Math.floor(Math.random() * c.length);
- this.queue.scope += c.substring(r,r+1);
- }
- }
-
- this.buildWrapper();
-
- Tips.add(this);
- this.activate();
- },
-
- activate: function() {
- this.eventShow = this.showTip.safeBind(this);
- this.eventHide = this.hideTip.safeBind(this);
-
- this.element.observe('mousemove', this.eventShow);
- this.element.observe('mouseout', this.eventHide);
- },
-
- deactivate: function() {
- this.element.stopObserving('mousemove', this.eventShow);
- this.element.stopObserving('mouseout', this.eventHide);
- },
-
- buildWrapper: function() {
- this.wrapper = document.createElement('div');
- Element.setStyle(this.wrapper, {
- position: 'absolute',
- zIndex: Tips.zIndex+1,
- display: 'none'
- });
-
- // IE select fix
- if (Prototype.Browser.IE) {
- this.underlay = document.createElement('iframe');
- this.underlay.src = 'javascript:;';
- Element.setStyle(this.underlay, {
- position: 'absolute',
- display: 'none',
- border: 0,
- margin: 0,
- opacity: 0.01,
- padding: 0,
- background: 'none',
- zIndex: Tips.zIndex
- });
- }
- },
-
- buildTip: function() {
- if(Prototype.Browser.IE) document.body.appendChild(this.underlay); // IE selectbox fix
-
- // add the tooltip
- this.tooltip = this.wrapper.appendChild(document.createElement('div'));
- this.tooltip.className = this.options.className;
- this.tooltip.style.position = 'relative';
-
- // add the title
- if (this.options.title) {
- this.title = this.tooltip.appendChild(document.createElement('div'));
- this.title.className = 'title';
- Element.update(this.title, this.options.title);
- }
-
- // content
- this.tip = this.tooltip.appendChild(document.createElement('div'));
- this.tip.className = 'content';
- Element.update(this.tip, this.content);
-
- // add wrapper to the body
- document.body.appendChild(this.wrapper);
-
- // prepare for effects
- var w = this.wrapper.getDimensions();
- this.wrapper.setStyle({ width: w.width+'px', height: w.height+'px' });
- if (Prototype.Browser.IE) this.underlay.setStyle({ width: w.width+'px', height: w.height+'px' });
- Element.hide(this.tooltip);
- },
-
- showTip: function(event){
- if (!this.tooltip) this.buildTip();
- this.positionTip(event); // follow mouse
- if (this.wrapper.visible() && this.options.effect != 'appear') return;
-
- if (Prototype.Browser.IE) this.underlay.show(); // IE select fix
- this.wrapper.show();
-
- if (!this.options.effect) {
- this.tooltip.show();
- } else {
- // stop running effect
- if (this.activeEffect) Effect.Queues.get(this.queue.scope).remove(this.activeEffect);
- // start new
- this.activeEffect = Effect[Effect.PAIRS[this.options.effect][0]](this.tooltip, { duration: this.options.duration, queue: this.queue});
- }
- },
-
- hideTip: function(event){
- if(!this.wrapper.visible()) return;
-
- if (!this.options.effect) {
- if (Prototype.Browser.IE) { this.underlay.hide(); } // select fix
- this.tooltip.hide();
- this.wrapper.hide();
- }
- else {
- // stop running effect
- if (this.activeEffect) Effect.Queues.get(this.queue.scope).remove(this.activeEffect);
- // start new
- this.activeEffect = Effect[Effect.PAIRS[this.options.effect][1]](this.tooltip, { duration: this.options.duration, queue: this.queue, afterFinish: function(){
- if (Prototype.Browser.IE) this.underlay.hide(); // select fix
- this.wrapper.hide();
- }.bind(this)});
- }
- },
-
- positionTip: function(event){
- // calculate
- var offset = {'left': this.options.offset.x,'top': this.options.offset.y};
- var targetPosition = Position.cumulativeOffset(this.target);
- var tipd = this.wrapper.getDimensions();
- var pos = {
- 'left': (this.options.fixed) ? targetPosition[0] : Event.pointerX(event),
- 'top': (this.options.fixed) ? targetPosition[1] : Event.pointerY(event)
- }
-
- // add offsets
- pos.left += offset.left;
- pos.top += offset.top;
-
- if (this.options.hook) {
- var dims = {'target': this.target.getDimensions(), 'tip': tipd}
- var hooks = {'target': Position.cumulativeOffset(this.target), 'tip': Position.cumulativeOffset(this.target)}
-
- for(var z in hooks) {
- switch(this.options.hook[z]){
- case 'topRight':
- hooks[z][0] += dims[z].width;
- break;
- case 'bottomLeft':
- hooks[z][1] += dims[z].height;
- break;
- case 'bottomRight':
- hooks[z][0] += dims[z].width;
- hooks[z][1] += dims[z].height;
- break;
- }
- }
-
- // move based on hooks
- pos.left += -1*(hooks.tip[0] - hooks.target[0]);
- pos.top += -1*(hooks.tip[1] - hooks.target[1]);
- }
-
- // move tooltip when there is a different target when following mouse
- if (!this.options.fixed && this.element !== this.target) {
- var elementPosition = Position.cumulativeOffset(this.element);
- pos.left += -1*(elementPosition[0] - targetPosition[0]);
- pos.top += -1*(elementPosition[1] - targetPosition[1]);
- }
-
- if (!this.options.fixed && this.options.viewport) {
- var scroll = this.getScrollOffsets();
- var viewport = this.viewportSize();
- var pair = {'left': 'width', 'top': 'height'};
-
- for(var z in pair) {
- if ((pos[z] + tipd[pair[z]] - scroll[z]) > viewport[pair[z]]) {
- pos[z] = pos[z] - tipd[pair[z]] - 2*offset[z];
- }
- }
- }
-
- // position
- this.wrapper.setStyle({
- left: pos.left + 'px',
- top: pos.top + 'px'
- });
-
- if (Prototype.Browser.IE) this.underlay.setStyle({ left: pos.left+'px', top: pos.top+'px' });
- },
-
- // Functions below hopefully won't be needed with prototype 1.6
- viewportWidth: function(){
- if (Prototype.Browser.Opera) return document.body.clientWidth;
- return document.documentElement.clientWidth;
- },
-
- viewportHeight: function(){
- if (Prototype.Browser.Opera) return document.body.clientHeight;
- if (Prototype.Browser.WebKit) return this.innerHeight;
- return document.documentElement.clientHeight;
- },
-
- viewportSize : function(){
- return {'height': this.viewportHeight(), 'width': this.viewportWidth()};
- },
-
- getScrollLeft: function(){
- return this.pageXOffset || document.documentElement.scrollLeft;
- },
-
- getScrollTop: function(){
- return this.pageYOffset || document.documentElement.scrollTop;
- },
-
- getScrollOffsets: function(){
- return {'left': this.getScrollLeft(), 'top': this.getScrollTop()}
- }
-}
-
-/* fix for $A is not defined on Firefox */
-Function.prototype.safeBind = function() {
- var __method = this, args = $A(arguments), object = args.shift();
- return function() {
- if (typeof $A == 'function')
- return __method.apply(object, args.concat($A(arguments)));
- }
+// Prototip 1.0.2
+// by Nick Stakenburg - http://www.nickstakenburg.com
+// 08-08-2007
+//
+// More information on this project:
+// http://www.nickstakenburg.com/projects/prototip/
+//
+// Licensed under the Creative Commons Attribution 3.0 License
+// http://creativecommons.org/licenses/by/3.0/
+//
+
+var Tips = {
+ tips: [],
+ zIndex: 1200,
+
+ add: function(tip) {
+ this.tips.push(tip);
+ },
+
+ remove: function(element) {
+ var tip = this.tips.find(function(t){ return t.element == $(element); });
+ if (!tip) return;
+
+ this.tips = this.tips.reject(function(t) { return t==tip; });
+ tip.deactivate();
+ if(tip.tooltip) tip.wrapper.remove();
+ if(tip.underlay) tip.underlay.remove();
+ }
+}
+
+var Tip = Class.create();
+Tip.prototype = {
+
+ initialize: function(element, content) {
+ this.element = $(element);
+ Tips.remove(this.element);
+
+ this.content = content;
+
+ this.options = Object.extend({
+ className: 'tooltip',
+ duration: 0.3, // duration of the effect
+ effect: false, // false, 'appear' or 'blind'
+ hook: false, // { element: {'topLeft|topRight|bottomLeft|bottomRight'}, tip: {'topLeft|topRight|bottomLeft|bottomRight'}
+ offset: (arguments[2] && arguments[2].hook) ? {x:0, y:0} : {x:16, y:16},
+ fixed: false, // follow the mouse if false
+ target: this.element, // or another element
+ title: false,
+ viewport: true // keep within viewport if mouse is followed
+ }, arguments[2] || {});
+
+ this.target = $(this.options.target);
+
+ if (this.options.hook) {
+ this.options.fixed = true;
+ this.options.viewport = false;
+ }
+
+ if (this.options.effect) {
+ this.queue = { position: 'end', limit: 1, scope: ''}
+ var c = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz";
+ for (var i=0; i<6; i++) {
+ var r = Math.floor(Math.random() * c.length);
+ this.queue.scope += c.substring(r,r+1);
+ }
+ }
+
+ this.buildWrapper();
+
+ Tips.add(this);
+ this.activate();
+ },
+
+ activate: function() {
+ this.eventShow = this.showTip.safeBind(this);
+ this.eventHide = this.hideTip.safeBind(this);
+
+ this.element.observe('mousemove', this.eventShow);
+ this.element.observe('mouseout', this.eventHide);
+ },
+
+ deactivate: function() {
+ this.element.stopObserving('mousemove', this.eventShow);
+ this.element.stopObserving('mouseout', this.eventHide);
+ },
+
+ buildWrapper: function() {
+ this.wrapper = document.createElement('div');
+ Element.setStyle(this.wrapper, {
+ position: 'absolute',
+ zIndex: Tips.zIndex+1,
+ display: 'none'
+ });
+
+ // IE select fix
+ if (Prototype.Browser.IE) {
+ this.underlay = document.createElement('iframe');
+ this.underlay.src = 'javascript:;';
+ Element.setStyle(this.underlay, {
+ position: 'absolute',
+ display: 'none',
+ border: 0,
+ margin: 0,
+ opacity: 0.01,
+ padding: 0,
+ background: 'none',
+ zIndex: Tips.zIndex
+ });
+ }
+ },
+
+ buildTip: function() {
+ if(Prototype.Browser.IE) document.body.appendChild(this.underlay); // IE selectbox fix
+
+ // add the tooltip
+ this.tooltip = this.wrapper.appendChild(document.createElement('div'));
+ this.tooltip.className = this.options.className;
+ this.tooltip.style.position = 'relative';
+
+ // add the title
+ if (this.options.title) {
+ this.title = this.tooltip.appendChild(document.createElement('div'));
+ this.title.className = 'title';
+ Element.update(this.title, this.options.title);
+ }
+
+ // content
+ this.tip = this.tooltip.appendChild(document.createElement('div'));
+ this.tip.className = 'content';
+ Element.update(this.tip, this.content);
+
+ // add wrapper to the body
+ document.body.appendChild(this.wrapper);
+
+ // prepare for effects
+ var w = this.wrapper.getDimensions();
+ this.wrapper.setStyle({ width: w.width+'px', height: w.height+'px' });
+ if (Prototype.Browser.IE) this.underlay.setStyle({ width: w.width+'px', height: w.height+'px' });
+ Element.hide(this.tooltip);
+ },
+
+ showTip: function(event){
+ if (!this.tooltip) this.buildTip();
+ this.positionTip(event); // follow mouse
+ if (this.wrapper.visible() && this.options.effect != 'appear') return;
+
+ if (Prototype.Browser.IE) this.underlay.show(); // IE select fix
+ this.wrapper.show();
+
+ if (!this.options.effect) {
+ this.tooltip.show();
+ } else {
+ // stop running effect
+ if (this.activeEffect) Effect.Queues.get(this.queue.scope).remove(this.activeEffect);
+ // start new
+ this.activeEffect = Effect[Effect.PAIRS[this.options.effect][0]](this.tooltip, { duration: this.options.duration, queue: this.queue});
+ }
+ },
+
+ hideTip: function(event){
+ if(!this.wrapper.visible()) return;
+
+ if (!this.options.effect) {
+ if (Prototype.Browser.IE) { this.underlay.hide(); } // select fix
+ this.tooltip.hide();
+ this.wrapper.hide();
+ }
+ else {
+ // stop running effect
+ if (this.activeEffect) Effect.Queues.get(this.queue.scope).remove(this.activeEffect);
+ // start new
+ this.activeEffect = Effect[Effect.PAIRS[this.options.effect][1]](this.tooltip, { duration: this.options.duration, queue: this.queue, afterFinish: function(){
+ if (Prototype.Browser.IE) this.underlay.hide(); // select fix
+ this.wrapper.hide();
+ }.bind(this)});
+ }
+ },
+
+ positionTip: function(event){
+ // calculate
+ var offset = {'left': this.options.offset.x,'top': this.options.offset.y};
+ var targetPosition = Position.cumulativeOffset(this.target);
+ var tipd = this.wrapper.getDimensions();
+ var pos = {
+ 'left': (this.options.fixed) ? targetPosition[0] : Event.pointerX(event),
+ 'top': (this.options.fixed) ? targetPosition[1] : Event.pointerY(event)
+ }
+
+ // add offsets
+ pos.left += offset.left;
+ pos.top += offset.top;
+
+ if (this.options.hook) {
+ var dims = {'target': this.target.getDimensions(), 'tip': tipd}
+ var hooks = {'target': Position.cumulativeOffset(this.target), 'tip': Position.cumulativeOffset(this.target)}
+
+ for(var z in hooks) {
+ switch(this.options.hook[z]){
+ case 'topRight':
+ hooks[z][0] += dims[z].width;
+ break;
+ case 'bottomLeft':
+ hooks[z][1] += dims[z].height;
+ break;
+ case 'bottomRight':
+ hooks[z][0] += dims[z].width;
+ hooks[z][1] += dims[z].height;
+ break;
+ }
+ }
+
+ // move based on hooks
+ pos.left += -1*(hooks.tip[0] - hooks.target[0]);
+ pos.top += -1*(hooks.tip[1] - hooks.target[1]);
+ }
+
+ // move tooltip when there is a different target when following mouse
+ if (!this.options.fixed && this.element !== this.target) {
+ var elementPosition = Position.cumulativeOffset(this.element);
+ pos.left += -1*(elementPosition[0] - targetPosition[0]);
+ pos.top += -1*(elementPosition[1] - targetPosition[1]);
+ }
+
+ if (!this.options.fixed && this.options.viewport) {
+ var scroll = this.getScrollOffsets();
+ var viewport = this.viewportSize();
+ var pair = {'left': 'width', 'top': 'height'};
+
+ for(var z in pair) {
+ if ((pos[z] + tipd[pair[z]] - scroll[z]) > viewport[pair[z]]) {
+ pos[z] = pos[z] - tipd[pair[z]] - 2*offset[z];
+ }
+ }
+ }
+
+ // position
+ this.wrapper.setStyle({
+ left: pos.left + 'px',
+ top: pos.top + 'px'
+ });
+
+ if (Prototype.Browser.IE) this.underlay.setStyle({ left: pos.left+'px', top: pos.top+'px' });
+ },
+
+ // Functions below hopefully won't be needed with prototype 1.6
+ viewportWidth: function(){
+ if (Prototype.Browser.Opera) return document.body.clientWidth;
+ return document.documentElement.clientWidth;
+ },
+
+ viewportHeight: function(){
+ if (Prototype.Browser.Opera) return document.body.clientHeight;
+ if (Prototype.Browser.WebKit) return this.innerHeight;
+ return document.documentElement.clientHeight;
+ },
+
+ viewportSize : function(){
+ return {'height': this.viewportHeight(), 'width': this.viewportWidth()};
+ },
+
+ getScrollLeft: function(){
+ return this.pageXOffset || document.documentElement.scrollLeft;
+ },
+
+ getScrollTop: function(){
+ return this.pageYOffset || document.documentElement.scrollTop;
+ },
+
+ getScrollOffsets: function(){
+ return {'left': this.getScrollLeft(), 'top': this.getScrollTop()}
+ }
+}
+
+/* fix for $A is not defined on Firefox */
+Function.prototype.safeBind = function() {
+ var __method = this, args = $A(arguments), object = args.shift();
+ return function() {
+ if (typeof $A == 'function')
+ return __method.apply(object, args.concat($A(arguments)));
+ }
} \ No newline at end of file
diff --git a/sonar-server/src/main/webapp/javascripts/tablekit.js b/sonar-server/src/main/webapp/javascripts/tablekit.js
index 3bc154d7b4b..ddc5643a2f9 100644
--- a/sonar-server/src/main/webapp/javascripts/tablekit.js
+++ b/sonar-server/src/main/webapp/javascripts/tablekit.js
@@ -1,853 +1,853 @@
-/*
-*
-* Copyright (c) 2007 Andrew Tetlaw & Millstream Web Software
-* http://www.millstream.com.au/view/code/tablekit/
-* Version: 1.2.1 2007-03-11
-*
-* Permission is hereby granted, free of charge, to any person
-* obtaining a copy of this software and associated documentation
-* files (the "Software"), to deal in the Software without
-* restriction, including without limitation the rights to use, copy,
-* modify, merge, publish, distribute, sublicense, and/or sell copies
-* of the Software, and to permit persons to whom the Software is
-* furnished to do so, subject to the following conditions:
-*
-* The above copyright notice and this permission notice shall be
-* included in all copies or substantial portions of the Software.
-*
-* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
-* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
-* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-* SOFTWARE.
-* *
-*/
-
-// Use the TableKit class constructure if you'd prefer to init your tables as JS objects
-var TableKit = Class.create();
-
-TableKit.prototype = {
- initialize : function(elm, options) {
- var table = $(elm);
- if(table.tagName !== "TABLE") {
- return;
- }
- TableKit.register(table,Object.extend(TableKit.options,options || {}));
- this.id = table.id;
- var op = TableKit.option('sortable resizable editable', this.id);
- if(op.sortable) {
- TableKit.Sortable.init(table);
- }
- if(op.resizable) {
- TableKit.Resizable.init(table);
- }
- if(op.editable) {
- TableKit.Editable.init(table);
- }
- },
- sort : function(column, order) {
- TableKit.Sortable.sort(this.id, column, order);
- },
- resizeColumn : function(column, w) {
- TableKit.Resizable.resize(this.id, column, w);
- },
- editCell : function(row, column) {
- TableKit.Editable.editCell(this.id, row, column);
- }
-};
-
-Object.extend(TableKit, {
- getBodyRows : function(table) {
- table = $(table);
- var id = table.id;
- if(!TableKit.rows[id]) {
- TableKit.rows[id] = (table.tHead && table.tHead.rows.length > 0) ? $A(table.tBodies[0].rows) : $A(table.rows).without(table.rows[0]);
- }
- return TableKit.rows[id];
- },
- getHeaderCells : function(table, cell) {
- if(!table) { table = $(cell).up('table'); }
- var id = table.id;
- if(!TableKit.heads[id]) {
- TableKit.heads[id] = $A((table.tHead && table.tHead.rows.length > 0) ? table.tHead.rows[table.tHead.rows.length-1].cells : table.rows[0].cells);
- }
- return TableKit.heads[id];
- },
- getCellIndex : function(cell) {
- return $A(cell.parentNode.cells).indexOf(cell);
- },
- getRowIndex : function(row) {
- return $A(row.parentNode.rows).indexOf(row);
- },
- getCellText : function(cell, refresh) {
- if(!cell) { return ""; }
- TableKit.registerCell(cell);
- var data = TableKit.cells[cell.id];
- if(refresh || data.refresh || !data.textContent) {
- // SONAR HACK : add an attribute x like <td x="25"> to directly set the value
- x = $(cell).readAttribute('x');
- if (x!=null && x!='') {
- data.textContent = x;
- } else {
- data.textContent = cell.textContent ? cell.textContent : cell.innerText;
- }
- data.refresh = false;
- }
- return data.textContent;
- },
- register : function(table, options) {
- if(!table.id) {
- TableKit._tblcount += 1;
- table.id = "tablekit-table-" + TableKit._tblcount;
- }
- var id = table.id;
- TableKit.tables[id] = TableKit.tables[id] ? Object.extend(TableKit.tables[id], options || {}) : Object.extend({sortable:false,resizable:false,editable:false}, options || {});
- },
- registerCell : function(cell) {
- if(!cell.id) {
- TableKit._cellcount += 1;
- cell.id = "tablekit-cell-" + TableKit._cellcount;
- }
- if(!TableKit.cells[cell.id]) {
- TableKit.cells[cell.id] = {textContent : '', htmlContent : '', active : false};
- }
- },
- isSortable : function(table) {
- return TableKit.tables[table.id] ? TableKit.tables[table.id].sortable : false;
- },
- isResizable : function(table) {
- return TableKit.tables[table.id] ? TableKit.tables[table.id].resizable : false;
- },
- isEditable : function(table) {
- return TableKit.tables[table.id] ? TableKit.tables[table.id].editable : false;
- },
- setup : function(o) {
- Object.extend(TableKit.options, o || {} );
- },
- option : function(s, id, o1, o2) {
- o1 = o1 || TableKit.options;
- o2 = o2 || (id ? (TableKit.tables[id] ? TableKit.tables[id] : {}) : {});
- var key = id + s;
- if(!TableKit._opcache[key]){
- TableKit._opcache[key] = $A($w(s)).inject([],function(a,v){
- a.push(a[v] = o2[v] || o1[v]);
- return a;
- });
- }
- return TableKit._opcache[key];
- },
- e : function(event) {
- return event || window.event;
- },
- tables : {},
- _opcache : {},
- cells : {},
- rows : {},
- heads : {},
- options : {
- autoLoad : false,
- stripe : true,
- sortable : true,
- resizable : true,
- editable : true,
- rowEvenClass : 'roweven',
- rowOddClass : 'rowodd',
- sortableSelector : ['table.sortable'],
- columnClass : 'sortcol',
- descendingClass : 'sortdesc',
- ascendingClass : 'sortasc',
- noSortClass : 'nosort',
- sortFirstAscendingClass : 'sortfirstasc',
- sortFirstDecendingClass : 'sortfirstdesc',
- resizableSelector : ['table.resizable'],
- minWidth : 10,
- showHandle : true,
- resizeOnHandleClass : 'resize-handle-active',
- editableSelector : ['table.editable'],
- formClassName : 'editable-cell-form',
- noEditClass : 'noedit',
- editAjaxURI : '/',
- editAjaxOptions : {}
- },
- _tblcount : 0,
- _cellcount : 0,
- load : function() {
- if(TableKit.options.autoLoad) {
- if(TableKit.options.sortable) {
- $A(TableKit.options.sortableSelector).each(function(s){
- $$(s).each(function(t) {
- TableKit.Sortable.init(t);
- });
- });
- }
- if(TableKit.options.resizable) {
- $A(TableKit.options.resizableSelector).each(function(s){
- $$(s).each(function(t) {
- TableKit.Resizable.init(t);
- });
- });
- }
- if(TableKit.options.editable) {
- $A(TableKit.options.editableSelector).each(function(s){
- $$(s).each(function(t) {
- TableKit.Editable.init(t);
- });
- });
- }
- }
- }
-});
-
-TableKit.Rows = {
- stripe : function(table) {
- var rows = TableKit.getBodyRows(table);
- rows.each(function(r,i) {
- TableKit.Rows.addStripeClass(table,r,i);
- });
- },
- addStripeClass : function(t,r,i) {
- t = t || r.up('table');
- var op = TableKit.option('rowEvenClass rowOddClass', t.id);
- var css = ((i+1)%2 === 0 ? op[0] : op[1]);
- // using prototype's assClassName/RemoveClassName was not efficient for large tables, hence:
- var cn = r.className.split(/\s+/);
- var newCn = [];
- for(var x = 0, l = cn.length; x < l; x += 1) {
- if(cn[x] !== op[0] && cn[x] !== op[1]) { newCn.push(cn[x]); }
- }
- newCn.push(css);
- r.className = newCn.join(" ");
- }
-};
-
-TableKit.Sortable = {
- init : function(elm, options){
- var table = $(elm);
- if(table.tagName !== "TABLE") {
- return;
- }
- TableKit.register(table,Object.extend(options || {},{sortable:true}));
- var sortFirst;
- var cells = TableKit.getHeaderCells(table);
- var op = TableKit.option('noSortClass columnClass sortFirstAscendingClass sortFirstDecendingClass', table.id);
- cells.each(function(c){
- c = $(c);
- if(!c.hasClassName(op.noSortClass)) {
- Event.observe(c, 'mousedown', TableKit.Sortable._sort);
- c.addClassName(op.columnClass);
- if(c.hasClassName(op.sortFirstAscendingClass) || c.hasClassName(op.sortFirstDecendingClass)) {
- sortFirst = c;
- }
- }
- });
-
- if(sortFirst) {
- if(sortFirst.hasClassName(op.sortFirstAscendingClass)) {
- TableKit.Sortable.sort(table, sortFirst, 1);
- } else {
- TableKit.Sortable.sort(table, sortFirst, -1);
- }
- } else { // just add row stripe classes
- TableKit.Rows.stripe(table);
- }
- },
- reload : function(table) {
- table = $(table);
- var cells = TableKit.getHeaderCells(table);
- var op = TableKit.option('noSortClass columnClass', table.id);
- cells.each(function(c){
- c = $(c);
- if(!c.hasClassName(op.noSortClass)) {
- Event.stopObserving(c, 'mousedown', TableKit.Sortable._sort);
- c.removeClassName(op.columnClass);
- }
- });
- TableKit.Sortable.init(table);
- },
- _sort : function(e) {
- if(TableKit.Resizable._onHandle) {return;}
- e = TableKit.e(e);
- Event.stop(e);
- var cell = Event.element(e);
- while(!(cell.tagName && cell.tagName.match(/td|th/gi))) {
- cell = cell.parentNode;
- }
- TableKit.Sortable.sort(null, cell);
- },
- sort : function(table, index, order) {
- var cell;
- if(typeof index === 'number') {
- if(!table || (table.tagName && table.tagName !== "TABLE")) {
- return;
- }
- table = $(table);
- index = Math.min(table.rows[0].cells.length, index);
- index = Math.max(1, index);
- index -= 1;
- cell = (table.tHead && table.tHead.rows.length > 0) ? $(table.tHead.rows[table.tHead.rows.length-1].cells[index]) : $(table.rows[0].cells[index]);
- } else {
- cell = $(index);
- table = table ? $(table) : cell.up('table');
- index = TableKit.getCellIndex(cell);
- }
- var op = TableKit.option('noSortClass descendingClass ascendingClass', table.id);
-
- if(cell.hasClassName(op.noSortClass)) {return;}
-
- order = order ? order : (cell.hasClassName(op.descendingClass) ? 1 : -1);
- var rows = TableKit.getBodyRows(table);
-
- if(cell.hasClassName(op.ascendingClass) || cell.hasClassName(op.descendingClass)) {
- rows.reverse(); // if it was already sorted we just need to reverse it.
- } else {
- var datatype = TableKit.Sortable.getDataType(cell,index,table);
- var tkst = TableKit.Sortable.types;
- rows.sort(function(a,b) {
- return order * tkst[datatype].compare(TableKit.getCellText(a.cells[index]),TableKit.getCellText(b.cells[index]));
- });
- }
- var tb = table.tBodies[0];
- var tkr = TableKit.Rows;
- rows.each(function(r,i) {
- tb.appendChild(r);
- //tkr.addStripeClass(table,r,i);
- });
- TableKit.Rows.stripe(table);
- var hcells = TableKit.getHeaderCells(null, cell);
- $A(hcells).each(function(c,i){
- c = $(c);
- c.removeClassName(op.ascendingClass);
- c.removeClassName(op.descendingClass);
- if(index === i) {
- if(order === 1) {
- c.removeClassName(op.descendingClass);
- c.addClassName(op.ascendingClass);
- } else {
- c.removeClassName(op.ascendingClass);
- c.addClassName(op.descendingClass);
- }
- }
- });
- },
- types : {},
- detectors : [],
- addSortType : function() {
- $A(arguments).each(function(o){
- TableKit.Sortable.types[o.name] = o;
- });
- },
- getDataType : function(cell,index,table) {
- cell = $(cell);
- index = (index || index === 0) ? index : TableKit.getCellIndex(cell);
-
- var colcache = TableKit.Sortable._coltypecache;
- var cache = colcache[table.id] ? colcache[table.id] : (colcache[table.id] = {});
-
- if(!cache[index]) {
- var t = '';
- // first look for a data type id on the heading row cell
- if(cell.id && TableKit.Sortable.types[cell.id]) {
- t = cell.id;
- }
- t = cell.classNames().detect(function(n){ // then look for a data type classname on the heading row cell
- return (TableKit.Sortable.types[n]) ? true : false;
- });
- if(!t) {
- var rows = TableKit.getBodyRows(table);
- cell = rows[0].cells[index]; // grab same index cell from body row to try and match data type
- t = TableKit.Sortable.detectors.detect(
- function(d){
- return TableKit.Sortable.types[d].detect(TableKit.getCellText(cell));
- });
- }
- cache[index] = t;
- }
- return cache[index];
- },
- _coltypecache : {}
-};
-
-TableKit.Sortable.detectors = $A($w('date-iso date date-eu date-au time currency datasize number casesensitivetext text')); // setting it here because Safari complained when I did it above...
-
-TableKit.Sortable.Type = Class.create();
-TableKit.Sortable.Type.prototype = {
- initialize : function(name, options){
- this.name = name;
- options = Object.extend({
- normal : function(v){
- return v;
- },
- pattern : /.*/
- }, options || {});
- this.normal = options.normal;
- this.pattern = options.pattern;
- if(options.compare) {
- this.compare = options.compare;
- }
- if(options.detect) {
- this.detect = options.detect;
- }
- },
- compare : function(a,b){
- return TableKit.Sortable.Type.compare(this.normal(a), this.normal(b));
- },
- detect : function(v){
- return this.pattern.test(v);
- }
-};
-
-TableKit.Sortable.Type.compare = function(a,b) {
- return a < b ? -1 : a === b ? 0 : 1;
-};
-
-TableKit.Sortable.addSortType(
- new TableKit.Sortable.Type('number', {
- pattern : /^[-+]?[\d]*\.?[\d]+(?:[eE][-+]?[\d]+)?/,
- normal : function(v) {
- // This will grab the first thing that looks like a number from a string, so you can use it to order a column of various srings containing numbers.
- v = parseFloat(v.replace(/^.*?([-+]?[\d]*\.?[\d]+(?:[eE][-+]?[\d]+)?).*$/,"$1"));
- return isNaN(v) ? 0 : v;
- }}),
- new TableKit.Sortable.Type('text',{
- normal : function(v) {
- return v ? v.toLowerCase() : '';
- }}),
- new TableKit.Sortable.Type('casesensitivetext',{pattern : /^[A-Z]+$/}),
- new TableKit.Sortable.Type('datasize',{
- pattern : /^[-+]?[\d]*\.?[\d]+(?:[eE][-+]?[\d]+)?\s?[k|m|g|t]b$/i,
- normal : function(v) {
- var r = v.match(/^([-+]?[\d]*\.?[\d]+([eE][-+]?[\d]+)?)\s?([k|m|g|t]?b)?/i);
- var b = r[1] ? Number(r[1]).valueOf() : 0;
- var m = r[3] ? r[3].substr(0,1).toLowerCase() : '';
- var result = b;
- switch(m) {
- case 'k':
- result = b * 1024;
- break;
- case 'm':
- result = b * 1024 * 1024;
- break;
- case 'g':
- result = b * 1024 * 1024 * 1024;
- break;
- case 't':
- result = b * 1024 * 1024 * 1024 * 1024;
- break;
- }
- return result;
- }}),
- new TableKit.Sortable.Type('date-au',{
- pattern : /^\d{2}\/\d{2}\/\d{4}\s?(?:\d{1,2}\:\d{2}(?:\:\d{2})?\s?[a|p]?m?)?/i,
- normal : function(v) {
- if(!this.pattern.test(v)) {return 0;}
- var r = v.match(/^(\d{2})\/(\d{2})\/(\d{4})\s?(?:(\d{1,2})\:(\d{2})(?:\:(\d{2}))?\s?([a|p]?m?))?/i);
- var yr_num = r[3];
- var mo_num = parseInt(r[2],10)-1;
- var day_num = r[1];
- var hr_num = r[4] ? r[4] : 0;
- if(r[7] && r[7].toLowerCase().indexOf('p') !== -1) {
- hr_num = parseInt(r[4],10) + 12;
- }
- var min_num = r[5] ? r[5] : 0;
- var sec_num = r[6] ? r[6] : 0;
- return new Date(yr_num, mo_num, day_num, hr_num, min_num, sec_num, 0).valueOf();
- }}),
- new TableKit.Sortable.Type('date-us',{
- pattern : /^\d{2}\/\d{2}\/\d{4}\s?(?:\d{1,2}\:\d{2}(?:\:\d{2})?\s?[a|p]?m?)?/i,
- normal : function(v) {
- if(!this.pattern.test(v)) {return 0;}
- var r = v.match(/^(\d{2})\/(\d{2})\/(\d{4})\s?(?:(\d{1,2})\:(\d{2})(?:\:(\d{2}))?\s?([a|p]?m?))?/i);
- var yr_num = r[3];
- var mo_num = parseInt(r[1],10)-1;
- var day_num = r[2];
- var hr_num = r[4] ? r[4] : 0;
- if(r[7] && r[7].toLowerCase().indexOf('p') !== -1) {
- hr_num = parseInt(r[4],10) + 12;
- }
- var min_num = r[5] ? r[5] : 0;
- var sec_num = r[6] ? r[6] : 0;
- return new Date(yr_num, mo_num, day_num, hr_num, min_num, sec_num, 0).valueOf();
- }}),
- new TableKit.Sortable.Type('date-eu',{
- pattern : /^\d{2}-\d{2}-\d{4}/i,
- normal : function(v) {
- if(!this.pattern.test(v)) {return 0;}
- var r = v.match(/^(\d{2})-(\d{2})-(\d{4})/);
- var yr_num = r[3];
- var mo_num = parseInt(r[2],10)-1;
- var day_num = r[1];
- return new Date(yr_num, mo_num, day_num).valueOf();
- }}),
- new TableKit.Sortable.Type('date-iso',{
- pattern : /[\d]{4}-[\d]{2}-[\d]{2}(?:T[\d]{2}\:[\d]{2}(?:\:[\d]{2}(?:\.[\d]+)?)?(Z|([-+][\d]{2}:[\d]{2})?)?)?/, // 2005-03-26T19:51:34Z
- normal : function(v) {
- if(!this.pattern.test(v)) {return 0;}
- var d = v.match(/([\d]{4})(-([\d]{2})(-([\d]{2})(T([\d]{2}):([\d]{2})(:([\d]{2})(\.([\d]+))?)?(Z|(([-+])([\d]{2}):([\d]{2})))?)?)?)?/);
- var offset = 0;
- var date = new Date(d[1], 0, 1);
- if (d[3]) { date.setMonth(d[3] - 1) ;}
- if (d[5]) { date.setDate(d[5]); }
- if (d[7]) { date.setHours(d[7]); }
- if (d[8]) { date.setMinutes(d[8]); }
- if (d[10]) { date.setSeconds(d[10]); }
- if (d[12]) { date.setMilliseconds(Number("0." + d[12]) * 1000); }
- if (d[14]) {
- offset = (Number(d[16]) * 60) + Number(d[17]);
- offset *= ((d[15] === '-') ? 1 : -1);
- }
- offset -= date.getTimezoneOffset();
- if(offset !== 0) {
- var time = (Number(date) + (offset * 60 * 1000));
- date.setTime(Number(time));
- }
- return date.valueOf();
- }}),
- new TableKit.Sortable.Type('date',{
- pattern: /^(?:sun|mon|tue|wed|thu|fri|sat)\,\s\d{1,2}\s(?:jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)\s\d{4}(?:\s\d{2}\:\d{2}(?:\:\d{2})?(?:\sGMT(?:[+-]\d{4})?)?)?/i, //Mon, 18 Dec 1995 17:28:35 GMT
- compare : function(a,b) { // must be standard javascript date format
- if(a && b) {
- return TableKit.Sortable.Type.compare(new Date(a),new Date(b));
- } else {
- return TableKit.Sortable.Type.compare(a ? 1 : 0, b ? 1 : 0);
- }
- }}),
- new TableKit.Sortable.Type('time',{
- pattern : /^\d{1,2}\:\d{2}(?:\:\d{2})?(?:\s[a|p]m)?$/i,
- compare : function(a,b) {
- var d = new Date();
- var ds = d.getMonth() + "/" + d.getDate() + "/" + d.getFullYear() + " ";
- return TableKit.Sortable.Type.compare(new Date(ds + a),new Date(ds + b));
- }}),
- new TableKit.Sortable.Type('currency',{
- pattern : /^[$ŁĄ€¤]/, // dollar,pound,yen,euro,generic currency symbol
- normal : function(v) {
- return v ? parseFloat(v.replace(/[^-\d\.]/g,'')) : 0;
- }})
-);
-
-TableKit.Resizable = {
- init : function(elm, options){
- var table = $(elm);
- if(table.tagName !== "TABLE") {return;}
- TableKit.register(table,Object.extend(options || {},{resizable:true}));
- var cells = TableKit.getHeaderCells(table);
- cells.each(function(c){
- c = $(c);
- Event.observe(c, 'mouseover', TableKit.Resizable.initDetect);
- Event.observe(c, 'mouseout', TableKit.Resizable.killDetect);
- });
- },
- resize : function(table, index, w) {
- var cell;
- if(typeof index === 'number') {
- if(!table || (table.tagName && table.tagName !== "TABLE")) {return;}
- table = $(table);
- index = Math.min(table.rows[0].cells.length, index);
- index = Math.max(1, index);
- index -= 1;
- cell = (table.tHead && table.tHead.rows.length > 0) ? $(table.tHead.rows[table.tHead.rows.length-1].cells[index]) : $(table.rows[0].cells[index]);
- } else {
- cell = $(index);
- table = table ? $(table) : cell.up('table');
- index = TableKit.getCellIndex(cell);
- }
- var pad = parseInt(cell.getStyle('paddingLeft'),10) + parseInt(cell.getStyle('paddingRight'),10);
- w = Math.max(w-pad, TableKit.option('minWidth', table.id)[0]);
-
- cell.setStyle({'width' : w + 'px'});
- },
- initDetect : function(e) {
- e = TableKit.e(e);
- var cell = Event.element(e);
- Event.observe(cell, 'mousemove', TableKit.Resizable.detectHandle);
- Event.observe(cell, 'mousedown', TableKit.Resizable.startResize);
- },
- detectHandle : function(e) {
- e = TableKit.e(e);
- var cell = Event.element(e);
- if(TableKit.Resizable.pointerPos(cell,Event.pointerX(e),Event.pointerY(e))){
- cell.addClassName(TableKit.option('resizeOnHandleClass', cell.up('table').id)[0]);
- TableKit.Resizable._onHandle = true;
- } else {
- cell.removeClassName(TableKit.option('resizeOnHandleClass', cell.up('table').id)[0]);
- TableKit.Resizable._onHandle = false;
- }
- },
- killDetect : function(e) {
- e = TableKit.e(e);
- TableKit.Resizable._onHandle = false;
- var cell = Event.element(e);
- Event.stopObserving(cell, 'mousemove', TableKit.Resizable.detectHandle);
- Event.stopObserving(cell, 'mousedown', TableKit.Resizable.startResize);
- cell.removeClassName(TableKit.option('resizeOnHandleClass', cell.up('table').id)[0]);
- },
- startResize : function(e) {
- e = TableKit.e(e);
- if(!TableKit.Resizable._onHandle) {return;}
- var cell = Event.element(e);
- Event.stopObserving(cell, 'mousemove', TableKit.Resizable.detectHandle);
- Event.stopObserving(cell, 'mousedown', TableKit.Resizable.startResize);
- Event.stopObserving(cell, 'mouseout', TableKit.Resizable.killDetect);
- TableKit.Resizable._cell = cell;
- var table = cell.up('table');
- TableKit.Resizable._tbl = table;
- if(TableKit.option('showHandle', table.id)[0]) {
- TableKit.Resizable._handle = $(document.createElement('div')).addClassName('resize-handle').setStyle({
- 'top' : Position.cumulativeOffset(cell)[1] + 'px',
- 'left' : Event.pointerX(e) + 'px',
- 'height' : table.getDimensions().height + 'px'
- });
- document.body.appendChild(TableKit.Resizable._handle);
- }
- Event.observe(document, 'mousemove', TableKit.Resizable.drag);
- Event.observe(document, 'mouseup', TableKit.Resizable.endResize);
- Event.stop(e);
- },
- endResize : function(e) {
- e = TableKit.e(e);
- var cell = TableKit.Resizable._cell;
- TableKit.Resizable.resize(null, cell, (Event.pointerX(e) - Position.cumulativeOffset(cell)[0]));
- Event.stopObserving(document, 'mousemove', TableKit.Resizable.drag);
- Event.stopObserving(document, 'mouseup', TableKit.Resizable.endResize);
- if(TableKit.option('showHandle', TableKit.Resizable._tbl.id)[0]) {
- $$('div.resize-handle').each(function(elm){
- document.body.removeChild(elm);
- });
- }
- Event.observe(cell, 'mouseout', TableKit.Resizable.killDetect);
- TableKit.Resizable._tbl = TableKit.Resizable._handle = TableKit.Resizable._cell = null;
- Event.stop(e);
- },
- drag : function(e) {
- e = TableKit.e(e);
- if(TableKit.Resizable._handle === null) {
- try {
- TableKit.Resizable.resize(TableKit.Resizable._tbl, TableKit.Resizable._cell, (Event.pointerX(e) - Position.cumulativeOffset(TableKit.Resizable._cell)[0]));
- } catch(e) {}
- } else {
- TableKit.Resizable._handle.setStyle({'left' : Event.pointerX(e) + 'px'});
- }
- return false;
- },
- pointerPos : function(element, x, y) {
- var offset = Position.cumulativeOffset(element);
- return (y >= offset[1] &&
- y < offset[1] + element.offsetHeight &&
- x >= offset[0] + element.offsetWidth - 5 &&
- x < offset[0] + element.offsetWidth);
- },
- _onHandle : false,
- _cell : null,
- _tbl : null,
- _handle : null
-};
-
-
-TableKit.Editable = {
- init : function(elm, options){
- var table = $(elm);
- if(table.tagName !== "TABLE") {return;}
- TableKit.register(table,Object.extend(options || {},{editable:true}));
- Event.observe(table.tBodies[0], 'click', TableKit.Editable._editCell);
- },
- _editCell : function(e) {
- e = TableKit.e(e);
- var cell = Event.findElement(e,'td');
- TableKit.Editable.editCell(null, cell);
- },
- editCell : function(table, index, cindex) {
- var cell, row;
- if(typeof index === 'number') {
- if(!table || (table.tagName && table.tagName !== "TABLE")) {return;}
- table = $(table);
- index = Math.min(table.tBodies[0].rows.length, index);
- index = Math.max(1, index);
- index -= 1;
- cindex = Math.min(table.rows[0].cells.length, cindex);
- cindex = Math.max(1, cindex);
- cindex -= 1;
- row = $(table.tBodies[0].rows[index]);
- cell = $(row.cells[cindex]);
- } else {
- cell = $(index);
- table = (table && table.tagName && table.tagName !== "TABLE") ? $(table) : cell.up('table');
- row = cell.up('tr');
- }
- var op = TableKit.option('noEditClass', table.id);
- if(cell.hasClassName(op.noEditClass)) {return;}
-
- var head = $(TableKit.getHeaderCells(table, cell)[TableKit.getCellIndex(cell)]);
- if(head.hasClassName(op.noEditClass)) {return;}
-
- TableKit.registerCell(cell);
- var data = TableKit.cells[cell.id];
- if(data.active) {return;}
- data.htmlContent = cell.innerHTML;
- var ftype = TableKit.Editable.types['text-input'];
- if(head.id && TableKit.Editable.types[head.id]) {
- ftype = TableKit.Editable.types[head.id];
- } else {
- var n = head.classNames().detect(function(n){
- return (TableKit.Editable.types[n]) ? true : false;
- });
- ftype = n ? TableKit.Editable.types[n] : ftype;
- }
- ftype.edit(cell);
- data.active = true;
- },
- types : {},
- addCellEditor : function(o) {
- if(o && o.name) { TableKit.Editable.types[o.name] = o; }
- }
-};
-
-TableKit.Editable.CellEditor = Class.create();
-TableKit.Editable.CellEditor.prototype = {
- initialize : function(name, options){
- this.name = name;
- this.options = Object.extend({
- element : 'input',
- attributes : {name : 'value', type : 'text'},
- selectOptions : [],
- showSubmit : true,
- submitText : 'OK',
- showCancel : true,
- cancelText : 'Cancel',
- ajaxURI : null,
- ajaxOptions : null
- }, options || {});
- },
- edit : function(cell) {
- cell = $(cell);
- var op = this.options;
- var table = cell.up('table');
-
- var form = $(document.createElement("form"));
- form.id = cell.id + '-form';
- form.addClassName(TableKit.option('formClassName', table.id)[0]);
- form.onsubmit = this._submit.bindAsEventListener(this);
-
- var field = document.createElement(op.element);
- $H(op.attributes).each(function(v){
- field[v.key] = v.value;
- });
- switch(op.element) {
- case 'input':
- case 'textarea':
- field.value = TableKit.getCellText(cell);
- break;
-
- case 'select':
- var txt = TableKit.getCellText(cell);
- $A(op.selectOptions).each(function(v){
- field.options[field.options.length] = new Option(v[0], v[1]);
- if(txt === v[1]) {
- field.options[field.options.length-1].selected = 'selected';
- }
- });
- break;
- }
- form.appendChild(field);
- if(op.element === 'textarea') {
- form.appendChild(document.createElement("br"));
- }
- if(op.showSubmit) {
- var okButton = document.createElement("input");
- okButton.type = "submit";
- okButton.value = op.submitText;
- okButton.className = 'editor_ok_button';
- form.appendChild(okButton);
- }
- if(op.showCancel) {
- var cancelLink = document.createElement("a");
- cancelLink.href = "#";
- cancelLink.appendChild(document.createTextNode(op.cancelText));
- cancelLink.onclick = this._cancel.bindAsEventListener(this);
- cancelLink.className = 'editor_cancel';
- form.appendChild(cancelLink);
- }
- cell.innerHTML = '';
- cell.appendChild(form);
- },
- _submit : function(e) {
- var cell = Event.findElement(e,'td');
- var form = Event.findElement(e,'form');
- Event.stop(e);
- this.submit(cell,form);
- },
- submit : function(cell, form) {
- var op = this.options;
- form = form ? form : cell.down('form');
- var head = $(TableKit.getHeaderCells(null, cell)[TableKit.getCellIndex(cell)]);
- var row = cell.up('tr');
- var table = cell.up('table');
- var s = '&row=' + (TableKit.getRowIndex(row)+1) + '&cell=' + (TableKit.getCellIndex(cell)+1) + '&id=' + row.id + '&field=' + head.id + '&' + Form.serialize(form);
- this.ajax = new Ajax.Updater(cell, op.ajaxURI || TableKit.option('editAjaxURI', table.id)[0], Object.extend(op.ajaxOptions || TableKit.option('editAjaxOptions', table.id)[0], {
- postBody : s,
- onComplete : function() {
- var data = TableKit.cells[cell.id];
- data.active = false;
- data.refresh = true; // mark cell cache for refreshing, in case cell contents has changed and sorting is applied
- }
- }));
- },
- _cancel : function(e) {
- var cell = Event.findElement(e,'td');
- Event.stop(e);
- this.cancel(cell);
- },
- cancel : function(cell) {
- this.ajax = null;
- var data = TableKit.cells[cell.id];
- cell.innerHTML = data.htmlContent;
- data.htmlContent = '';
- data.active = false;
- },
- ajax : null
-};
-
-TableKit.Editable.textInput = function(n,attributes) {
- TableKit.Editable.addCellEditor(new TableKit.Editable.CellEditor(n, {
- element : 'input',
- attributes : Object.extend({name : 'value', type : 'text'}, attributes||{})
- }));
-};
-TableKit.Editable.textInput('text-input');
-
-TableKit.Editable.multiLineInput = function(n,attributes) {
- TableKit.Editable.addCellEditor(new TableKit.Editable.CellEditor(n, {
- element : 'textarea',
- attributes : Object.extend({name : 'value', rows : '5', cols : '20'}, attributes||{})
- }));
-};
-TableKit.Editable.multiLineInput('multi-line-input');
-
-TableKit.Editable.selectInput = function(n,attributes,selectOptions) {
- TableKit.Editable.addCellEditor(new TableKit.Editable.CellEditor(n, {
- element : 'select',
- attributes : Object.extend({name : 'value'}, attributes||{}),
- 'selectOptions' : selectOptions
- }));
-};
-
-/*
-TableKit.Bench = {
- bench : [],
- start : function(){
- TableKit.Bench.bench[0] = new Date().getTime();
- },
- end : function(s){
- TableKit.Bench.bench[1] = new Date().getTime();
- alert(s + ' ' + ((TableKit.Bench.bench[1]-TableKit.Bench.bench[0])/1000)+' seconds.') //console.log(s + ' ' + ((TableKit.Bench.bench[1]-TableKit.Bench.bench[0])/1000)+' seconds.')
- TableKit.Bench.bench = [];
- }
-} */
-
-if(window.FastInit) {
- FastInit.addOnLoad(TableKit.load);
-} else {
- Event.observe(window, 'load', TableKit.load);
+/*
+*
+* Copyright (c) 2007 Andrew Tetlaw & Millstream Web Software
+* http://www.millstream.com.au/view/code/tablekit/
+* Version: 1.2.1 2007-03-11
+*
+* Permission is hereby granted, free of charge, to any person
+* obtaining a copy of this software and associated documentation
+* files (the "Software"), to deal in the Software without
+* restriction, including without limitation the rights to use, copy,
+* modify, merge, publish, distribute, sublicense, and/or sell copies
+* of the Software, and to permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be
+* included in all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+* SOFTWARE.
+* *
+*/
+
+// Use the TableKit class constructure if you'd prefer to init your tables as JS objects
+var TableKit = Class.create();
+
+TableKit.prototype = {
+ initialize : function(elm, options) {
+ var table = $(elm);
+ if(table.tagName !== "TABLE") {
+ return;
+ }
+ TableKit.register(table,Object.extend(TableKit.options,options || {}));
+ this.id = table.id;
+ var op = TableKit.option('sortable resizable editable', this.id);
+ if(op.sortable) {
+ TableKit.Sortable.init(table);
+ }
+ if(op.resizable) {
+ TableKit.Resizable.init(table);
+ }
+ if(op.editable) {
+ TableKit.Editable.init(table);
+ }
+ },
+ sort : function(column, order) {
+ TableKit.Sortable.sort(this.id, column, order);
+ },
+ resizeColumn : function(column, w) {
+ TableKit.Resizable.resize(this.id, column, w);
+ },
+ editCell : function(row, column) {
+ TableKit.Editable.editCell(this.id, row, column);
+ }
+};
+
+Object.extend(TableKit, {
+ getBodyRows : function(table) {
+ table = $(table);
+ var id = table.id;
+ if(!TableKit.rows[id]) {
+ TableKit.rows[id] = (table.tHead && table.tHead.rows.length > 0) ? $A(table.tBodies[0].rows) : $A(table.rows).without(table.rows[0]);
+ }
+ return TableKit.rows[id];
+ },
+ getHeaderCells : function(table, cell) {
+ if(!table) { table = $(cell).up('table'); }
+ var id = table.id;
+ if(!TableKit.heads[id]) {
+ TableKit.heads[id] = $A((table.tHead && table.tHead.rows.length > 0) ? table.tHead.rows[table.tHead.rows.length-1].cells : table.rows[0].cells);
+ }
+ return TableKit.heads[id];
+ },
+ getCellIndex : function(cell) {
+ return $A(cell.parentNode.cells).indexOf(cell);
+ },
+ getRowIndex : function(row) {
+ return $A(row.parentNode.rows).indexOf(row);
+ },
+ getCellText : function(cell, refresh) {
+ if(!cell) { return ""; }
+ TableKit.registerCell(cell);
+ var data = TableKit.cells[cell.id];
+ if(refresh || data.refresh || !data.textContent) {
+ // SONAR HACK : add an attribute x like <td x="25"> to directly set the value
+ x = $(cell).readAttribute('x');
+ if (x!=null && x!='') {
+ data.textContent = x;
+ } else {
+ data.textContent = cell.textContent ? cell.textContent : cell.innerText;
+ }
+ data.refresh = false;
+ }
+ return data.textContent;
+ },
+ register : function(table, options) {
+ if(!table.id) {
+ TableKit._tblcount += 1;
+ table.id = "tablekit-table-" + TableKit._tblcount;
+ }
+ var id = table.id;
+ TableKit.tables[id] = TableKit.tables[id] ? Object.extend(TableKit.tables[id], options || {}) : Object.extend({sortable:false,resizable:false,editable:false}, options || {});
+ },
+ registerCell : function(cell) {
+ if(!cell.id) {
+ TableKit._cellcount += 1;
+ cell.id = "tablekit-cell-" + TableKit._cellcount;
+ }
+ if(!TableKit.cells[cell.id]) {
+ TableKit.cells[cell.id] = {textContent : '', htmlContent : '', active : false};
+ }
+ },
+ isSortable : function(table) {
+ return TableKit.tables[table.id] ? TableKit.tables[table.id].sortable : false;
+ },
+ isResizable : function(table) {
+ return TableKit.tables[table.id] ? TableKit.tables[table.id].resizable : false;
+ },
+ isEditable : function(table) {
+ return TableKit.tables[table.id] ? TableKit.tables[table.id].editable : false;
+ },
+ setup : function(o) {
+ Object.extend(TableKit.options, o || {} );
+ },
+ option : function(s, id, o1, o2) {
+ o1 = o1 || TableKit.options;
+ o2 = o2 || (id ? (TableKit.tables[id] ? TableKit.tables[id] : {}) : {});
+ var key = id + s;
+ if(!TableKit._opcache[key]){
+ TableKit._opcache[key] = $A($w(s)).inject([],function(a,v){
+ a.push(a[v] = o2[v] || o1[v]);
+ return a;
+ });
+ }
+ return TableKit._opcache[key];
+ },
+ e : function(event) {
+ return event || window.event;
+ },
+ tables : {},
+ _opcache : {},
+ cells : {},
+ rows : {},
+ heads : {},
+ options : {
+ autoLoad : false,
+ stripe : true,
+ sortable : true,
+ resizable : true,
+ editable : true,
+ rowEvenClass : 'roweven',
+ rowOddClass : 'rowodd',
+ sortableSelector : ['table.sortable'],
+ columnClass : 'sortcol',
+ descendingClass : 'sortdesc',
+ ascendingClass : 'sortasc',
+ noSortClass : 'nosort',
+ sortFirstAscendingClass : 'sortfirstasc',
+ sortFirstDecendingClass : 'sortfirstdesc',
+ resizableSelector : ['table.resizable'],
+ minWidth : 10,
+ showHandle : true,
+ resizeOnHandleClass : 'resize-handle-active',
+ editableSelector : ['table.editable'],
+ formClassName : 'editable-cell-form',
+ noEditClass : 'noedit',
+ editAjaxURI : '/',
+ editAjaxOptions : {}
+ },
+ _tblcount : 0,
+ _cellcount : 0,
+ load : function() {
+ if(TableKit.options.autoLoad) {
+ if(TableKit.options.sortable) {
+ $A(TableKit.options.sortableSelector).each(function(s){
+ $$(s).each(function(t) {
+ TableKit.Sortable.init(t);
+ });
+ });
+ }
+ if(TableKit.options.resizable) {
+ $A(TableKit.options.resizableSelector).each(function(s){
+ $$(s).each(function(t) {
+ TableKit.Resizable.init(t);
+ });
+ });
+ }
+ if(TableKit.options.editable) {
+ $A(TableKit.options.editableSelector).each(function(s){
+ $$(s).each(function(t) {
+ TableKit.Editable.init(t);
+ });
+ });
+ }
+ }
+ }
+});
+
+TableKit.Rows = {
+ stripe : function(table) {
+ var rows = TableKit.getBodyRows(table);
+ rows.each(function(r,i) {
+ TableKit.Rows.addStripeClass(table,r,i);
+ });
+ },
+ addStripeClass : function(t,r,i) {
+ t = t || r.up('table');
+ var op = TableKit.option('rowEvenClass rowOddClass', t.id);
+ var css = ((i+1)%2 === 0 ? op[0] : op[1]);
+ // using prototype's assClassName/RemoveClassName was not efficient for large tables, hence:
+ var cn = r.className.split(/\s+/);
+ var newCn = [];
+ for(var x = 0, l = cn.length; x < l; x += 1) {
+ if(cn[x] !== op[0] && cn[x] !== op[1]) { newCn.push(cn[x]); }
+ }
+ newCn.push(css);
+ r.className = newCn.join(" ");
+ }
+};
+
+TableKit.Sortable = {
+ init : function(elm, options){
+ var table = $(elm);
+ if(table.tagName !== "TABLE") {
+ return;
+ }
+ TableKit.register(table,Object.extend(options || {},{sortable:true}));
+ var sortFirst;
+ var cells = TableKit.getHeaderCells(table);
+ var op = TableKit.option('noSortClass columnClass sortFirstAscendingClass sortFirstDecendingClass', table.id);
+ cells.each(function(c){
+ c = $(c);
+ if(!c.hasClassName(op.noSortClass)) {
+ Event.observe(c, 'mousedown', TableKit.Sortable._sort);
+ c.addClassName(op.columnClass);
+ if(c.hasClassName(op.sortFirstAscendingClass) || c.hasClassName(op.sortFirstDecendingClass)) {
+ sortFirst = c;
+ }
+ }
+ });
+
+ if(sortFirst) {
+ if(sortFirst.hasClassName(op.sortFirstAscendingClass)) {
+ TableKit.Sortable.sort(table, sortFirst, 1);
+ } else {
+ TableKit.Sortable.sort(table, sortFirst, -1);
+ }
+ } else { // just add row stripe classes
+ TableKit.Rows.stripe(table);
+ }
+ },
+ reload : function(table) {
+ table = $(table);
+ var cells = TableKit.getHeaderCells(table);
+ var op = TableKit.option('noSortClass columnClass', table.id);
+ cells.each(function(c){
+ c = $(c);
+ if(!c.hasClassName(op.noSortClass)) {
+ Event.stopObserving(c, 'mousedown', TableKit.Sortable._sort);
+ c.removeClassName(op.columnClass);
+ }
+ });
+ TableKit.Sortable.init(table);
+ },
+ _sort : function(e) {
+ if(TableKit.Resizable._onHandle) {return;}
+ e = TableKit.e(e);
+ Event.stop(e);
+ var cell = Event.element(e);
+ while(!(cell.tagName && cell.tagName.match(/td|th/gi))) {
+ cell = cell.parentNode;
+ }
+ TableKit.Sortable.sort(null, cell);
+ },
+ sort : function(table, index, order) {
+ var cell;
+ if(typeof index === 'number') {
+ if(!table || (table.tagName && table.tagName !== "TABLE")) {
+ return;
+ }
+ table = $(table);
+ index = Math.min(table.rows[0].cells.length, index);
+ index = Math.max(1, index);
+ index -= 1;
+ cell = (table.tHead && table.tHead.rows.length > 0) ? $(table.tHead.rows[table.tHead.rows.length-1].cells[index]) : $(table.rows[0].cells[index]);
+ } else {
+ cell = $(index);
+ table = table ? $(table) : cell.up('table');
+ index = TableKit.getCellIndex(cell);
+ }
+ var op = TableKit.option('noSortClass descendingClass ascendingClass', table.id);
+
+ if(cell.hasClassName(op.noSortClass)) {return;}
+
+ order = order ? order : (cell.hasClassName(op.descendingClass) ? 1 : -1);
+ var rows = TableKit.getBodyRows(table);
+
+ if(cell.hasClassName(op.ascendingClass) || cell.hasClassName(op.descendingClass)) {
+ rows.reverse(); // if it was already sorted we just need to reverse it.
+ } else {
+ var datatype = TableKit.Sortable.getDataType(cell,index,table);
+ var tkst = TableKit.Sortable.types;
+ rows.sort(function(a,b) {
+ return order * tkst[datatype].compare(TableKit.getCellText(a.cells[index]),TableKit.getCellText(b.cells[index]));
+ });
+ }
+ var tb = table.tBodies[0];
+ var tkr = TableKit.Rows;
+ rows.each(function(r,i) {
+ tb.appendChild(r);
+ //tkr.addStripeClass(table,r,i);
+ });
+ TableKit.Rows.stripe(table);
+ var hcells = TableKit.getHeaderCells(null, cell);
+ $A(hcells).each(function(c,i){
+ c = $(c);
+ c.removeClassName(op.ascendingClass);
+ c.removeClassName(op.descendingClass);
+ if(index === i) {
+ if(order === 1) {
+ c.removeClassName(op.descendingClass);
+ c.addClassName(op.ascendingClass);
+ } else {
+ c.removeClassName(op.ascendingClass);
+ c.addClassName(op.descendingClass);
+ }
+ }
+ });
+ },
+ types : {},
+ detectors : [],
+ addSortType : function() {
+ $A(arguments).each(function(o){
+ TableKit.Sortable.types[o.name] = o;
+ });
+ },
+ getDataType : function(cell,index,table) {
+ cell = $(cell);
+ index = (index || index === 0) ? index : TableKit.getCellIndex(cell);
+
+ var colcache = TableKit.Sortable._coltypecache;
+ var cache = colcache[table.id] ? colcache[table.id] : (colcache[table.id] = {});
+
+ if(!cache[index]) {
+ var t = '';
+ // first look for a data type id on the heading row cell
+ if(cell.id && TableKit.Sortable.types[cell.id]) {
+ t = cell.id;
+ }
+ t = cell.classNames().detect(function(n){ // then look for a data type classname on the heading row cell
+ return (TableKit.Sortable.types[n]) ? true : false;
+ });
+ if(!t) {
+ var rows = TableKit.getBodyRows(table);
+ cell = rows[0].cells[index]; // grab same index cell from body row to try and match data type
+ t = TableKit.Sortable.detectors.detect(
+ function(d){
+ return TableKit.Sortable.types[d].detect(TableKit.getCellText(cell));
+ });
+ }
+ cache[index] = t;
+ }
+ return cache[index];
+ },
+ _coltypecache : {}
+};
+
+TableKit.Sortable.detectors = $A($w('date-iso date date-eu date-au time currency datasize number casesensitivetext text')); // setting it here because Safari complained when I did it above...
+
+TableKit.Sortable.Type = Class.create();
+TableKit.Sortable.Type.prototype = {
+ initialize : function(name, options){
+ this.name = name;
+ options = Object.extend({
+ normal : function(v){
+ return v;
+ },
+ pattern : /.*/
+ }, options || {});
+ this.normal = options.normal;
+ this.pattern = options.pattern;
+ if(options.compare) {
+ this.compare = options.compare;
+ }
+ if(options.detect) {
+ this.detect = options.detect;
+ }
+ },
+ compare : function(a,b){
+ return TableKit.Sortable.Type.compare(this.normal(a), this.normal(b));
+ },
+ detect : function(v){
+ return this.pattern.test(v);
+ }
+};
+
+TableKit.Sortable.Type.compare = function(a,b) {
+ return a < b ? -1 : a === b ? 0 : 1;
+};
+
+TableKit.Sortable.addSortType(
+ new TableKit.Sortable.Type('number', {
+ pattern : /^[-+]?[\d]*\.?[\d]+(?:[eE][-+]?[\d]+)?/,
+ normal : function(v) {
+ // This will grab the first thing that looks like a number from a string, so you can use it to order a column of various srings containing numbers.
+ v = parseFloat(v.replace(/^.*?([-+]?[\d]*\.?[\d]+(?:[eE][-+]?[\d]+)?).*$/,"$1"));
+ return isNaN(v) ? 0 : v;
+ }}),
+ new TableKit.Sortable.Type('text',{
+ normal : function(v) {
+ return v ? v.toLowerCase() : '';
+ }}),
+ new TableKit.Sortable.Type('casesensitivetext',{pattern : /^[A-Z]+$/}),
+ new TableKit.Sortable.Type('datasize',{
+ pattern : /^[-+]?[\d]*\.?[\d]+(?:[eE][-+]?[\d]+)?\s?[k|m|g|t]b$/i,
+ normal : function(v) {
+ var r = v.match(/^([-+]?[\d]*\.?[\d]+([eE][-+]?[\d]+)?)\s?([k|m|g|t]?b)?/i);
+ var b = r[1] ? Number(r[1]).valueOf() : 0;
+ var m = r[3] ? r[3].substr(0,1).toLowerCase() : '';
+ var result = b;
+ switch(m) {
+ case 'k':
+ result = b * 1024;
+ break;
+ case 'm':
+ result = b * 1024 * 1024;
+ break;
+ case 'g':
+ result = b * 1024 * 1024 * 1024;
+ break;
+ case 't':
+ result = b * 1024 * 1024 * 1024 * 1024;
+ break;
+ }
+ return result;
+ }}),
+ new TableKit.Sortable.Type('date-au',{
+ pattern : /^\d{2}\/\d{2}\/\d{4}\s?(?:\d{1,2}\:\d{2}(?:\:\d{2})?\s?[a|p]?m?)?/i,
+ normal : function(v) {
+ if(!this.pattern.test(v)) {return 0;}
+ var r = v.match(/^(\d{2})\/(\d{2})\/(\d{4})\s?(?:(\d{1,2})\:(\d{2})(?:\:(\d{2}))?\s?([a|p]?m?))?/i);
+ var yr_num = r[3];
+ var mo_num = parseInt(r[2],10)-1;
+ var day_num = r[1];
+ var hr_num = r[4] ? r[4] : 0;
+ if(r[7] && r[7].toLowerCase().indexOf('p') !== -1) {
+ hr_num = parseInt(r[4],10) + 12;
+ }
+ var min_num = r[5] ? r[5] : 0;
+ var sec_num = r[6] ? r[6] : 0;
+ return new Date(yr_num, mo_num, day_num, hr_num, min_num, sec_num, 0).valueOf();
+ }}),
+ new TableKit.Sortable.Type('date-us',{
+ pattern : /^\d{2}\/\d{2}\/\d{4}\s?(?:\d{1,2}\:\d{2}(?:\:\d{2})?\s?[a|p]?m?)?/i,
+ normal : function(v) {
+ if(!this.pattern.test(v)) {return 0;}
+ var r = v.match(/^(\d{2})\/(\d{2})\/(\d{4})\s?(?:(\d{1,2})\:(\d{2})(?:\:(\d{2}))?\s?([a|p]?m?))?/i);
+ var yr_num = r[3];
+ var mo_num = parseInt(r[1],10)-1;
+ var day_num = r[2];
+ var hr_num = r[4] ? r[4] : 0;
+ if(r[7] && r[7].toLowerCase().indexOf('p') !== -1) {
+ hr_num = parseInt(r[4],10) + 12;
+ }
+ var min_num = r[5] ? r[5] : 0;
+ var sec_num = r[6] ? r[6] : 0;
+ return new Date(yr_num, mo_num, day_num, hr_num, min_num, sec_num, 0).valueOf();
+ }}),
+ new TableKit.Sortable.Type('date-eu',{
+ pattern : /^\d{2}-\d{2}-\d{4}/i,
+ normal : function(v) {
+ if(!this.pattern.test(v)) {return 0;}
+ var r = v.match(/^(\d{2})-(\d{2})-(\d{4})/);
+ var yr_num = r[3];
+ var mo_num = parseInt(r[2],10)-1;
+ var day_num = r[1];
+ return new Date(yr_num, mo_num, day_num).valueOf();
+ }}),
+ new TableKit.Sortable.Type('date-iso',{
+ pattern : /[\d]{4}-[\d]{2}-[\d]{2}(?:T[\d]{2}\:[\d]{2}(?:\:[\d]{2}(?:\.[\d]+)?)?(Z|([-+][\d]{2}:[\d]{2})?)?)?/, // 2005-03-26T19:51:34Z
+ normal : function(v) {
+ if(!this.pattern.test(v)) {return 0;}
+ var d = v.match(/([\d]{4})(-([\d]{2})(-([\d]{2})(T([\d]{2}):([\d]{2})(:([\d]{2})(\.([\d]+))?)?(Z|(([-+])([\d]{2}):([\d]{2})))?)?)?)?/);
+ var offset = 0;
+ var date = new Date(d[1], 0, 1);
+ if (d[3]) { date.setMonth(d[3] - 1) ;}
+ if (d[5]) { date.setDate(d[5]); }
+ if (d[7]) { date.setHours(d[7]); }
+ if (d[8]) { date.setMinutes(d[8]); }
+ if (d[10]) { date.setSeconds(d[10]); }
+ if (d[12]) { date.setMilliseconds(Number("0." + d[12]) * 1000); }
+ if (d[14]) {
+ offset = (Number(d[16]) * 60) + Number(d[17]);
+ offset *= ((d[15] === '-') ? 1 : -1);
+ }
+ offset -= date.getTimezoneOffset();
+ if(offset !== 0) {
+ var time = (Number(date) + (offset * 60 * 1000));
+ date.setTime(Number(time));
+ }
+ return date.valueOf();
+ }}),
+ new TableKit.Sortable.Type('date',{
+ pattern: /^(?:sun|mon|tue|wed|thu|fri|sat)\,\s\d{1,2}\s(?:jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)\s\d{4}(?:\s\d{2}\:\d{2}(?:\:\d{2})?(?:\sGMT(?:[+-]\d{4})?)?)?/i, //Mon, 18 Dec 1995 17:28:35 GMT
+ compare : function(a,b) { // must be standard javascript date format
+ if(a && b) {
+ return TableKit.Sortable.Type.compare(new Date(a),new Date(b));
+ } else {
+ return TableKit.Sortable.Type.compare(a ? 1 : 0, b ? 1 : 0);
+ }
+ }}),
+ new TableKit.Sortable.Type('time',{
+ pattern : /^\d{1,2}\:\d{2}(?:\:\d{2})?(?:\s[a|p]m)?$/i,
+ compare : function(a,b) {
+ var d = new Date();
+ var ds = d.getMonth() + "/" + d.getDate() + "/" + d.getFullYear() + " ";
+ return TableKit.Sortable.Type.compare(new Date(ds + a),new Date(ds + b));
+ }}),
+ new TableKit.Sortable.Type('currency',{
+ pattern : /^[$ŁĄ€¤]/, // dollar,pound,yen,euro,generic currency symbol
+ normal : function(v) {
+ return v ? parseFloat(v.replace(/[^-\d\.]/g,'')) : 0;
+ }})
+);
+
+TableKit.Resizable = {
+ init : function(elm, options){
+ var table = $(elm);
+ if(table.tagName !== "TABLE") {return;}
+ TableKit.register(table,Object.extend(options || {},{resizable:true}));
+ var cells = TableKit.getHeaderCells(table);
+ cells.each(function(c){
+ c = $(c);
+ Event.observe(c, 'mouseover', TableKit.Resizable.initDetect);
+ Event.observe(c, 'mouseout', TableKit.Resizable.killDetect);
+ });
+ },
+ resize : function(table, index, w) {
+ var cell;
+ if(typeof index === 'number') {
+ if(!table || (table.tagName && table.tagName !== "TABLE")) {return;}
+ table = $(table);
+ index = Math.min(table.rows[0].cells.length, index);
+ index = Math.max(1, index);
+ index -= 1;
+ cell = (table.tHead && table.tHead.rows.length > 0) ? $(table.tHead.rows[table.tHead.rows.length-1].cells[index]) : $(table.rows[0].cells[index]);
+ } else {
+ cell = $(index);
+ table = table ? $(table) : cell.up('table');
+ index = TableKit.getCellIndex(cell);
+ }
+ var pad = parseInt(cell.getStyle('paddingLeft'),10) + parseInt(cell.getStyle('paddingRight'),10);
+ w = Math.max(w-pad, TableKit.option('minWidth', table.id)[0]);
+
+ cell.setStyle({'width' : w + 'px'});
+ },
+ initDetect : function(e) {
+ e = TableKit.e(e);
+ var cell = Event.element(e);
+ Event.observe(cell, 'mousemove', TableKit.Resizable.detectHandle);
+ Event.observe(cell, 'mousedown', TableKit.Resizable.startResize);
+ },
+ detectHandle : function(e) {
+ e = TableKit.e(e);
+ var cell = Event.element(e);
+ if(TableKit.Resizable.pointerPos(cell,Event.pointerX(e),Event.pointerY(e))){
+ cell.addClassName(TableKit.option('resizeOnHandleClass', cell.up('table').id)[0]);
+ TableKit.Resizable._onHandle = true;
+ } else {
+ cell.removeClassName(TableKit.option('resizeOnHandleClass', cell.up('table').id)[0]);
+ TableKit.Resizable._onHandle = false;
+ }
+ },
+ killDetect : function(e) {
+ e = TableKit.e(e);
+ TableKit.Resizable._onHandle = false;
+ var cell = Event.element(e);
+ Event.stopObserving(cell, 'mousemove', TableKit.Resizable.detectHandle);
+ Event.stopObserving(cell, 'mousedown', TableKit.Resizable.startResize);
+ cell.removeClassName(TableKit.option('resizeOnHandleClass', cell.up('table').id)[0]);
+ },
+ startResize : function(e) {
+ e = TableKit.e(e);
+ if(!TableKit.Resizable._onHandle) {return;}
+ var cell = Event.element(e);
+ Event.stopObserving(cell, 'mousemove', TableKit.Resizable.detectHandle);
+ Event.stopObserving(cell, 'mousedown', TableKit.Resizable.startResize);
+ Event.stopObserving(cell, 'mouseout', TableKit.Resizable.killDetect);
+ TableKit.Resizable._cell = cell;
+ var table = cell.up('table');
+ TableKit.Resizable._tbl = table;
+ if(TableKit.option('showHandle', table.id)[0]) {
+ TableKit.Resizable._handle = $(document.createElement('div')).addClassName('resize-handle').setStyle({
+ 'top' : Position.cumulativeOffset(cell)[1] + 'px',
+ 'left' : Event.pointerX(e) + 'px',
+ 'height' : table.getDimensions().height + 'px'
+ });
+ document.body.appendChild(TableKit.Resizable._handle);
+ }
+ Event.observe(document, 'mousemove', TableKit.Resizable.drag);
+ Event.observe(document, 'mouseup', TableKit.Resizable.endResize);
+ Event.stop(e);
+ },
+ endResize : function(e) {
+ e = TableKit.e(e);
+ var cell = TableKit.Resizable._cell;
+ TableKit.Resizable.resize(null, cell, (Event.pointerX(e) - Position.cumulativeOffset(cell)[0]));
+ Event.stopObserving(document, 'mousemove', TableKit.Resizable.drag);
+ Event.stopObserving(document, 'mouseup', TableKit.Resizable.endResize);
+ if(TableKit.option('showHandle', TableKit.Resizable._tbl.id)[0]) {
+ $$('div.resize-handle').each(function(elm){
+ document.body.removeChild(elm);
+ });
+ }
+ Event.observe(cell, 'mouseout', TableKit.Resizable.killDetect);
+ TableKit.Resizable._tbl = TableKit.Resizable._handle = TableKit.Resizable._cell = null;
+ Event.stop(e);
+ },
+ drag : function(e) {
+ e = TableKit.e(e);
+ if(TableKit.Resizable._handle === null) {
+ try {
+ TableKit.Resizable.resize(TableKit.Resizable._tbl, TableKit.Resizable._cell, (Event.pointerX(e) - Position.cumulativeOffset(TableKit.Resizable._cell)[0]));
+ } catch(e) {}
+ } else {
+ TableKit.Resizable._handle.setStyle({'left' : Event.pointerX(e) + 'px'});
+ }
+ return false;
+ },
+ pointerPos : function(element, x, y) {
+ var offset = Position.cumulativeOffset(element);
+ return (y >= offset[1] &&
+ y < offset[1] + element.offsetHeight &&
+ x >= offset[0] + element.offsetWidth - 5 &&
+ x < offset[0] + element.offsetWidth);
+ },
+ _onHandle : false,
+ _cell : null,
+ _tbl : null,
+ _handle : null
+};
+
+
+TableKit.Editable = {
+ init : function(elm, options){
+ var table = $(elm);
+ if(table.tagName !== "TABLE") {return;}
+ TableKit.register(table,Object.extend(options || {},{editable:true}));
+ Event.observe(table.tBodies[0], 'click', TableKit.Editable._editCell);
+ },
+ _editCell : function(e) {
+ e = TableKit.e(e);
+ var cell = Event.findElement(e,'td');
+ TableKit.Editable.editCell(null, cell);
+ },
+ editCell : function(table, index, cindex) {
+ var cell, row;
+ if(typeof index === 'number') {
+ if(!table || (table.tagName && table.tagName !== "TABLE")) {return;}
+ table = $(table);
+ index = Math.min(table.tBodies[0].rows.length, index);
+ index = Math.max(1, index);
+ index -= 1;
+ cindex = Math.min(table.rows[0].cells.length, cindex);
+ cindex = Math.max(1, cindex);
+ cindex -= 1;
+ row = $(table.tBodies[0].rows[index]);
+ cell = $(row.cells[cindex]);
+ } else {
+ cell = $(index);
+ table = (table && table.tagName && table.tagName !== "TABLE") ? $(table) : cell.up('table');
+ row = cell.up('tr');
+ }
+ var op = TableKit.option('noEditClass', table.id);
+ if(cell.hasClassName(op.noEditClass)) {return;}
+
+ var head = $(TableKit.getHeaderCells(table, cell)[TableKit.getCellIndex(cell)]);
+ if(head.hasClassName(op.noEditClass)) {return;}
+
+ TableKit.registerCell(cell);
+ var data = TableKit.cells[cell.id];
+ if(data.active) {return;}
+ data.htmlContent = cell.innerHTML;
+ var ftype = TableKit.Editable.types['text-input'];
+ if(head.id && TableKit.Editable.types[head.id]) {
+ ftype = TableKit.Editable.types[head.id];
+ } else {
+ var n = head.classNames().detect(function(n){
+ return (TableKit.Editable.types[n]) ? true : false;
+ });
+ ftype = n ? TableKit.Editable.types[n] : ftype;
+ }
+ ftype.edit(cell);
+ data.active = true;
+ },
+ types : {},
+ addCellEditor : function(o) {
+ if(o && o.name) { TableKit.Editable.types[o.name] = o; }
+ }
+};
+
+TableKit.Editable.CellEditor = Class.create();
+TableKit.Editable.CellEditor.prototype = {
+ initialize : function(name, options){
+ this.name = name;
+ this.options = Object.extend({
+ element : 'input',
+ attributes : {name : 'value', type : 'text'},
+ selectOptions : [],
+ showSubmit : true,
+ submitText : 'OK',
+ showCancel : true,
+ cancelText : 'Cancel',
+ ajaxURI : null,
+ ajaxOptions : null
+ }, options || {});
+ },
+ edit : function(cell) {
+ cell = $(cell);
+ var op = this.options;
+ var table = cell.up('table');
+
+ var form = $(document.createElement("form"));
+ form.id = cell.id + '-form';
+ form.addClassName(TableKit.option('formClassName', table.id)[0]);
+ form.onsubmit = this._submit.bindAsEventListener(this);
+
+ var field = document.createElement(op.element);
+ $H(op.attributes).each(function(v){
+ field[v.key] = v.value;
+ });
+ switch(op.element) {
+ case 'input':
+ case 'textarea':
+ field.value = TableKit.getCellText(cell);
+ break;
+
+ case 'select':
+ var txt = TableKit.getCellText(cell);
+ $A(op.selectOptions).each(function(v){
+ field.options[field.options.length] = new Option(v[0], v[1]);
+ if(txt === v[1]) {
+ field.options[field.options.length-1].selected = 'selected';
+ }
+ });
+ break;
+ }
+ form.appendChild(field);
+ if(op.element === 'textarea') {
+ form.appendChild(document.createElement("br"));
+ }
+ if(op.showSubmit) {
+ var okButton = document.createElement("input");
+ okButton.type = "submit";
+ okButton.value = op.submitText;
+ okButton.className = 'editor_ok_button';
+ form.appendChild(okButton);
+ }
+ if(op.showCancel) {
+ var cancelLink = document.createElement("a");
+ cancelLink.href = "#";
+ cancelLink.appendChild(document.createTextNode(op.cancelText));
+ cancelLink.onclick = this._cancel.bindAsEventListener(this);
+ cancelLink.className = 'editor_cancel';
+ form.appendChild(cancelLink);
+ }
+ cell.innerHTML = '';
+ cell.appendChild(form);
+ },
+ _submit : function(e) {
+ var cell = Event.findElement(e,'td');
+ var form = Event.findElement(e,'form');
+ Event.stop(e);
+ this.submit(cell,form);
+ },
+ submit : function(cell, form) {
+ var op = this.options;
+ form = form ? form : cell.down('form');
+ var head = $(TableKit.getHeaderCells(null, cell)[TableKit.getCellIndex(cell)]);
+ var row = cell.up('tr');
+ var table = cell.up('table');
+ var s = '&row=' + (TableKit.getRowIndex(row)+1) + '&cell=' + (TableKit.getCellIndex(cell)+1) + '&id=' + row.id + '&field=' + head.id + '&' + Form.serialize(form);
+ this.ajax = new Ajax.Updater(cell, op.ajaxURI || TableKit.option('editAjaxURI', table.id)[0], Object.extend(op.ajaxOptions || TableKit.option('editAjaxOptions', table.id)[0], {
+ postBody : s,
+ onComplete : function() {
+ var data = TableKit.cells[cell.id];
+ data.active = false;
+ data.refresh = true; // mark cell cache for refreshing, in case cell contents has changed and sorting is applied
+ }
+ }));
+ },
+ _cancel : function(e) {
+ var cell = Event.findElement(e,'td');
+ Event.stop(e);
+ this.cancel(cell);
+ },
+ cancel : function(cell) {
+ this.ajax = null;
+ var data = TableKit.cells[cell.id];
+ cell.innerHTML = data.htmlContent;
+ data.htmlContent = '';
+ data.active = false;
+ },
+ ajax : null
+};
+
+TableKit.Editable.textInput = function(n,attributes) {
+ TableKit.Editable.addCellEditor(new TableKit.Editable.CellEditor(n, {
+ element : 'input',
+ attributes : Object.extend({name : 'value', type : 'text'}, attributes||{})
+ }));
+};
+TableKit.Editable.textInput('text-input');
+
+TableKit.Editable.multiLineInput = function(n,attributes) {
+ TableKit.Editable.addCellEditor(new TableKit.Editable.CellEditor(n, {
+ element : 'textarea',
+ attributes : Object.extend({name : 'value', rows : '5', cols : '20'}, attributes||{})
+ }));
+};
+TableKit.Editable.multiLineInput('multi-line-input');
+
+TableKit.Editable.selectInput = function(n,attributes,selectOptions) {
+ TableKit.Editable.addCellEditor(new TableKit.Editable.CellEditor(n, {
+ element : 'select',
+ attributes : Object.extend({name : 'value'}, attributes||{}),
+ 'selectOptions' : selectOptions
+ }));
+};
+
+/*
+TableKit.Bench = {
+ bench : [],
+ start : function(){
+ TableKit.Bench.bench[0] = new Date().getTime();
+ },
+ end : function(s){
+ TableKit.Bench.bench[1] = new Date().getTime();
+ alert(s + ' ' + ((TableKit.Bench.bench[1]-TableKit.Bench.bench[0])/1000)+' seconds.') //console.log(s + ' ' + ((TableKit.Bench.bench[1]-TableKit.Bench.bench[0])/1000)+' seconds.')
+ TableKit.Bench.bench = [];
+ }
+} */
+
+if(window.FastInit) {
+ FastInit.addOnLoad(TableKit.load);
+} else {
+ Event.observe(window, 'load', TableKit.load);
} \ No newline at end of file
diff --git a/sonar-server/src/test/resources/org/sonar/server/platform/ServerImplTest/pom-with-empty-version.properties b/sonar-server/src/test/resources/org/sonar/server/platform/ServerImplTest/pom-with-empty-version.properties
index 3dd830384bb..287ce487033 100644
--- a/sonar-server/src/test/resources/org/sonar/server/platform/ServerImplTest/pom-with-empty-version.properties
+++ b/sonar-server/src/test/resources/org/sonar/server/platform/ServerImplTest/pom-with-empty-version.properties
@@ -1,5 +1,5 @@
-#Generated by Maven
-#Fri Nov 23 14:23:53 CET 2007
-groupId=org.codehaus.sonar
-artifactId=sonar-core
+#Generated by Maven
+#Fri Nov 23 14:23:53 CET 2007
+groupId=org.codehaus.sonar
+artifactId=sonar-core
version= \ No newline at end of file
diff --git a/sonar-server/src/test/resources/org/sonar/server/platform/ServerImplTest/pom-without-version.properties b/sonar-server/src/test/resources/org/sonar/server/platform/ServerImplTest/pom-without-version.properties
index 1d828008fdd..8d70c2289f8 100644
--- a/sonar-server/src/test/resources/org/sonar/server/platform/ServerImplTest/pom-without-version.properties
+++ b/sonar-server/src/test/resources/org/sonar/server/platform/ServerImplTest/pom-without-version.properties
@@ -1,4 +1,4 @@
-#Generated by Maven
-#Fri Nov 23 14:23:53 CET 2007
-groupId=org.codehaus.sonar
-artifactId=sonar-core
+#Generated by Maven
+#Fri Nov 23 14:23:53 CET 2007
+groupId=org.codehaus.sonar
+artifactId=sonar-core