]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-2610 Replace the table ASYNC_MEASURES_SNAPSHOTS by MANUAL_MEASURES
authorSimon Brandhof <simon.brandhof@gmail.com>
Tue, 12 Jul 2011 15:29:09 +0000 (17:29 +0200)
committerSimon Brandhof <simon.brandhof@gmail.com>
Tue, 12 Jul 2011 15:29:27 +0000 (17:29 +0200)
68 files changed:
plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/CorePlugin.java
plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/sensors/AsynchronousMeasuresSensor.java [deleted file]
plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/widgets/CustomMeasuresWidget.java [deleted file]
plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/custom_measures.html.erb [deleted file]
sonar-batch/src/main/java/org/sonar/batch/bootstrap/ProjectModule.java
sonar-core/src/main/java/org/sonar/jpa/dao/AsyncMeasuresDao.java [deleted file]
sonar-core/src/main/java/org/sonar/jpa/dao/AsyncMeasuresService.java [deleted file]
sonar-core/src/main/java/org/sonar/jpa/dao/DaoFacade.java
sonar-core/src/main/java/org/sonar/jpa/entity/SchemaMigration.java
sonar-core/src/main/resources/META-INF/persistence.xml
sonar-core/src/test/java/org/sonar/jpa/dao/AsyncMeasuresDaoTest.java [deleted file]
sonar-core/src/test/java/org/sonar/jpa/dao/AsyncMeasuresServiceTest.java [deleted file]
sonar-core/src/test/java/org/sonar/jpa/test/AbstractDbUnitTestCase.java
sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresDaoTest/sharedFixture.xml [deleted file]
sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresDaoTest/testDeleteAsyncMeasure-result.xml [deleted file]
sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresDaoTest/testDeleteAsyncMeasure.xml [deleted file]
sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresDaoTest/testDeleteAsyncMeasureSnapshots-result.xml [deleted file]
sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresDaoTest/testDeleteAsyncMeasureSnapshots.xml [deleted file]
sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresDaoTest/testGetAsyncMeasureSnapshotsFromSnapshotId.xml [deleted file]
sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresDaoTest/testGetLastAsyncMeasureSnapshot.xml [deleted file]
sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresDaoTest/testGetNextAsyncMeasureSnapshot.xml [deleted file]
sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresDaoTest/testGetNextAsyncMeasureSnapshotsUntilDate.xml [deleted file]
sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresDaoTest/testGetNextSnapshotsUntilDate.xml [deleted file]
sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresDaoTest/testGetPreviousAsyncMeasureSnapshots.xml [deleted file]
sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresDaoTest/testGetPreviousSnapshot.xml [deleted file]
sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/addFutureSnapshot-result.xml [deleted file]
sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/addFutureSnapshot.xml [deleted file]
sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/addInvisibleMeasure-result.xml [deleted file]
sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/addInvisibleMeasure.xml [deleted file]
sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/assignAPastMeasureToNextSnapshotsWithDifferentMetric-result.xml [deleted file]
sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/assignAPastMeasureToNextSnapshotsWithDifferentMetric.xml [deleted file]
sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/assignLatestMeasuresToLastSnapshot-result.xml [deleted file]
sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/assignLatestMeasuresToLastSnapshot.xml [deleted file]
sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/assignLatestMeasuresWhenNoPreviousSnapshot-result.xml [deleted file]
sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/assignLatestMeasuresWhenNoPreviousSnapshot.xml [deleted file]
sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/assignMeasureToFutureSnapshotsWithDifferentMetric-result.xml [deleted file]
sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/assignMeasureToFutureSnapshotsWithDifferentMetric.xml [deleted file]
sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/assignMeasuresWhenNoPreviousSnapshot-result.xml [deleted file]
sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/assignMeasuresWhenNoPreviousSnapshot.xml [deleted file]
sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/assignNewMeasureToFutureSnapshots-result.xml [deleted file]
sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/assignNewMeasureToFutureSnapshots.xml [deleted file]
sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/assignNewMeasuresToLastSnapshot-result.xml [deleted file]
sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/assignNewMeasuresToLastSnapshot.xml [deleted file]
sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/assignPastMeasuresToPastSnapshot-result.xml [deleted file]
sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/assignPastMeasuresToPastSnapshot.xml [deleted file]
sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/deleteLastMeasure-result.xml [deleted file]
sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/deleteLastMeasure.xml [deleted file]
sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/deleteMeasure-result.xml [deleted file]
sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/deleteMeasure.xml [deleted file]
sonar-core/src/test/resources/org/sonar/jpa/dao/AsyncMeasuresServiceTest/sharedFixture.xml [deleted file]
sonar-plugin-api/src/main/java/org/sonar/api/database/model/AsyncMeasureSnapshot.java [deleted file]
sonar-server/src/main/java/org/sonar/server/platform/Platform.java
sonar-server/src/main/java/org/sonar/server/ui/JRubyFacade.java
sonar-server/src/main/webapp/WEB-INF/app/controllers/components_controller.rb
sonar-server/src/main/webapp/WEB-INF/app/controllers/metrics_controller.rb
sonar-server/src/main/webapp/WEB-INF/app/controllers/project_controller.rb
sonar-server/src/main/webapp/WEB-INF/app/controllers/timemachine_controller.rb
sonar-server/src/main/webapp/WEB-INF/app/models/async_measure_snapshot.rb [deleted file]
sonar-server/src/main/webapp/WEB-INF/app/models/filter.rb
sonar-server/src/main/webapp/WEB-INF/app/models/filter_context.rb
sonar-server/src/main/webapp/WEB-INF/app/models/project_measure.rb
sonar-server/src/main/webapp/WEB-INF/app/models/snapshot.rb
sonar-server/src/main/webapp/WEB-INF/db/migrate/048_create_async_measure_snapshots_table.rb
sonar-server/src/main/webapp/WEB-INF/db/migrate/151_create_dashboards.rb
sonar-server/src/main/webapp/WEB-INF/db/migrate/211_create_manual_measures.rb [new file with mode: 0644]
sonar-server/src/main/webapp/WEB-INF/db/migrate/212_move_async_measures.rb [new file with mode: 0644]
sonar-server/src/main/webapp/WEB-INF/db/migrate/213_drop_async_measures_table.rb [new file with mode: 0644]
sonar-testing-harness/src/main/resources/org/sonar/test/persistence/sonar-test.ddl

