aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/CorePlugin.java2
-rw-r--r--plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/sensors/AsynchronousMeasuresSensor.java58
-rw-r--r--plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/widgets/CustomMeasuresWidget.java40
-rw-r--r--plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/custom_measures.html.erb68
-rw-r--r--sonar-batch/src/main/java/org/sonar/batch/bootstrap/ProjectModule.java2
-rw-r--r--sonar-core/src/main/java/org/sonar/jpa/dao/AsyncMeasuresDao.java196
-rw-r--r--sonar-core/src/main/java/org/sonar/jpa/dao/AsyncMeasuresService.java130
-rw-r--r--sonar-core/src/main/java/org/sonar/jpa/dao/DaoFacade.java9
-rw-r--r--sonar-core/src/main/java/org/sonar/jpa/entity/SchemaMigration.java2
-rw-r--r--sonar-core/src/main/resources/META-INF/persistence.xml1
-rw-r--r--sonar-core/src/test/java/org/sonar/jpa/dao/AsyncMeasuresDaoTest.java165
-rw-r--r--sonar-core/src/test/java/org/sonar/jpa/dao/AsyncMeasuresServiceTest.java153
-rw-r--r--sonar-core/src/test/java/org/sonar/jpa/test/AbstractDbUnitTestCase.java2
-rw-r--r--sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresDaoTest/sharedFixture.xml23
-rw-r--r--sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresDaoTest/testDeleteAsyncMeasure-result.xml22
-rw-r--r--sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresDaoTest/testDeleteAsyncMeasure.xml26
-rw-r--r--sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresDaoTest/testDeleteAsyncMeasureSnapshots-result.xml11
-rw-r--r--sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresDaoTest/testDeleteAsyncMeasureSnapshots.xml11
-rw-r--r--sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresDaoTest/testGetAsyncMeasureSnapshotsFromSnapshotId.xml26
-rw-r--r--sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresDaoTest/testGetLastAsyncMeasureSnapshot.xml12
-rw-r--r--sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresDaoTest/testGetNextAsyncMeasureSnapshot.xml11
-rw-r--r--sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresDaoTest/testGetNextAsyncMeasureSnapshotsUntilDate.xml50
-rw-r--r--sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresDaoTest/testGetNextSnapshotsUntilDate.xml35
-rw-r--r--sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresDaoTest/testGetPreviousAsyncMeasureSnapshots.xml18
-rw-r--r--sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresDaoTest/testGetPreviousSnapshot.xml24
-rw-r--r--sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/addFutureSnapshot-result.xml28
-rw-r--r--sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/addFutureSnapshot.xml24
-rw-r--r--sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/addInvisibleMeasure-result.xml28
-rw-r--r--sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/addInvisibleMeasure.xml24
-rw-r--r--sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/assignAPastMeasureToNextSnapshotsWithDifferentMetric-result.xml37
-rw-r--r--sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/assignAPastMeasureToNextSnapshotsWithDifferentMetric.xml33
-rw-r--r--sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/assignLatestMeasuresToLastSnapshot-result.xml42
-rw-r--r--sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/assignLatestMeasuresToLastSnapshot.xml36
-rw-r--r--sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/assignLatestMeasuresWhenNoPreviousSnapshot-result.xml45
-rw-r--r--sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/assignLatestMeasuresWhenNoPreviousSnapshot.xml43
-rw-r--r--sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/assignMeasureToFutureSnapshotsWithDifferentMetric-result.xml59
-rw-r--r--sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/assignMeasureToFutureSnapshotsWithDifferentMetric.xml49
-rw-r--r--sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/assignMeasuresWhenNoPreviousSnapshot-result.xml24
-rw-r--r--sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/assignMeasuresWhenNoPreviousSnapshot.xml24
-rw-r--r--sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/assignNewMeasureToFutureSnapshots-result.xml44
-rw-r--r--sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/assignNewMeasureToFutureSnapshots.xml36
-rw-r--r--sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/assignNewMeasuresToLastSnapshot-result.xml43
-rw-r--r--sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/assignNewMeasuresToLastSnapshot.xml42
-rw-r--r--sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/assignPastMeasuresToPastSnapshot-result.xml47
-rw-r--r--sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/assignPastMeasuresToPastSnapshot.xml42
-rw-r--r--sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/deleteLastMeasure-result.xml30
-rw-r--r--sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/deleteLastMeasure.xml32
-rw-r--r--sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/deleteMeasure-result.xml41
-rw-r--r--sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/deleteMeasure.xml39
-rw-r--r--sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/sharedFixture.xml13
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/database/model/AsyncMeasureSnapshot.java172
-rw-r--r--sonar-server/src/main/java/org/sonar/server/platform/Platform.java2
-rw-r--r--sonar-server/src/main/java/org/sonar/server/ui/JRubyFacade.java13
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/controllers/components_controller.rb1
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/controllers/metrics_controller.rb1
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/controllers/project_controller.rb71
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/controllers/timemachine_controller.rb1
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/models/filter.rb11
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/models/filter_context.rb4
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/models/project_measure.rb46
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/models/snapshot.rb10
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/db/migrate/048_create_async_measure_snapshots_table.rb8
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/db/migrate/151_create_dashboards.rb7
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/db/migrate/211_create_manual_measures.rb (renamed from sonar-server/src/main/webapp/WEB-INF/app/models/async_measure_snapshot.rb)32
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/db/migrate/212_move_async_measures.rb30
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/db/migrate/213_drop_async_measures_table.rb33
-rw-r--r--sonar-testing-harness/src/main/resources/org/sonar/test/persistence/sonar-test.ddl14
67 files changed, 85 insertions, 2373 deletions
diff --git a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/CorePlugin.java b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/CorePlugin.java
index 76c1bdf43dc..5b4358eb5cb 100644
--- a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/CorePlugin.java
+++ b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/CorePlugin.java
@@ -183,7 +183,6 @@ public class CorePlugin extends SonarPlugin {
extensions.add(RulesWidget.class);
extensions.add(SizeWidget.class);
extensions.add(EventsWidget.class);
- extensions.add(CustomMeasuresWidget.class);
// chart
extensions.add(XradarChart.class);
@@ -197,7 +196,6 @@ public class CorePlugin extends SonarPlugin {
extensions.add(ProfileSensor.class);
extensions.add(ProfileEventsSensor.class);
extensions.add(ProjectLinksSensor.class);
- extensions.add(AsynchronousMeasuresSensor.class);
extensions.add(UnitTestDecorator.class);
extensions.add(VersionEventsSensor.class);
extensions.add(CheckAlertThresholds.class);
diff --git a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/sensors/AsynchronousMeasuresSensor.java b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/sensors/AsynchronousMeasuresSensor.java
deleted file mode 100644
index 3a23449aec9..00000000000
--- a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/sensors/AsynchronousMeasuresSensor.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Sonar, open source software quality management tool.
- * Copyright (C) 2008-2011 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * Sonar is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * Sonar is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with Sonar; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02
- */
-package org.sonar.plugins.core.sensors;
-
-import org.sonar.api.batch.Phase;
-import org.sonar.api.batch.Sensor;
-import org.sonar.api.batch.SensorContext;
-import org.sonar.core.NotDryRun;
-import org.sonar.jpa.dao.AsyncMeasuresService;
-import org.sonar.api.database.model.Snapshot;
-import org.sonar.api.resources.Project;
-import org.sonar.api.resources.ResourceUtils;
-
-@NotDryRun
-@Phase(name = Phase.Name.PRE)
-public class AsynchronousMeasuresSensor implements Sensor {
-
- private AsyncMeasuresService reviewsService;
- private Snapshot snapshot;
-
- public AsynchronousMeasuresSensor(AsyncMeasuresService reviewsService, Snapshot snapshot) {
- this.reviewsService = reviewsService;
- this.snapshot = snapshot;
- }
-
- public boolean shouldExecuteOnProject(Project project) {
- return true;
- }
-
- public void analyse(Project project, SensorContext context) {
- if (!ResourceUtils.isRootProject(project)) {
- return;
- }
- reviewsService.refresh(snapshot);
- }
-
- @Override
- public String toString() {
- return getClass().getSimpleName();
- }
-}
diff --git a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/widgets/CustomMeasuresWidget.java b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/widgets/CustomMeasuresWidget.java
deleted file mode 100644
index 5bb3525a3fd..00000000000
--- a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/widgets/CustomMeasuresWidget.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Sonar, open source software quality management tool.
- * Copyright (C) 2008-2011 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * Sonar is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * Sonar is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with Sonar; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02
- */
-package org.sonar.plugins.core.widgets;
-
-import org.sonar.api.web.AbstractRubyTemplate;
-import org.sonar.api.web.Description;
-import org.sonar.api.web.RubyRailsWidget;
-
-@Description("Displays manual measures entered on the project.")
-public class CustomMeasuresWidget extends AbstractRubyTemplate implements RubyRailsWidget {
- public String getId() {
- return "custom_measures";
- }
-
- public String getTitle() {
- return "Custom measures";
- }
-
- @Override
- protected String getTemplatePath() {
- return "/org/sonar/plugins/core/widgets/custom_measures.html.erb";
- }
-} \ No newline at end of file
diff --git a/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/custom_measures.html.erb b/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/custom_measures.html.erb
deleted file mode 100644
index d53de7b202d..00000000000
--- a/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/custom_measures.html.erb
+++ /dev/null
@@ -1,68 +0,0 @@
- <%
- measures = @snapshot.async_measures.select{ |m|
- m.metric and m.metric.enabled==true and m.metric.user_managed?
- }.sort{ |m1,m2|
- m1.metric.name <=> m2.metric.name
- }
- %>
- <% if is_admin?(@snapshot) || measures.size>0 %>
- <script type="text/javascript">
- function selectReviewMetric(){
- $$('.review_description_update').each(function(element) {
- element.hide();
- });
- review = $('review_metric_id').value;
- $('review_description_'+review).show();
- $('review_value_'+review).show();
- }
-
- function selectEventCateg(){
- $$('#event_cat_desc .comments').each(function(elt) {
- elt.hide();
- });
- selected_categ = $('event_category').value;
- if (selected_categ!=null && selected_categ!='') {
- $('event_cat_desc_'+selected_categ).show();
- }
- }
- </script>
- <%
- measures.each do |m|
- html_name_id = "review_name_#{m.metric.short_name}"
- html_value_id = "review_value_#{m.metric.short_name}"
- html_date_id = "review_date_#{m.metric.short_name}"
- %>
- <div class="dashbox">
- <h3 id='<%= html_name_id %>'><%= m.metric.short_name %></h3>
- <p><span id='<%= html_value_id %>' class="big">
- <%= format_measure(m, :suffix => '', :url => m.url) -%>
- </span></p>
- <% if m.measure_date %>
- <p><span id='<%= html_date_id %>'><%= l(m.measure_date.to_date) %></span>
- <% if m.review? && is_admin?(@snapshot) %>
- <%= link_to 'delete',
- {:controller => 'project', :action => 'delete_review', :id => m.id, :sid => @snapshot.id}, :method => 'delete', :confirm => 'Delete this measure ?',
- :class => 'action', :id => "delete_review_#{m.metric_key}" %>
- <% end %>
- </p>
- <% end %>
- <% unless m.description.blank? %>
- <p><%= m.description %></p>
- <% end %>
- </div>
- <% end %>
- <% if is_admin?(@snapshot) %>
- <div id="add_review_form">
- <p>
- <% if @review %>
- <%= render :partial => 'dashboard_edit_review' %>
- <% else %>
- <%= link_to_remote 'Add a measure',
- {:url => {:controller => 'project', :action => 'edit_review', :sid => @snapshot.id}, :update => 'add_review_form'},
- {:class => 'action', :id => 'add_review'} %>
- <% end %>
- </p>
- </div>
- <% end %>
- <div class="clear"></div>
- <% end %>
diff --git a/sonar-batch/src/main/java/org/sonar/batch/bootstrap/ProjectModule.java b/sonar-batch/src/main/java/org/sonar/batch/bootstrap/ProjectModule.java
index 532848bb4f2..c54b8d6d126 100644
--- a/sonar-batch/src/main/java/org/sonar/batch/bootstrap/ProjectModule.java
+++ b/sonar-batch/src/main/java/org/sonar/batch/bootstrap/ProjectModule.java
@@ -82,8 +82,6 @@ public class ProjectModule extends Module {
addComponent(TimeMachineConfiguration.class);
addComponent(org.sonar.api.database.daos.MeasuresDao.class);
addComponent(ProfilesDao.class);
- addComponent(AsyncMeasuresDao.class);
- addComponent(AsyncMeasuresService.class);
addComponent(DefaultRulesManager.class);
addComponent(DefaultSensorContext.class);
addComponent(Languages.class);
diff --git a/sonar-core/src/main/java/org/sonar/jpa/dao/AsyncMeasuresDao.java b/sonar-core/src/main/java/org/sonar/jpa/dao/AsyncMeasuresDao.java
deleted file mode 100644
index 5f09d281a97..00000000000
--- a/sonar-core/src/main/java/org/sonar/jpa/dao/AsyncMeasuresDao.java
+++ /dev/null
@@ -1,196 +0,0 @@
-/*
- * Sonar, open source software quality management tool.
- * Copyright (C) 2008-2011 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * Sonar is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * Sonar is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with Sonar; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02
- */
-package org.sonar.jpa.dao;
-
-import org.sonar.api.database.DatabaseSession;
-import org.sonar.api.database.model.AsyncMeasureSnapshot;
-import org.sonar.api.database.model.MeasureModel;
-import org.sonar.api.database.model.ResourceModel;
-import org.sonar.api.database.model.Snapshot;
-
-import javax.persistence.NoResultException;
-import javax.persistence.Query;
-import java.util.Date;
-import java.util.List;
-
-public class AsyncMeasuresDao extends BaseDao {
-
- public AsyncMeasuresDao(DatabaseSession session) {
- super(session);
- }
-
- public MeasureModel getAsyncMeasure(Long asyncMeasureId) {
- return getSession().getEntityManager().find(MeasureModel.class, asyncMeasureId);
- }
-
- public void deleteAsyncMeasure(MeasureModel asyncMeasure) {
- deleteAsyncMeasureSnapshots(asyncMeasure.getId());
- getSession().remove(asyncMeasure);
- }
-
- public Snapshot getPreviousSnapshot(Snapshot s) {
- try {
- return (Snapshot) getSession().createQuery(
- "SELECT s FROM Snapshot s " +
- "WHERE s.createdAt<:date " +
- "AND s.scope=:scope " +
- "AND s.resourceId=:resourceId " +
- "ORDER BY s.createdAt DESC")
- .setParameter("date", s.getCreatedAt())
- .setParameter("scope", s.getScope())
- .setParameter("resourceId", s.getResourceId())
- .setMaxResults(1)
- .getSingleResult();
- } catch (NoResultException ex) {
- return null;
- }
- }
-
- public List<Snapshot> getNextSnapshotsUntilDate(MeasureModel measure, Date date) {
- Query query = getSession().createQuery(
- "SELECT s FROM Snapshot s " +
- "WHERE s.resourceId=:projectId " +
- "AND s.createdAt>=:beginDate " +
- (date != null ? "AND s.createdAt<:endDate " : "") +
- "AND s.scope=:scope " +
- "ORDER BY s.createdAt ASC ")
- .setParameter("projectId", measure.getProjectId())
- .setParameter("beginDate", measure.getMeasureDate())
- .setParameter("scope", ResourceModel.SCOPE_PROJECT);
- if (date != null) {
- query.setParameter("endDate", date);
- }
- return query.getResultList();
- }
-
- public AsyncMeasureSnapshot createAsyncMeasureSnapshot(Long asyncMeasureId, Integer snapshotId, Date AsyncMeasureDate, Date snapshotDate, Integer metricId, Integer projectId) {
- AsyncMeasureSnapshot asyncMeasureSnapshot = new AsyncMeasureSnapshot(asyncMeasureId, snapshotId, AsyncMeasureDate, snapshotDate, metricId, projectId);
- getSession().save(asyncMeasureSnapshot);
- return asyncMeasureSnapshot;
- }
-
- public void updateAsyncMeasureSnapshot(AsyncMeasureSnapshot asyncMeasureSnapshot, Snapshot snapshot) {
- if (snapshot != null) {
- asyncMeasureSnapshot.setSnapshotId(snapshot.getId());
- asyncMeasureSnapshot.setSnapshotDate(snapshot.getCreatedAt());
- } else {
- asyncMeasureSnapshot.setSnapshotId(null);
- asyncMeasureSnapshot.setSnapshotDate(null);
- }
- getSession().merge(asyncMeasureSnapshot);
- }
-
- public void removeSnapshotFromAsyncMeasureSnapshot(AsyncMeasureSnapshot asyncMeasureSnapshot) {
- asyncMeasureSnapshot.setSnapshotId(null);
- asyncMeasureSnapshot.setSnapshotDate(null);
- getSession().merge(asyncMeasureSnapshot);
- }
-
-
- public AsyncMeasureSnapshot getNextAsyncMeasureSnapshot(Integer projetcId, Integer metricId, Date date) {
- try {
- return (AsyncMeasureSnapshot) getSession().createQuery(
- "SELECT ams FROM AsyncMeasureSnapshot ams " +
- "WHERE ams.projectId=:projectId " +
- "AND ams.metricId=:metricId " +
- "AND ams.measureDate>:date " +
- "ORDER BY ams.measureDate ASC")
- .setParameter("projectId", projetcId)
- .setParameter("metricId", metricId)
- .setParameter("date", date)
- .setMaxResults(1)
- .getSingleResult();
- } catch (NoResultException ex) {
- return null;
- }
- }
-
- public List<AsyncMeasureSnapshot> getNextAsyncMeasureSnapshotsUntilDate(MeasureModel asyncMeasure, Date endDate) {
- Query query = getSession().createQuery(
- "SELECT ams FROM AsyncMeasureSnapshot ams " +
- "WHERE ams.projectId=:projectId " +
- "AND ams.metricId=:metricId " +
- (endDate != null ? "AND ams.measureDate<:endDate " : "") +
- "AND ams.snapshotDate>=:measureDate " +
- "ORDER BY ams.snapshotDate ASC ")
- .setParameter("projectId", asyncMeasure.getProjectId())
- .setParameter("metricId", asyncMeasure.getMetricId())
- .setParameter("measureDate", asyncMeasure.getMeasureDate());
- if (endDate != null) {
- query.setParameter("endDate", endDate);
- }
- return query.getResultList();
- }
-
- public List<AsyncMeasureSnapshot> getPreviousAsyncMeasureSnapshots(Integer projectId, Date beginDate, Date endDate) {
- Query query = getSession().createQuery(
- "SELECT ams FROM AsyncMeasureSnapshot ams " +
- "WHERE ams.projectId=:projectId " +
- "AND ams.measureDate<=:endDate " +
- (beginDate != null ? "AND ams.measureDate>:beginDate " : "") +
- "AND ams.snapshotId IS NULL " +
- "ORDER BY ams.measureDate ASC")
- .setParameter("projectId", projectId)
- .setParameter("endDate", endDate);
- if (beginDate != null) {
- query.setParameter("beginDate", beginDate);
- }
- return query.getResultList();
- }
-
- public List<AsyncMeasureSnapshot> getAsyncMeasureSnapshotsFromSnapshotId(Integer snapshotId, List<Integer> metricIdsToExclude) {
- Query query = getSession().createQuery(
- "SELECT ams FROM AsyncMeasureSnapshot ams " +
- "WHERE ams.snapshotId=:snapshotId " +
- (!metricIdsToExclude.isEmpty() ? "AND ams.metricId NOT IN (:metricIdsToExclude) " : "") +
- "ORDER BY ams.measureDate ASC")
- .setParameter("snapshotId", snapshotId);
- if (!metricIdsToExclude.isEmpty()) {
- query.setParameter("metricIdsToExclude", metricIdsToExclude);
- }
- return query.getResultList();
- }
-
- public AsyncMeasureSnapshot getLastAsyncMeasureSnapshot(Integer projetcId, Integer metricId, Date date) {
- try {
- return (AsyncMeasureSnapshot) getSession().createQuery(
- "SELECT ams FROM AsyncMeasureSnapshot ams " +
- "WHERE ams.projectId=:projectId " +
- "AND ams.metricId=:metricId " +
- "AND ams.measureDate<:date " +
- "ORDER BY ams.measureDate DESC")
- .setParameter("projectId", projetcId)
- .setParameter("metricId", metricId)
- .setParameter("date", date)
- .setMaxResults(1)
- .getSingleResult();
- } catch (NoResultException ex) {
- return null;
- }
- }
-
- public void deleteAsyncMeasureSnapshots(Long asyncMeasureId) {
- getSession().createQuery(
- "DELETE FROM AsyncMeasureSnapshot ams WHERE ams.measureId=:measureId")
- .setParameter("measureId", asyncMeasureId)
- .executeUpdate();
- }
-
-}
diff --git a/sonar-core/src/main/java/org/sonar/jpa/dao/AsyncMeasuresService.java b/sonar-core/src/main/java/org/sonar/jpa/dao/AsyncMeasuresService.java
deleted file mode 100644
index e985ee3c614..00000000000
--- a/sonar-core/src/main/java/org/sonar/jpa/dao/AsyncMeasuresService.java
+++ /dev/null
@@ -1,130 +0,0 @@
-/*
- * Sonar, open source software quality management tool.
- * Copyright (C) 2008-2011 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * Sonar is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * Sonar is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with Sonar; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02
- */
-package org.sonar.jpa.dao;
-
-import org.sonar.api.database.DatabaseSession;
-import org.sonar.api.database.model.AsyncMeasureSnapshot;
-import org.sonar.api.database.model.MeasureModel;
-import org.sonar.api.database.model.Snapshot;
-
-import java.util.*;
-
-public class AsyncMeasuresService {
- private final DatabaseSession session;
-
- public AsyncMeasuresService(DatabaseSession session) {
- this.session = session;
- }
-
- public void refresh(Snapshot snapshot) {
- AsyncMeasuresDao dao = new AsyncMeasuresDao(session);
- Snapshot previousSnapshot = dao.getPreviousSnapshot(snapshot);
- Date datePreviousSnapshot = (previousSnapshot != null ? previousSnapshot.getCreatedAt() : null);
-
- List<AsyncMeasureSnapshot> previousAsyncMeasureSnapshots = dao.getPreviousAsyncMeasureSnapshots(
- snapshot.getResourceId(), datePreviousSnapshot, snapshot.getCreatedAt());
- if (previousSnapshot != null) {
- previousAsyncMeasureSnapshots.addAll(dao.getAsyncMeasureSnapshotsFromSnapshotId(
- previousSnapshot.getId(), getMetricIds(previousAsyncMeasureSnapshots)));
- }
-
- for (AsyncMeasureSnapshot asyncMeasureSnapshot : purge(previousAsyncMeasureSnapshots)) {
- if (asyncMeasureSnapshot.getSnapshotId() == null) {
- dao.updateAsyncMeasureSnapshot(asyncMeasureSnapshot, snapshot);
- } else {
- dao.createAsyncMeasureSnapshot(
- asyncMeasureSnapshot.getMeasureId(), snapshot.getId(), asyncMeasureSnapshot.getMeasureDate(),
- snapshot.getCreatedAt(), asyncMeasureSnapshot.getMetricId(), asyncMeasureSnapshot.getProjectId());
- }
- }
- session.commit();
- }
-
- public void registerMeasure(Long id) {
- AsyncMeasuresDao dao = new AsyncMeasuresDao(session);
- registerMeasure(dao.getAsyncMeasure(id), dao);
- }
-
- private List<Integer> getMetricIds(List<AsyncMeasureSnapshot> list) {
- List<Integer> ids = new ArrayList<Integer>();
- for (AsyncMeasureSnapshot ams : list) {
- ids.add(ams.getMetricId());
- }
- return ids;
- }
-
- private Collection<AsyncMeasureSnapshot> purge(List<AsyncMeasureSnapshot> list) {
- Map<Integer, AsyncMeasureSnapshot> measuresById = new LinkedHashMap<Integer, AsyncMeasureSnapshot>();
- for (AsyncMeasureSnapshot currentAsyncMeasureSnapshot : list) {
- AsyncMeasureSnapshot asyncMeasureSnapshotFromMap = measuresById.get(currentAsyncMeasureSnapshot.getMetricId());
- if (asyncMeasureSnapshotFromMap != null) {
- if (asyncMeasureSnapshotFromMap.getMeasureDate().before(currentAsyncMeasureSnapshot.getMeasureDate())) {
- measuresById.put(currentAsyncMeasureSnapshot.getMetricId(), currentAsyncMeasureSnapshot);
- }
- } else {
- measuresById.put(currentAsyncMeasureSnapshot.getMetricId(), currentAsyncMeasureSnapshot);
- }
- }
- return measuresById.values();
- }
-
-
- public void deleteMeasure(Long id) {
- AsyncMeasuresDao dao = new AsyncMeasuresDao(session);
- MeasureModel measure = dao.getAsyncMeasure(id);
- AsyncMeasureSnapshot pastAsyncMeasureSnapshot = dao.getLastAsyncMeasureSnapshot(measure.getProjectId(),
- measure.getMetricId(), measure.getMeasureDate());
- dao.deleteAsyncMeasure(measure);
- if (pastAsyncMeasureSnapshot != null) {
- MeasureModel pastAsyncMeasure = dao.getAsyncMeasure(pastAsyncMeasureSnapshot.getMeasureId());
- dao.deleteAsyncMeasureSnapshots(pastAsyncMeasureSnapshot.getMeasureId());
- registerMeasure(pastAsyncMeasure, dao);
- }
- session.commit();
- }
-
- private void registerMeasure(MeasureModel measure, AsyncMeasuresDao dao) {
- AsyncMeasureSnapshot nextAsyncMeasureSnapshot = dao.getNextAsyncMeasureSnapshot(
- measure.getProjectId(), measure.getMetricId(), measure.getMeasureDate());
- Date dateNextAsyncMeasure = (nextAsyncMeasureSnapshot != null) ? nextAsyncMeasureSnapshot.getMeasureDate() : null;
-
- List<AsyncMeasureSnapshot> nextAsyncMeasureSnapshots = dao.getNextAsyncMeasureSnapshotsUntilDate(
- measure, dateNextAsyncMeasure);
- if (!nextAsyncMeasureSnapshots.isEmpty()) {
- for (AsyncMeasureSnapshot asyncMeasureSnapshot : nextAsyncMeasureSnapshots) {
- dao.createAsyncMeasureSnapshot(measure.getId(), asyncMeasureSnapshot.getSnapshotId(), measure.getMeasureDate(),
- asyncMeasureSnapshot.getSnapshotDate(), measure.getMetricId(), measure.getProjectId());
- dao.removeSnapshotFromAsyncMeasureSnapshot(asyncMeasureSnapshot);
- }
- } else {
- List<Snapshot> nextSnapshotsUntilDate = dao.getNextSnapshotsUntilDate(measure, dateNextAsyncMeasure);
- if (!nextSnapshotsUntilDate.isEmpty()) {
- for (Snapshot nextSnapshot : nextSnapshotsUntilDate) {
- dao.createAsyncMeasureSnapshot(measure.getId(), nextSnapshot.getId(), measure.getMeasureDate(),
- nextSnapshot.getCreatedAt(), measure.getMetricId(), measure.getProjectId());
- }
- } else {
- dao.createAsyncMeasureSnapshot(measure.getId(), null, measure.getMeasureDate(),
- null, measure.getMetricId(), measure.getProjectId());
- }
- }
- }
-
-} \ No newline at end of file
diff --git a/sonar-core/src/main/java/org/sonar/jpa/dao/DaoFacade.java b/sonar-core/src/main/java/org/sonar/jpa/dao/DaoFacade.java
index fad86b13ce3..462f8752a81 100644
--- a/sonar-core/src/main/java/org/sonar/jpa/dao/DaoFacade.java
+++ b/sonar-core/src/main/java/org/sonar/jpa/dao/DaoFacade.java
@@ -23,14 +23,12 @@ public class DaoFacade {
private final RulesDao rulesDao;
private final MeasuresDao measuresDao;
- private final AsyncMeasuresDao asyncMeasureDao;
private final ProfilesDao profilesDao;
- public DaoFacade(ProfilesDao profilesDao, RulesDao rulesDao, MeasuresDao measuresDao, AsyncMeasuresDao asyncMeasureDao) {
+ public DaoFacade(ProfilesDao profilesDao, RulesDao rulesDao, MeasuresDao measuresDao) {
super();
this.rulesDao = rulesDao;
this.measuresDao = measuresDao;
- this.asyncMeasureDao = asyncMeasureDao;
this.profilesDao = profilesDao;
}
@@ -45,9 +43,4 @@ public class DaoFacade {
public MeasuresDao getMeasuresDao() {
return measuresDao;
}
-
- public AsyncMeasuresDao getAsyncMeasureDao() {
- return asyncMeasureDao;
- }
-
}
diff --git a/sonar-core/src/main/java/org/sonar/jpa/entity/SchemaMigration.java b/sonar-core/src/main/java/org/sonar/jpa/entity/SchemaMigration.java
index 83e0774bcd7..0a9a08813a0 100644
--- a/sonar-core/src/main/java/org/sonar/jpa/entity/SchemaMigration.java
+++ b/sonar-core/src/main/java/org/sonar/jpa/entity/SchemaMigration.java
@@ -40,7 +40,7 @@ public class SchemaMigration {
- complete the Derby DDL file used for unit tests : sonar-testing-harness/src/main/resources/org/sonar/test/persistence/sonar-test.ddl
*/
- public static final int LAST_VERSION = 210;
+ public static final int LAST_VERSION = 213;
public final static String TABLE_NAME = "schema_migrations";
diff --git a/sonar-core/src/main/resources/META-INF/persistence.xml b/sonar-core/src/main/resources/META-INF/persistence.xml
index 276b3f21cd9..a4a8d36b3e4 100644
--- a/sonar-core/src/main/resources/META-INF/persistence.xml
+++ b/sonar-core/src/main/resources/META-INF/persistence.xml
@@ -29,7 +29,6 @@
<class>org.sonar.api.profiles.RulesProfile</class>
<class>org.sonar.api.rules.ActiveRule</class>
<class>org.sonar.api.rules.ActiveRuleParam</class>
- <class>org.sonar.api.database.model.AsyncMeasureSnapshot</class>
<class>org.sonar.api.batch.Event</class>
<class>org.sonar.api.profiles.Alert</class>
<class>org.sonar.api.rules.ActiveRuleChange</class>
diff --git a/sonar-core/src/test/java/org/sonar/jpa/dao/AsyncMeasuresDaoTest.java b/sonar-core/src/test/java/org/sonar/jpa/dao/AsyncMeasuresDaoTest.java
deleted file mode 100644
index ea86260a583..00000000000
--- a/sonar-core/src/test/java/org/sonar/jpa/dao/AsyncMeasuresDaoTest.java
+++ /dev/null
@@ -1,165 +0,0 @@
-/*
- * Sonar, open source software quality management tool.
- * Copyright (C) 2008-2011 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * Sonar is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * Sonar is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with Sonar; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02
- */
-package org.sonar.jpa.dao;
-
-import org.junit.Test;
-import org.sonar.api.database.model.AsyncMeasureSnapshot;
-import org.sonar.api.database.model.MeasureModel;
-import org.sonar.api.database.model.ResourceModel;
-import org.sonar.api.database.model.Snapshot;
-import org.sonar.jpa.test.AbstractDbUnitTestCase;
-
-import java.text.ParseException;
-import java.text.SimpleDateFormat;
-import java.util.Arrays;
-import java.util.Date;
-import java.util.List;
-
-import static org.hamcrest.CoreMatchers.is;
-import static org.junit.Assert.assertThat;
-
-public class AsyncMeasuresDaoTest extends AbstractDbUnitTestCase {
-
- private static final int PROJECT_ID = 1;
- private static final int METRIC_ID = 1;
-
- @Test
- public void testGetNextAsyncMeasureSnapshot() {
- setupData("sharedFixture", "testGetNextAsyncMeasureSnapshot");
-
- AsyncMeasuresDao asyncMeasuresDao = new AsyncMeasuresDao(getSession());
- AsyncMeasureSnapshot asyncMeasure = asyncMeasuresDao.getNextAsyncMeasureSnapshot(
- PROJECT_ID, METRIC_ID, stringToDate("2008-12-04 08:00:00.00"));
-
- assertThat(asyncMeasure.getId(), is(3));
- }
-
- @Test
- public void testGetNextSnapshotsUntilDate() {
- setupData("sharedFixture", "testGetNextSnapshotsUntilDate");
-
- AsyncMeasuresDao asyncMeasuresDao = new AsyncMeasuresDao(getSession());
- MeasureModel asyncMeasure = getSession().getEntityManager().find(MeasureModel.class, 1l);
- List<Snapshot> snapshotIds = asyncMeasuresDao.getNextSnapshotsUntilDate(
- asyncMeasure, stringToDate("2008-12-06 12:00:00.00"));
-
- assertThat(snapshotIds.size(), is(2));
- assertThat(snapshotIds.get(0).getId(), is(2));
- assertThat(snapshotIds.get(1).getId(), is(4));
- }
-
- @Test
- public void testGetPreviousSnapshot() {
- setupData("sharedFixture", "testGetPreviousSnapshot");
- AsyncMeasuresDao asyncMeasuresDao = new AsyncMeasuresDao(getSession());
- Snapshot s = new Snapshot();
- s.setCreatedAt(stringToDate("2008-12-04 08:00:00.00"));
- s.setScope(ResourceModel.SCOPE_PROJECT);
- ResourceModel resource1 = getSession().getEntity(ResourceModel.class, 1);
- ResourceModel resource2 = getSession().getEntity(ResourceModel.class, 2);
-
- s.setResource(resource1);
- assertThat(asyncMeasuresDao.getPreviousSnapshot(s).getId(), is(1));
-
- s.setResource(resource2);
- assertThat(asyncMeasuresDao.getPreviousSnapshot(s).getId(), is(5));
- }
-
- @Test
- public void testGetNextAsyncMeasureSnapshotsUntilDate() {
- setupData("sharedFixture", "testGetNextAsyncMeasureSnapshotsUntilDate");
-
- AsyncMeasuresDao asyncMeasuresDao = new AsyncMeasuresDao(getSession());
- MeasureModel asyncMeasure = getSession().getEntityManager().find(MeasureModel.class, 3l);
- List<AsyncMeasureSnapshot> asyncMeasureSnapshots = asyncMeasuresDao.getNextAsyncMeasureSnapshotsUntilDate(
- asyncMeasure, stringToDate("2008-12-06 08:00:00.00"));
-
- assertThat(asyncMeasureSnapshots.size(), is(2));
- assertThat(asyncMeasureSnapshots.get(0).getId(), is(2));
- assertThat(asyncMeasureSnapshots.get(1).getId(), is(3));
- }
-
- @Test
- public void testDeleteAsyncMeasure() {
- setupData("sharedFixture", "testDeleteAsyncMeasure");
-
- AsyncMeasuresDao asyncMeasuresDao = new AsyncMeasuresDao(getSession());
- MeasureModel asyncMeasure = getSession().getEntityManager().find(MeasureModel.class, 1l);
- asyncMeasuresDao.deleteAsyncMeasure(asyncMeasure);
-
- getSession().commit();
- checkTables("testDeleteAsyncMeasure", "project_measures", "async_measure_snapshots");
- }
-
- @Test
- public void testGetAsyncMeasureSnapshotsFromSnapshotId() {
- setupData("sharedFixture", "testGetAsyncMeasureSnapshotsFromSnapshotId");
-
- AsyncMeasuresDao asyncMeasuresDao = new AsyncMeasuresDao(getSession());
- Integer snapshotId = 1;
- List<AsyncMeasureSnapshot> asyncMeasureSnapshots = asyncMeasuresDao.getAsyncMeasureSnapshotsFromSnapshotId(
- snapshotId, Arrays.asList(1));
- assertThat(asyncMeasureSnapshots.size(), is(1));
- assertThat(asyncMeasureSnapshots.get(0).getId(), is(2));
- }
-
- @Test
- public void testGetLastAsyncMeasureSnapshot() {
- setupData("sharedFixture", "testGetLastAsyncMeasureSnapshot");
-
- AsyncMeasuresDao asyncMeasuresDao = new AsyncMeasuresDao(getSession());
- AsyncMeasureSnapshot asyncMeasureSnapshot = asyncMeasuresDao.getLastAsyncMeasureSnapshot(
- PROJECT_ID, METRIC_ID, stringToDate("2008-12-04 12:00:00.00"));
- assertThat(asyncMeasureSnapshot.getId(), is(2));
- }
-
- @Test
- public void testDeleteAsyncMeasureSnapshots() {
- setupData("sharedFixture", "testDeleteAsyncMeasureSnapshots");
-
- AsyncMeasuresDao asyncMeasuresDao = new AsyncMeasuresDao(getSession());
- asyncMeasuresDao.deleteAsyncMeasureSnapshots(1l);
-
- checkTables("testDeleteAsyncMeasureSnapshots", "async_measure_snapshots");
- }
-
- @Test
- public void testGetPreviousAsyncMeasureSnapshots() {
- setupData("sharedFixture", "testGetPreviousAsyncMeasureSnapshots");
-
- AsyncMeasuresDao asyncMeasuresDao = new AsyncMeasuresDao(getSession());
- List<AsyncMeasureSnapshot> asyncMeasureSnapshots = asyncMeasuresDao.getPreviousAsyncMeasureSnapshots(
- PROJECT_ID, stringToDate("2008-12-04 08:00:00.00"), stringToDate("2008-12-08 08:00:00.00"));
- assertThat(asyncMeasureSnapshots.size(), is(2));
- assertThat(asyncMeasureSnapshots.get(0).getId(), is(5));
- assertThat(asyncMeasureSnapshots.get(1).getId(), is(6));
- }
-
-
- private static Date stringToDate(String sDate) {
- SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SS");
- try {
- return sdf.parse(sDate);
- } catch (ParseException e) {
- throw new RuntimeException("Bad date format.");
- }
- }
-
-}
diff --git a/sonar-core/src/test/java/org/sonar/jpa/dao/AsyncMeasuresServiceTest.java b/sonar-core/src/test/java/org/sonar/jpa/dao/AsyncMeasuresServiceTest.java
deleted file mode 100644
index 7b936b5ee9f..00000000000
--- a/sonar-core/src/test/java/org/sonar/jpa/dao/AsyncMeasuresServiceTest.java
+++ /dev/null
@@ -1,153 +0,0 @@
-/*
- * Sonar, open source software quality management tool.
- * Copyright (C) 2008-2011 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * Sonar is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * Sonar is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with Sonar; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02
- */
-package org.sonar.jpa.dao;
-
-import org.junit.Test;
-import org.sonar.api.database.model.Snapshot;
-import org.sonar.jpa.test.AbstractDbUnitTestCase;
-
-public class AsyncMeasuresServiceTest extends AbstractDbUnitTestCase {
-
- @Test
- public void assignLatestMeasuresToLastSnapshot() {
- setupData("sharedFixture", "assignLatestMeasuresToLastSnapshot");
-
- AsyncMeasuresService asyncMeasuresService = new AsyncMeasuresService(getSession());
- Snapshot snapshot = getSession().getEntityManager().find(Snapshot.class, 2);
- asyncMeasuresService.refresh(snapshot);
-
- checkTables("assignLatestMeasuresToLastSnapshot", "async_measure_snapshots");
- }
-
- @Test
- public void assignNewMeasuresToLastSnapshot() {
- setupData("sharedFixture", "assignNewMeasuresToLastSnapshot");
-
- AsyncMeasuresService asyncMeasuresService = new AsyncMeasuresService(getSession());
- Snapshot snapshot = getSession().getEntityManager().find(Snapshot.class, 2);
- asyncMeasuresService.refresh(snapshot);
-
- checkTables("assignNewMeasuresToLastSnapshot", "async_measure_snapshots");
- }
-
- @Test
- public void assignMeasuresWhenNoPreviousSnapshot() {
- setupData("sharedFixture", "assignMeasuresWhenNoPreviousSnapshot");
-
- AsyncMeasuresService asyncMeasuresService = new AsyncMeasuresService(getSession());
- Snapshot snapshot = getSession().getEntityManager().find(Snapshot.class, 1);
- asyncMeasuresService.refresh(snapshot);
-
- checkTables("assignMeasuresWhenNoPreviousSnapshot", "async_measure_snapshots");
- }
-
- @Test
- public void assignLatestMeasuresWhenNoPreviousSnapshot() {
- setupData("sharedFixture", "assignLatestMeasuresWhenNoPreviousSnapshot");
-
- AsyncMeasuresService asyncMeasuresService = new AsyncMeasuresService(getSession());
- Snapshot snapshot = getSession().getEntityManager().find(Snapshot.class, 1);
- asyncMeasuresService.refresh(snapshot);
-
- checkTables("assignLatestMeasuresWhenNoPreviousSnapshot", "async_measure_snapshots");
- }
-
- @Test
- public void assignPastMeasuresToPastSnapshot() {
- setupData("sharedFixture", "assignPastMeasuresToPastSnapshot");
-
- AsyncMeasuresService asyncMeasuresService = new AsyncMeasuresService(getSession());
- Snapshot snapshot = getSession().getEntityManager().find(Snapshot.class, 3);
- asyncMeasuresService.refresh(snapshot);
-
- checkTables("assignPastMeasuresToPastSnapshot", "async_measure_snapshots");
- }
-
- @Test
- public void assignNewMeasureToFutureSnapshots() {
- setupData("sharedFixture", "assignNewMeasureToFutureSnapshots");
-
- AsyncMeasuresService asyncMeasuresService = new AsyncMeasuresService(getSession());
- asyncMeasuresService.registerMeasure(2l);
-
- checkTables("assignNewMeasureToFutureSnapshots", "async_measure_snapshots");
- }
-
- @Test
- public void assignMeasureToFutureSnapshotsWithDifferentMetric() {
- setupData("sharedFixture", "assignMeasureToFutureSnapshotsWithDifferentMetric");
-
- AsyncMeasuresService asyncMeasureService = new AsyncMeasuresService(getSession());
- asyncMeasureService.registerMeasure(3l);
-
- checkTables("assignMeasureToFutureSnapshotsWithDifferentMetric", "async_measure_snapshots");
- }
-
- @Test
- public void assignAPastMeasureToNextSnapshotsWithDifferentMetric() {
- setupData("sharedFixture", "assignAPastMeasureToNextSnapshotsWithDifferentMetric");
-
- AsyncMeasuresService asyncMeasureService = new AsyncMeasuresService(getSession());
- asyncMeasureService.registerMeasure(2l);
-
- checkTables("assignAPastMeasureToNextSnapshotsWithDifferentMetric", "async_measure_snapshots");
- }
-
- @Test
- public void addFutureSnapshot() {
- setupData("sharedFixture", "addFutureSnapshot");
-
- AsyncMeasuresService asyncMeasureService = new AsyncMeasuresService(getSession());
- asyncMeasureService.registerMeasure(2l);
-
- checkTables("addFutureSnapshot", "async_measure_snapshots");
- }
-
- @Test
- public void addInvisibleMeasure() {
- setupData("sharedFixture", "addInvisibleMeasure");
-
- AsyncMeasuresService asyncMeasureService = new AsyncMeasuresService(getSession());
- asyncMeasureService.registerMeasure(2l);
-
- checkTables("addInvisibleMeasure", "async_measure_snapshots");
- }
-
- @Test
- public void deleteMeasure() {
- setupData("sharedFixture", "deleteMeasure");
-
- AsyncMeasuresService asyncMeasureService = new AsyncMeasuresService(getSession());
- asyncMeasureService.deleteMeasure(2l);
-
- checkTables("deleteMeasure", "async_measure_snapshots");
- }
-
- @Test
- public void deleteLastMeasure() {
- setupData("sharedFixture", "deleteLastMeasure");
-
- AsyncMeasuresService asyncMeasureService = new AsyncMeasuresService(getSession());
- asyncMeasureService.deleteMeasure(1l);
-
- checkTables("deleteLastMeasure", "async_measure_snapshots");
- }
-
-}
diff --git a/sonar-core/src/test/java/org/sonar/jpa/test/AbstractDbUnitTestCase.java b/sonar-core/src/test/java/org/sonar/jpa/test/AbstractDbUnitTestCase.java
index 834657bb7f9..d8f23f16b50 100644
--- a/sonar-core/src/test/java/org/sonar/jpa/test/AbstractDbUnitTestCase.java
+++ b/sonar-core/src/test/java/org/sonar/jpa/test/AbstractDbUnitTestCase.java
@@ -82,7 +82,7 @@ public abstract class AbstractDbUnitTestCase {
public DaoFacade getDao() {
if (dao == null) {
- dao = new DaoFacade(new ProfilesDao(session), new RulesDao(session), new MeasuresDao(session), new AsyncMeasuresDao(session));
+ dao = new DaoFacade(new ProfilesDao(session), new RulesDao(session), new MeasuresDao(session));
}
return dao;
}
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
deleted file mode 100644
index c748a030e3a..00000000000
--- a/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresDaoTest/sharedFixture.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<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
deleted file mode 100644
index 1905e69d94e..00000000000
--- a/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresDaoTest/testDeleteAsyncMeasure-result.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-<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
deleted file mode 100644
index a31a3a3103f..00000000000
--- a/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresDaoTest/testDeleteAsyncMeasure.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-<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
deleted file mode 100644
index a9371f88cc4..00000000000
--- a/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresDaoTest/testDeleteAsyncMeasureSnapshots-result.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-<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
deleted file mode 100644
index cf0a5f96390..00000000000
--- a/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresDaoTest/testDeleteAsyncMeasureSnapshots.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-<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
deleted file mode 100644
index f83aff294c3..00000000000
--- a/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresDaoTest/testGetAsyncMeasureSnapshotsFromSnapshotId.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-<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
deleted file mode 100644
index c449c6eef14..00000000000
--- a/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresDaoTest/testGetLastAsyncMeasureSnapshot.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-<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
deleted file mode 100644
index baba9aad126..00000000000
--- a/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresDaoTest/testGetNextAsyncMeasureSnapshot.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-<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
deleted file mode 100644
index ff8b246f66b..00000000000
--- a/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresDaoTest/testGetNextAsyncMeasureSnapshotsUntilDate.xml
+++ /dev/null
@@ -1,50 +0,0 @@
-<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
deleted file mode 100644
index 096f1983d3b..00000000000
--- a/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresDaoTest/testGetNextSnapshotsUntilDate.xml
+++ /dev/null
@@ -1,35 +0,0 @@
-<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
deleted file mode 100644
index a268b957d61..00000000000
--- a/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresDaoTest/testGetPreviousAsyncMeasureSnapshots.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-<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
deleted file mode 100644
index 115b532c994..00000000000
--- a/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresDaoTest/testGetPreviousSnapshot.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-<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
deleted file mode 100644
index 7a12ccd2074..00000000000
--- a/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/addFutureSnapshot-result.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-<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
deleted file mode 100644
index 4c2bea917dd..00000000000
--- a/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/addFutureSnapshot.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-<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
deleted file mode 100644
index f10b82f86cd..00000000000
--- a/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/addInvisibleMeasure-result.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-<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
deleted file mode 100644
index bca00e33772..00000000000
--- a/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/addInvisibleMeasure.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-<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
deleted file mode 100644
index 7d20af58577..00000000000
--- a/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/assignAPastMeasureToNextSnapshotsWithDifferentMetric-result.xml
+++ /dev/null
@@ -1,37 +0,0 @@
-<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
deleted file mode 100644
index 74d8837d110..00000000000
--- a/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/assignAPastMeasureToNextSnapshotsWithDifferentMetric.xml
+++ /dev/null
@@ -1,33 +0,0 @@
-<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
deleted file mode 100644
index d881a39193f..00000000000
--- a/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/assignLatestMeasuresToLastSnapshot-result.xml
+++ /dev/null
@@ -1,42 +0,0 @@
-<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
deleted file mode 100644
index 13c290cb14d..00000000000
--- a/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/assignLatestMeasuresToLastSnapshot.xml
+++ /dev/null
@@ -1,36 +0,0 @@
-<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
deleted file mode 100644
index 99475dfb9d1..00000000000
--- a/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/assignLatestMeasuresWhenNoPreviousSnapshot-result.xml
+++ /dev/null
@@ -1,45 +0,0 @@
-<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
deleted file mode 100644
index 7ea8aa5fbaa..00000000000
--- a/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/assignLatestMeasuresWhenNoPreviousSnapshot.xml
+++ /dev/null
@@ -1,43 +0,0 @@
-<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
deleted file mode 100644
index d2b62cbf6d8..00000000000
--- a/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/assignMeasureToFutureSnapshotsWithDifferentMetric-result.xml
+++ /dev/null
@@ -1,59 +0,0 @@
-<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
deleted file mode 100644
index 9d343211f29..00000000000
--- a/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/assignMeasureToFutureSnapshotsWithDifferentMetric.xml
+++ /dev/null
@@ -1,49 +0,0 @@
-<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
deleted file mode 100644
index f8df127f391..00000000000
--- a/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/assignMeasuresWhenNoPreviousSnapshot-result.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-<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
deleted file mode 100644
index 036b21882df..00000000000
--- a/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/assignMeasuresWhenNoPreviousSnapshot.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-<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
deleted file mode 100644
index 36a166be735..00000000000
--- a/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/assignNewMeasureToFutureSnapshots-result.xml
+++ /dev/null
@@ -1,44 +0,0 @@
-<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
deleted file mode 100644
index 5478f7f10bc..00000000000
--- a/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/assignNewMeasureToFutureSnapshots.xml
+++ /dev/null
@@ -1,36 +0,0 @@
-<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
deleted file mode 100644
index 977d0365d79..00000000000
--- a/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/assignNewMeasuresToLastSnapshot-result.xml
+++ /dev/null
@@ -1,43 +0,0 @@
-<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
deleted file mode 100644
index c73190edccd..00000000000
--- a/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/assignNewMeasuresToLastSnapshot.xml
+++ /dev/null
@@ -1,42 +0,0 @@
-<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
deleted file mode 100644
index 04ea0cd38d6..00000000000
--- a/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/assignPastMeasuresToPastSnapshot-result.xml
+++ /dev/null
@@ -1,47 +0,0 @@
-<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
deleted file mode 100644
index 1916d0b87f4..00000000000
--- a/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/assignPastMeasuresToPastSnapshot.xml
+++ /dev/null
@@ -1,42 +0,0 @@
-<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
deleted file mode 100644
index bbfd4845003..00000000000
--- a/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/deleteLastMeasure-result.xml
+++ /dev/null
@@ -1,30 +0,0 @@
-<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
deleted file mode 100644
index d0a260f60f1..00000000000
--- a/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/deleteLastMeasure.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<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
deleted file mode 100644
index ed2be1cb346..00000000000
--- a/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/deleteMeasure-result.xml
+++ /dev/null
@@ -1,41 +0,0 @@
-<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
deleted file mode 100644
index 17b279547f2..00000000000
--- a/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/deleteMeasure.xml
+++ /dev/null
@@ -1,39 +0,0 @@
-<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/AsyncMeasuresServiceTest/sharedFixture.xml b/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/sharedFixture.xml
deleted file mode 100644
index d1a6b09be2f..00000000000
--- a/sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/sharedFixture.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-<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"/>
-
- <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]"/>
-
-</dataset> \ No newline at end of file
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/database/model/AsyncMeasureSnapshot.java b/sonar-plugin-api/src/main/java/org/sonar/api/database/model/AsyncMeasureSnapshot.java
deleted file mode 100644
index 2abee562b20..00000000000
--- a/sonar-plugin-api/src/main/java/org/sonar/api/database/model/AsyncMeasureSnapshot.java
+++ /dev/null
@@ -1,172 +0,0 @@
-/*
- * Sonar, open source software quality management tool.
- * Copyright (C) 2008-2011 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * Sonar is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * Sonar is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with Sonar; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02
- */
-package org.sonar.api.database.model;
-
-import org.apache.commons.lang.builder.EqualsBuilder;
-import org.apache.commons.lang.builder.HashCodeBuilder;
-import org.apache.commons.lang.builder.ToStringBuilder;
-import org.sonar.api.database.BaseIdentifiable;
-
-import java.util.Date;
-import javax.persistence.*;
-
-/**
- * Class to map an aysync measure with hibernate model
- */
-@Entity
-@Table(name = "async_measure_snapshots")
-public class AsyncMeasureSnapshot extends BaseIdentifiable {
-
- @Column(name = "project_measure_id", updatable = true, nullable = true)
- private Long measureId;
-
- @Temporal(TemporalType.TIMESTAMP)
- @Column(name = "measure_date", updatable = true, nullable = true)
- private Date measureDate;
-
- @Column(name = "snapshot_id", updatable = true, nullable = true)
- private Integer snapshotId;
-
- @Temporal(TemporalType.TIMESTAMP)
- @Column(name = "snapshot_date", updatable = true, nullable = true)
- private Date snapshotDate;
-
- @Column(name = "metric_id", updatable = true, nullable = true)
- private Integer metricId;
-
- @Column(name = "project_id", updatable = true, nullable = true)
- private Integer projectId;
-
- /**
- * This is the constructor to use
- *
- * @param measureId
- * @param snapshotId the snapshot id to which the measure is attached
- * @param measureDate the date of the measure
- * @param snapshotDate the snapshot date
- * @param metricId the metric the measure is attached to
- * @param projectId the id of the project
- */
- public AsyncMeasureSnapshot(Long measureId, Integer snapshotId, Date measureDate, Date snapshotDate, Integer metricId, Integer projectId) {
- this.measureId = measureId;
- this.measureDate = measureDate;
- this.snapshotId = snapshotId;
- this.snapshotDate = snapshotDate;
- this.projectId = projectId;
- this.metricId = metricId;
- }
-
- /**
- * Default constructor
- */
- public AsyncMeasureSnapshot() {
- }
-
- public Long getMeasureId() {
- return measureId;
- }
-
- public void setMeasureId(Long measureId) {
- this.measureId = measureId;
- }
-
- public Integer getSnapshotId() {
- return snapshotId;
- }
-
- public void setSnapshotId(Integer snapshotId) {
- this.snapshotId = snapshotId;
- }
-
- public Date getMeasureDate() {
- return measureDate;
- }
-
- public void setMeasureDate(Date measureDate) {
- this.measureDate = measureDate;
- }
-
- public Date getSnapshotDate() {
- return snapshotDate;
- }
-
- public void setSnapshotDate(Date snapshotDate) {
- this.snapshotDate = snapshotDate;
- }
-
- public Integer getMetricId() {
- return metricId;
- }
-
- public void setMetricId(Integer metricId) {
- this.metricId = metricId;
- }
-
- public Integer getProjectId() {
- return projectId;
- }
-
- public void setProjectId(Integer projectId) {
- this.projectId = projectId;
- }
-
- public void setMeasure(MeasureModel measure) {
- setMeasureId(measure.getId());
- setMeasureDate(measure.getMeasureDate());
- }
-
- @Override
- public boolean equals(Object obj) {
- if (!(obj instanceof AsyncMeasureSnapshot)) {
- return false;
- }
- if (this == obj) {
- return true;
- }
- AsyncMeasureSnapshot other = (AsyncMeasureSnapshot) obj;
- return new EqualsBuilder()
- .append(measureId, other.getMeasureId())
- .append(measureDate, other.getMeasureDate())
- .append(snapshotId, other.getSnapshotId())
- .append(snapshotDate, other.getSnapshotDate())
- .isEquals();
- }
-
- @Override
- public int hashCode() {
- return new HashCodeBuilder(17, 37)
- .append(measureId)
- .append(measureDate)
- .append(snapshotDate)
- .append(snapshotId)
- .toHashCode();
- }
-
- @Override
- public String toString() {
- return new ToStringBuilder(this)
- .append("id", getId())
- .append("measureId", measureId)
- .append("measureDate", measureDate)
- .append("snapshotId", snapshotId)
- .append("snapshotDate", snapshotDate)
- .toString();
- }
-}
diff --git a/sonar-server/src/main/java/org/sonar/server/platform/Platform.java b/sonar-server/src/main/java/org/sonar/server/platform/Platform.java
index 3f3ee2f382c..6afe5f7d449 100644
--- a/sonar-server/src/main/java/org/sonar/server/platform/Platform.java
+++ b/sonar-server/src/main/java/org/sonar/server/platform/Platform.java
@@ -162,11 +162,9 @@ public final class Platform {
servicesContainer.as(Characteristics.NO_CACHE).addComponent(MeasuresDao.class);
servicesContainer.as(Characteristics.NO_CACHE).addComponent(org.sonar.api.database.daos.MeasuresDao.class);
servicesContainer.as(Characteristics.NO_CACHE).addComponent(ProfilesDao.class);
- servicesContainer.as(Characteristics.NO_CACHE).addComponent(AsyncMeasuresDao.class);
servicesContainer.as(Characteristics.NO_CACHE).addComponent(DaoFacade.class);
servicesContainer.as(Characteristics.NO_CACHE).addComponent(DefaultRulesManager.class);
servicesContainer.as(Characteristics.NO_CACHE).addComponent(ProfilesManager.class);
- servicesContainer.as(Characteristics.NO_CACHE).addComponent(AsyncMeasuresService.class);
servicesContainer.as(Characteristics.NO_CACHE).addComponent(Backup.class);
servicesContainer.as(Characteristics.CACHE).addComponent(AuthenticatorFactory.class);
servicesContainer.as(Characteristics.CACHE).addComponent(ServerLifecycleNotifier.class);
diff --git a/sonar-server/src/main/java/org/sonar/server/ui/JRubyFacade.java b/sonar-server/src/main/java/org/sonar/server/ui/JRubyFacade.java
index 7e1e99c67cc..8c60ad0fab7 100644
--- a/sonar-server/src/main/java/org/sonar/server/ui/JRubyFacade.java
+++ b/sonar-server/src/main/java/org/sonar/server/ui/JRubyFacade.java
@@ -32,7 +32,6 @@ import org.sonar.api.rules.RulePriority;
import org.sonar.api.rules.RuleRepository;
import org.sonar.api.utils.ValidationMessages;
import org.sonar.api.web.*;
-import org.sonar.jpa.dao.AsyncMeasuresService;
import org.sonar.jpa.dialect.Dialect;
import org.sonar.jpa.session.DatabaseConnector;
import org.sonar.markdown.Markdown;
@@ -261,22 +260,10 @@ public final class JRubyFacade {
return getContainer().getComponent(Backup.class);
}
- public void registerAsyncMeasure(long asyncMeasureId) {
- getAsyncMeasuresService().registerMeasure(asyncMeasureId);
- }
-
- public void deleteAsyncMeasure(long asyncMeasureId) {
- getAsyncMeasuresService().deleteMeasure(asyncMeasureId);
- }
-
private ProfilesManager getProfilesManager() {
return getContainer().getComponent(ProfilesManager.class);
}
- private AsyncMeasuresService getAsyncMeasuresService() {
- return getContainer().getComponent(AsyncMeasuresService.class);
- }
-
public void reloadConfiguration() {
getContainer().getComponent(CoreConfiguration.class).reload();
}
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/controllers/components_controller.rb b/sonar-server/src/main/webapp/WEB-INF/app/controllers/components_controller.rb
index f70f303af8b..8a68161aaeb 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/controllers/components_controller.rb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/controllers/components_controller.rb
@@ -105,7 +105,6 @@ class ComponentsController < ApplicationController
'rule_id' => nil,
'rule_priority' => nil,
'characteristic_id' => nil}))
- measures.concat(AsyncMeasureSnapshot.search(page_sids, mids))
end
measures
else
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/controllers/metrics_controller.rb b/sonar-server/src/main/webapp/WEB-INF/app/controllers/metrics_controller.rb
index 75077f60ff9..435943a7b61 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/controllers/metrics_controller.rb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/controllers/metrics_controller.rb
@@ -73,7 +73,6 @@ class MetricsController < ApplicationController
def delete_from_web
metric = Metric.by_id(params[:id].to_i) if params[:id] && params[:id].size > 0
if metric
- AsyncMeasureSnapshot.delete_all("metric_id = #{metric.id}")
del_count = Metric.delete(params[:id].to_i)
flash[:notice] = 'Successfully deleted.' if del_count == 1
flash[:error] = 'Unable to delete this metric.' if del_count != 1
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/controllers/project_controller.rb b/sonar-server/src/main/webapp/WEB-INF/app/controllers/project_controller.rb
index 24b1d8aa46e..00be0035799 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/controllers/project_controller.rb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/controllers/project_controller.rb
@@ -18,8 +18,8 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02
#
class ProjectController < ApplicationController
- verify :method => :post, :only => [ :set_links, :add_review, :set_exclusions, :delete_exclusions ], :redirect_to => { :action => :index }
- verify :method => :delete, :only => [ :delete, :delete_review ], :redirect_to => { :action => :index }
+ verify :method => :post, :only => [ :set_links, :set_exclusions, :delete_exclusions ], :redirect_to => { :action => :index }
+ verify :method => :delete, :only => [ :delete ], :redirect_to => { :action => :index }
SECTION=Navigation::SECTION_RESOURCE
@@ -27,73 +27,6 @@ class ProjectController < ApplicationController
redirect_to :overwrite_params => {:controller => :dashboard, :action => 'index'}
end
- def show_reviews
- @snapshot = Snapshot.find(params[:sid].to_i)
- render :partial => 'dashboard_reviews'
- end
-
- def edit_review
- @snapshot = Snapshot.find(params[:sid].to_i)
- return access_denied unless has_role?(:admin, @snapshot)
-
- @review = ProjectMeasure.new(:measure_date => @snapshot.created_at, :value => 0)
- @review_types = Metric.review_types
- render :partial => 'dashboard_edit_review'
- end
-
- def add_review
- @snapshot=Snapshot.find(params[:sid].to_i)
- return access_denied unless has_role?(:admin, @snapshot)
-
- measure = ProjectMeasure.new(params[:review])
- measure.project = @snapshot.project
-
- if measure.metric.nil?
- flash[:error] = 'Please select a metric'
- redirect_to :action => 'index', :id => measure.project_id
- return
- end
-
- if measure.measure_date <= @snapshot.created_at.to_date
- if measure.metric.val_type==Metric::VALUE_TYPE_STRING
- measure.text_value=params['review']['value']
- measure.value=0
- end
- measure.url=params[:url] if params[:url]
- measure.description=params[:description] if params[:description]
- begin
- measure.save!
- java_facade.registerAsyncMeasure(measure.id.to_i)
- flash[:notice] = 'Measure added'
- rescue
- flash[:error] = measure.errors.full_messages.join("<br/>")
- end
-
- else
- flash[:error] = "The date should not be after #{l(@snapshot.created_at.to_date)}"
- end
-
- if request.xhr?
- render :update do |page|
- page.redirect_to :action => 'index', :id => measure.project_id
- end
- else
- redirect_to :action => 'index', :id => measure.project_id
- end
- end
-
- def delete_review
- measure = ProjectMeasure.find(params[:id].to_i)
- if measure && measure.review?
- return access_denied unless has_role?(:admin, measure.project)
-
- java_facade.deleteAsyncMeasure(measure.id.to_i)
- redirect_to :action => 'index', :id => measure.project_id
- else
- redirect_to_default
- end
- end
-
def delete
if params[:id]
@project = Project.by_key(params[:id])
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/controllers/timemachine_controller.rb b/sonar-server/src/main/webapp/WEB-INF/app/controllers/timemachine_controller.rb
index d2841e7b3d9..47d0d223998 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/controllers/timemachine_controller.rb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/controllers/timemachine_controller.rb
@@ -53,7 +53,6 @@ class TimemachineController < ApplicationController
end
measures=ProjectMeasure.find(:all, :conditions => {:rule_id => nil, :rule_priority => nil, :snapshot_id => @sids, :characteristic_id => nil})
- measures.concat(AsyncMeasureSnapshot.search(@sids))
rows_by_metric_id={}
@rows=[]
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/models/filter.rb b/sonar-server/src/main/webapp/WEB-INF/app/models/filter.rb
index b1bf557b18d..e4462407d9b 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/models/filter.rb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/models/filter.rb
@@ -38,7 +38,7 @@ class Filter < ActiveRecord::Base
def criterion(family, key=nil)
criteria.each do |criterion|
if criterion.family==family && criterion.key==key
- return criterion if ((key.nil? && criterion.key.nil?) || (key && key==criterion.key))
+ return criterion if ((key.nil? && criterion.key.nil?) || (key && key==criterion.key))
end
end
nil
@@ -95,13 +95,6 @@ class Filter < ActiveRecord::Base
column('links')
end
- def display_user_managed_metrics?
- columns.each do |col|
- return true if col.metric && col.metric.user_managed?
- end
- false
- end
-
def default_view
read_attribute(:default_view) || VIEW_LIST
end
@@ -145,7 +138,7 @@ class Filter < ActiveRecord::Base
columns.each do |col|
return col if col.id==col_id
end
- return nil
+ nil
end
def clean_columns_order
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/models/filter_context.rb b/sonar-server/src/main/webapp/WEB-INF/app/models/filter_context.rb
index 82dad3b41fa..7ce80b37ea3 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/models/filter_context.rb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/models/filter_context.rb
@@ -58,10 +58,6 @@
if @metric_ids.size>0
measures=ProjectMeasure.find(:all, :conditions => ['rule_priority is null and rule_id is null and characteristic_id is null and snapshot_id in (?)', @page_sids])
- if filter.display_user_managed_metrics?
- measures.concat(AsyncMeasureSnapshot.search(@page_sids, @metric_ids))
- end
-
measures.each do |m|
snapshot=@snapshots_by_id[m.snapshot_id]
@measures_by_snapshot[snapshot]||={}
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/models/project_measure.rb b/sonar-server/src/main/webapp/WEB-INF/app/models/project_measure.rb
index 54675821f79..1921ddfe8c3 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/models/project_measure.rb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/models/project_measure.rb
@@ -31,9 +31,6 @@ class ProjectMeasure < ActiveRecord::Base
belongs_to :characteristic
has_one :measure_data, :class_name => 'MeasureData', :foreign_key => 'measure_id'
- has_many :async_measure_snapshots
- has_many :snapshots, :through => :async_measure_snapshots
-
validates_numericality_of :value, :if => :numerical_metric?
validate :validate_date, :validate_value
@@ -213,49 +210,6 @@ class ProjectMeasure < ActiveRecord::Base
end
end
- # return reviews from the snapshot and also reviews created after the snapshot
- def self.find_reviews_for_last_snapshot(snapshot)
- ProjectMeasure.find(:all, :include => [:async_measure_snapshots, :measure_data],
- :conditions => ['async_measure_snapshots.project_id=project_measures.project_id AND ' +
- '((async_measure_snapshots.snapshot_id IS NULL AND project_measures.measure_date>?) ' +
- 'OR async_measure_snapshots.snapshot_id=?) ', snapshot.created_at, snapshot.id])
- end
-
- def self.find_reviews_for_last_snapshot_with_opts(snapshot, options)
- metrics = options[:metrics].nil? ? [] : Metric.ids_from_keys(options[:metrics].split(','))
- include = (options[:includeparams] == "true") ? [:async_measure_snapshots, :measure_data] : :async_measure_snapshots
-
- metrics_conditions = (metrics.empty?) ? "" : "AND project_measures.metric_id IN (?)"
- conditions = 'async_measure_snapshots.project_id=project_measures.project_id AND ' +
- '((async_measure_snapshots.snapshot_id IS NULL AND project_measures.measure_date>?) ' +
- 'OR async_measure_snapshots.snapshot_id=?) ' + metrics_conditions
- if metrics.empty?
- ProjectMeasure.find(:all, :include => include, :conditions => [conditions, snapshot.created_at, snapshot.id])
- else
- ProjectMeasure.find(:all, :include => include, :conditions => [conditions, snapshot.created_at, snapshot.id, metrics])
- end
- end
-
- def self.find_reviews(snapshot)
- conditions = 'async_measure_snapshots.snapshot_id=? ' + metrics_conditions
- ProjectMeasure.find(:all, :include => [:async_measure_snapshots, :measure_data],
- :conditions => ['async_measure_snapshots.snapshot_id=? ', snapshot.id])
- end
-
-
- def self.find_reviews_with_opts(snapshot, options={})
- metrics = options[:metrics].nil? ? [] : Metric.ids_from_keys(options[:metrics].split(','))
- include = (options[:includeparams] == "true") ? [:async_measure_snapshots, :measure_data] : :async_measure_snapshots
-
- metrics_conditions = (metrics.empty?) ? "" : "AND project_measures.metric_id IN (?)"
- conditions = 'async_measure_snapshots.snapshot_id=? ' + metrics_conditions
- if metrics.empty?
- ProjectMeasure.find(:all, :include => include, :conditions => [conditions, snapshot.id])
- else
- ProjectMeasure.find(:all, :include => include, :conditions => [conditions, snapshot.id, metrics])
- end
- end
-
def tip
if rule_id
rule.description
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/models/snapshot.rb b/sonar-server/src/main/webapp/WEB-INF/app/models/snapshot.rb
index 9a0d2b5eaa3..5a6fd0ea838 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/models/snapshot.rb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/models/snapshot.rb
@@ -35,10 +35,6 @@ class Snapshot < ActiveRecord::Base
has_one :source, :class_name => 'SnapshotSource', :dependent => :destroy
has_many :violations, :class_name => 'RuleFailure'
- has_many :async_measure_snapshots
- has_many :async_measures, :through => :async_measure_snapshots
-
-
STATUS_UNPROCESSED = 'U'
STATUS_PROCESSED = 'P'
@@ -98,10 +94,6 @@ class Snapshot < ActiveRecord::Base
parent_snapshot_id.nil?
end
- def all_measures
- measures + async_measures
- end
-
def descendants
children.map(&:descendants).flatten + children
end
@@ -219,7 +211,7 @@ class Snapshot < ActiveRecord::Base
@measures_hash ||=
begin
hash = {}
- all_measures.each do |measure|
+ measures.each do |measure|
hash[measure.metric_id]=measure
end
hash
diff --git a/sonar-server/src/main/webapp/WEB-INF/db/migrate/048_create_async_measure_snapshots_table.rb b/sonar-server/src/main/webapp/WEB-INF/db/migrate/048_create_async_measure_snapshots_table.rb
index 269022642c2..2f56659b79b 100644
--- a/sonar-server/src/main/webapp/WEB-INF/db/migrate/048_create_async_measure_snapshots_table.rb
+++ b/sonar-server/src/main/webapp/WEB-INF/db/migrate/048_create_async_measure_snapshots_table.rb
@@ -23,11 +23,11 @@ class CreateAsyncMeasureSnapshotsTable < ActiveRecord::Migration
create_table :async_measure_snapshots do |t|
t.column :project_measure_id, :integer, :null => true
t.column :measure_date, :datetime, :null => true
- t.column :snapshot_id, :integer, :null => true
+ t.column :snapshot_id, :integer, :null => true
t.column :snapshot_date, :datetime, :null => true
- t.column :metric_id, :integer, :null => true
- t.column :project_id, :integer, :null => true
- end
+ t.column :metric_id, :integer, :null => true
+ t.column :project_id, :integer, :null => true
+ end
add_index :async_measure_snapshots, :snapshot_id, :name => 'async_m_s_snapshot_id'
add_index :async_measure_snapshots, :project_measure_id, :name => 'async_m_s_measure_id'
add_index :async_measure_snapshots, [:project_id, :metric_id], :name => 'async_m_s_project_metric'
diff --git a/sonar-server/src/main/webapp/WEB-INF/db/migrate/151_create_dashboards.rb b/sonar-server/src/main/webapp/WEB-INF/db/migrate/151_create_dashboards.rb
index a30b36ad7f2..140b7c90213 100644
--- a/sonar-server/src/main/webapp/WEB-INF/db/migrate/151_create_dashboards.rb
+++ b/sonar-server/src/main/webapp/WEB-INF/db/migrate/151_create_dashboards.rb
@@ -77,10 +77,9 @@ class CreateDashboards < ActiveRecord::Migration
dashboard.widgets.build(:widget_key => 'description', :name => 'Description', :column_index => 1, :row_index => 6, :configured => true)
dashboard.widgets.build(:widget_key => 'rules', :name => 'Rules', :column_index => 2, :row_index => 1, :configured => true)
dashboard.widgets.build(:widget_key => 'alerts', :name => 'Alerts', :column_index => 2, :row_index => 2, :configured => true)
- dashboard.widgets.build(:widget_key => 'custom_measures', :name => 'Custom measures', :column_index => 2, :row_index => 3, :configured => true)
- dashboard.widgets.build(:widget_key => 'file_design', :name => 'File design', :column_index => 2, :row_index => 4, :configured => true)
- dashboard.widgets.build(:widget_key => 'package_design', :name => 'Package design', :column_index => 2, :row_index => 5, :configured => true)
- dashboard.widgets.build(:widget_key => 'ckjm', :name => 'CKJM', :column_index => 2, :row_index => 6, :configured => true)
+ dashboard.widgets.build(:widget_key => 'file_design', :name => 'File design', :column_index => 2, :row_index => 3, :configured => true)
+ dashboard.widgets.build(:widget_key => 'package_design', :name => 'Package design', :column_index => 2, :row_index => 4, :configured => true)
+ dashboard.widgets.build(:widget_key => 'ckjm', :name => 'CKJM', :column_index => 2, :row_index => 5, :configured => true)
dashboard.save
dashboard
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/models/async_measure_snapshot.rb b/sonar-server/src/main/webapp/WEB-INF/db/migrate/211_create_manual_measures.rb
index 2f37204dded..72e065fc238 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/models/async_measure_snapshot.rb
+++ b/sonar-server/src/main/webapp/WEB-INF/db/migrate/211_create_manual_measures.rb
@@ -17,32 +17,14 @@
# License along with Sonar; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02
#
-class AsyncMeasureSnapshot < ActiveRecord::Base
-
- belongs_to :async_measure, :foreign_key => 'project_measure_id', :class_name => "ProjectMeasure"
- belongs_to :snapshot
- def self.search(sids, metric_ids=nil)
- sql='async_measure_snapshots.snapshot_id IN (:sids)'
- hash={:sids => sids}
- if metric_ids
- sql+=' AND async_measure_snapshots.metric_id IN (:mids)'
- hash[:mids]=metric_ids
- end
- async_measures=AsyncMeasureSnapshot.find(:all,
- :include => ['async_measure'],
- :conditions => [sql, hash])
+#
+# Sonar 2.10
+#
+class CreateManualMeasures < ActiveRecord::Migration
- result=[]
- async_measures.each do |am|
- clone=am.async_measure.clone
- clone.snapshot_id=am.snapshot_id
- result<<clone
- end
- result
+ def self.up
+ # TODO
end
- def measure
- async_measure
- end
-end \ No newline at end of file
+end
diff --git a/sonar-server/src/main/webapp/WEB-INF/db/migrate/212_move_async_measures.rb b/sonar-server/src/main/webapp/WEB-INF/db/migrate/212_move_async_measures.rb
new file mode 100644
index 00000000000..bdd7fd6b42e
--- /dev/null
+++ b/sonar-server/src/main/webapp/WEB-INF/db/migrate/212_move_async_measures.rb
@@ -0,0 +1,30 @@
+#
+# Sonar, entreprise quality control tool.
+# Copyright (C) 2008-2011 SonarSource
+# mailto:contact AT sonarsource DOT com
+#
+# Sonar is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 3 of the License, or (at your option) any later version.
+#
+# Sonar is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with Sonar; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02
+#
+
+#
+# Sonar 2.10
+#
+class MoveAsyncMeasures < ActiveRecord::Migration
+
+ def self.up
+ # TODO
+ end
+
+end
diff --git a/sonar-server/src/main/webapp/WEB-INF/db/migrate/213_drop_async_measures_table.rb b/sonar-server/src/main/webapp/WEB-INF/db/migrate/213_drop_async_measures_table.rb
new file mode 100644
index 00000000000..7346d954978
--- /dev/null
+++ b/sonar-server/src/main/webapp/WEB-INF/db/migrate/213_drop_async_measures_table.rb
@@ -0,0 +1,33 @@
+#
+# Sonar, entreprise quality control tool.
+# Copyright (C) 2008-2011 SonarSource
+# mailto:contact AT sonarsource DOT com
+#
+# Sonar is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 3 of the License, or (at your option) any later version.
+#
+# Sonar is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with Sonar; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02
+#
+
+#
+# Sonar 2.10
+#
+class DropAsyncMeasuresTable < ActiveRecord::Migration
+
+ def self.up
+ remove_index('async_measure_snapshots', :name => 'async_m_s_snapshot_id')
+ remove_index('async_measure_snapshots', :name => 'async_m_s_measure_id')
+ remove_index('async_measure_snapshots', :name => 'async_m_s_project_metric')
+ drop_table('async_measure_snapshots')
+ end
+
+end
diff --git a/sonar-testing-harness/src/main/resources/org/sonar/test/persistence/sonar-test.ddl b/sonar-testing-harness/src/main/resources/org/sonar/test/persistence/sonar-test.ddl
index a2c2ad8d445..c9feaaa71f9 100644
--- a/sonar-testing-harness/src/main/resources/org/sonar/test/persistence/sonar-test.ddl
+++ b/sonar-testing-harness/src/main/resources/org/sonar/test/persistence/sonar-test.ddl
@@ -67,20 +67,6 @@ create table ALERTS (
primary key (id)
);
-create table ASYNC_MEASURE_SNAPSHOTS (
- ID INTEGER not null,
- PROJECT_MEASURE_ID INTEGER,
- MEASURE_DATE TIMESTAMP,
- SNAPSHOT_ID INTEGER,
- SNAPSHOT_DATE TIMESTAMP,
- METRIC_ID INTEGER,
- PROJECT_ID INTEGER,
- primary key (id)
-);
-CREATE INDEX ASYNC_M_S_MEASURE_ID ON ASYNC_MEASURE_SNAPSHOTS (PROJECT_MEASURE_ID);
-CREATE INDEX ASYNC_M_S_PROJECT_METRIC ON ASYNC_MEASURE_SNAPSHOTS (PROJECT_ID, METRIC_ID);
-CREATE INDEX ASYNC_M_S_SNAPSHOT_ID ON ASYNC_MEASURE_SNAPSHOTS (SNAPSHOT_ID);
-
create table CHARACTERISTICS (
ID INTEGER not null,
QUALITY_MODEL_ID INTEGER,