index 76c1bdf43dcb44a124de0059758a253819f801ec..5b4358eb5cbf005a1473458eb4c9fc4f3580494b 100644 (file)
@@ -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 (file)
index 3a23449..0000000
+++ /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 (file)
index 5bb3525..0000000
+++ /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 (file)
index d53de7b..0000000
+++ /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 %>
index 532848bb4f29b9f1a9a79393b4f4210a7b55c745..c54b8d6d126b669571e13cb7b7256e6c364203bb 100644 (file)
@@ -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 (file)
index 5f09d28..0000000
+++ /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 (file)
index e985ee3..0000000
+++ /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
index fad86b13ce380840d6918e90f5394457aaad4396..462f8752a810200c3154f6e6280d07b3eec361f1 100644 (file)
@@ -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;
-  }
-
 }
index 83e0774bcd73fe944efd12d44c42263ab1877540..0a9a08813a0b9f951b267d8aaba58aa34ea4f33e 100644 (file)
@@ -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";
 
index 276b3f21cd93181259804612e42b19203d695296..a4a8d36b3e4db520e4fbef5b753bd282f71afaa6 100644 (file)
@@ -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 (file)
index ea86260..0000000
+++ /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 (file)
index 7b936b5..0000000
+++ /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");
-  }
-
-}
index 834657bb7f9fa5e00817e54961fe2c5374ac65a4..d8f23f16b505399a2d13ec3d417fc8f3b76f3398 100644 (file)
@@ -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 (file)
index c748a03..0000000
+++ /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 (file)
index 1905e69..0000000
+++ /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 (file)
index a31a3a3..0000000
+++ /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 (file)
index a9371f8..0000000
+++ /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 (file)
index cf0a5f9..0000000
+++ /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 (file)
index f83aff2..0000000
+++ /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 (file)
index c449c6e..0000000
+++ /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 (file)
index baba9aa..0000000
+++ /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 (file)
index ff8b246..0000000
+++ /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 (file)
index 096f198..0000000
+++ /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 (file)
index a268b95..0000000
+++ /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 (file)
index 115b532..0000000
+++ /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 (file)
index 7a12ccd..0000000
+++ /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 (file)
index 4c2bea9..0000000
+++ /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 (file)
index f10b82f..0000000
+++ /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 (file)
index bca00e3..0000000
+++ /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 (file)
index 7d20af5..0000000
+++ /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 (file)
index 74d8837..0000000
+++ /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 (file)
index d881a39..0000000
+++ /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 (file)
index 13c290c..0000000
+++ /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 (file)
index 99475df..0000000
+++ /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 (file)
index 7ea8aa5..0000000
+++ /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 (file)
index d2b62cb..0000000
+++ /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 (file)
index 9d34321..0000000
+++ /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 (file)
index f8df127..0000000
+++ /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 (file)
index 036b218..0000000
+++ /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 (file)
index 36a166b..0000000
+++ /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 (file)
index 5478f7f..0000000
+++ /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 (file)
index 977d036..0000000
+++ /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 (file)
index c73190e..0000000
+++ /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 (file)
index 04ea0cd..0000000
+++ /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 (file)
index 1916d0b..0000000
+++ /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 (file)
index bbfd484..0000000
+++ /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 (file)
index d0a260f..0000000
+++ /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 (file)
index ed2be1c..0000000
+++ /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 (file)
index 17b2795..0000000
+++ /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 (file)
index d1a6b09..0000000
+++ /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 (file)
index 2abee56..0000000
+++ /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();
-  }
-}
index 3f3ee2f382c945b48b6fdb0585a0ba53af6319f6..6afe5f7d44982c4d17a97815389192c050762284 100644 (file)
@@ -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);
index 7e1e99c67ccc2d6a2e6bdea019e2aab1608e6521..8c60ad0fab786e5fef62f533720239c2bc4ded46 100644 (file)
@@ -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();
   }
index f70f303af8bb47c337d70f4bd73e22059b109242..8a68161aaeb8dd1357353c9d3b9a06dbae24802a 100644 (file)
@@ -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
index 75077f60ff9b0bc96136fefae2f6bc6dfe5002b7..435943a7b6186414858ae04a80a4b8156b335941 100644 (file)
@@ -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
index 24b1d8aa46ead14a42fd8125170b35f3d6323cd4..00be00357996bd6d4afb003dc3919c1bd045d19e 100644 (file)
@@ -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])
index d2841e7b3d921345aacf5d0b4407bdc51d14f95b..47d0d223998cda020a970c4f2e622af92affe110 100644 (file)
@@ -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/async_measure_snapshot.rb b/sonar-server/src/main/webapp/WEB-INF/app/models/async_measure_snapshot.rb
deleted file mode 100644 (file)
index 2f37204..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-#
-# 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
-#
-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])
-
-    result=[]
-    async_measures.each do |am|
-      clone=am.async_measure.clone
-      clone.snapshot_id=am.snapshot_id
-      result<<clone
-    end
-    result
-  end
-
-  def measure
-    async_measure
-  end
-end
\ No newline at end of file
index b1bf557b18d0e9664591f48087785066ed27ab9e..e4462407d9b32b5c84084b5374009bddc77f0dc4 100644 (file)
@@ -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
index 82dad3b41fa157ec0d7633fce947e288f2cdd49a..7ce80b37ea3f213bb96c7f5390458829f10f8550 100644 (file)
         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]||={}
index 54675821f798c9a840a438cc0c095faf71190f6d..1921ddfe8c3f4ca8ded0de500847536ff71236e3 100644 (file)
@@ -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
index 9a0d2b5eaa394a2d59287bedbd5b547d035e6208..5a6fd0ea838e5fb65c6ce1569c498eca1f4ddef3 100644 (file)
@@ -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
index 269022642c2b95fae434852779282702a38d80c1..2f56659b79b59408e4ee35dd11eb80b7a330e0a3 100644 (file)
@@ -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'
index a30b36ad7f2f4cc763f34ee51cc71e40ba9f78d1..140b7c9021391be66438e9486ff7fd24b5c980de 100644 (file)
@@ -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/db/migrate/211_create_manual_measures.rb b/sonar-server/src/main/webapp/WEB-INF/db/migrate/211_create_manual_measures.rb
new file mode 100644 (file)
index 0000000..72e065f
--- /dev/null
@@ -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 CreateManualMeasures < ActiveRecord::Migration
+
+  def self.up
+    # TODO
+  end
+
+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 (file)
index 0000000..bdd7fd6
--- /dev/null
@@ -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 (file)
index 0000000..7346d95
--- /dev/null
@@ -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
index a2c2ad8d445958dd0bfbdb3faee182310ef0f415..c9feaaa71f98fc1edb9fbac917113ce8c44ee6af 100644 (file)
@@ -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,