]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-3437 Prepare for refactoring to MyBatis
authorDavid Gageot <david@gageot.net>
Mon, 9 Jul 2012 08:16:32 +0000 (10:16 +0200)
committerDavid Gageot <david@gageot.net>
Mon, 9 Jul 2012 10:45:31 +0000 (12:45 +0200)
sonar-batch/src/main/java/org/sonar/batch/index/MeasurePersister.java
sonar-batch/src/test/java/org/sonar/batch/index/MeasurePersisterTest.java
sonar-batch/src/test/resources/org/sonar/batch/index/MeasurePersisterTest/shared.xml
sonar-batch/src/test/resources/org/sonar/batch/index/MeasurePersisterTest/shouldDelaySaving-result.xml
sonar-batch/src/test/resources/org/sonar/batch/index/MeasurePersisterTest/shouldInsertMeasure-result.xml
sonar-batch/src/test/resources/org/sonar/batch/index/MeasurePersisterTest/shouldNotDelaySavingWithDatabaseOnlyMeasure-result.xml
sonar-batch/src/test/resources/org/sonar/batch/index/MeasurePersisterTest/shouldUpdateMeasure-result.xml

index ddc1df16b7ed62488d211f76b83cad7389bf1007..3b967d89e38267381f47969695b9441ae0b6fddf 100644 (file)
@@ -19,6 +19,7 @@
  */
 package org.sonar.batch.index;
 
+import com.google.common.annotations.VisibleForTesting;
 import com.google.common.collect.LinkedHashMultimap;
 import com.google.common.collect.SetMultimap;
 import org.apache.commons.lang.math.NumberUtils;
@@ -39,14 +40,12 @@ import java.util.Collection;
 import java.util.Map;
 
 public final class MeasurePersister {
-
+  private final DatabaseSession session;
+  private final ResourcePersister resourcePersister;
+  private final RuleFinder ruleFinder;
+  private final MemoryOptimizer memoryOptimizer;
+  private final SetMultimap<Resource, Measure> unsavedMeasuresByResource = LinkedHashMultimap.create();
   private boolean delayedMode = false;
-  private SetMultimap<Resource, Measure> unsavedMeasuresByResource = LinkedHashMultimap.create();
-  private DatabaseSession session;
-  private ResourcePersister resourcePersister;
-  private RuleFinder ruleFinder;
-  private MemoryOptimizer memoryOptimizer;
-
 
   public MeasurePersister(DatabaseSession session, ResourcePersister resourcePersister, RuleFinder ruleFinder, MemoryOptimizer memoryOptimizer) {
     this.session = session;
@@ -60,29 +59,23 @@ public final class MeasurePersister {
   }
 
   public void saveMeasure(Resource resource, Measure measure) {
-    boolean saveLater = (measure.getPersistenceMode().useMemory() && delayedMode);
-    if (saveLater) {
+    if (shouldSaveLater(measure)) {
       unsavedMeasuresByResource.put(resource, measure);
+      return;
+    }
 
-    } else {
+    if (measure.getId() != null) { // update
+      MeasureModel model = session.reattach(MeasureModel.class, measure.getId());
+      model = mergeModel(measure, model);
+
+      model.save(session);
+      memoryOptimizer.evictDataMeasure(measure, model);
+    } else if (shouldPersistMeasure(resource, measure)) { // insert
       Snapshot snapshot = resourcePersister.getSnapshotOrFail(resource);
-      MeasureModel model = null;
-      if (measure.getId() != null) {
-        // update
-        model = session.reattach(MeasureModel.class, measure.getId());
-        model = mergeModel(measure, model);
-        model.save(session);
-
-      } else if (shouldPersistMeasure(resource, measure)) {
-        // insert
-        model = createModel(measure);
-        model.setSnapshotId(snapshot.getId());
-        model.save(session);
-        measure.setId(model.getId()); // could be removed
-      }
-      if (model != null) {
-        memoryOptimizer.evictDataMeasure(measure, model);
-      }
+      MeasureModel model = createModel(measure).setSnapshotId(snapshot.getId());
+
+      model.save(session);
+      memoryOptimizer.evictDataMeasure(measure, model);
     }
   }
 
@@ -90,39 +83,44 @@ public final class MeasurePersister {
     return memoryOptimizer.reloadMeasure(measure);
   }
 
+  private boolean shouldSaveLater(Measure measure) {
+    return delayedMode && measure.getPersistenceMode().useMemory();
+  }
+
+  @VisibleForTesting
   static boolean shouldPersistMeasure(Resource resource, Measure measure) {
-    Metric metric = measure.getMetric();
     return measure.getPersistenceMode().useDatabase() &&
-        !(ResourceUtils.isEntity(resource) && isBestValueMeasure(measure, metric));
+      !(ResourceUtils.isEntity(resource) && isBestValueMeasure(measure, measure.getMetric()));
   }
 
+  @VisibleForTesting
   static boolean isBestValueMeasure(Measure measure, Metric metric) {
-    return measure.getId() == null &&
-        metric.isOptimizedBestValue() == Boolean.TRUE &&
-        metric.getBestValue() != null &&
-        (measure.getValue() == null || NumberUtils.compare(metric.getBestValue(), measure.getValue()) == 0) &&
-        measure.getAlertStatus() == null &&
-        measure.getDescription() == null &&
-        measure.getTendency() == null &&
-        measure.getUrl() == null &&
-        !measure.hasData() &&
-        (measure.getVariation1() == null || NumberUtils.compare(measure.getVariation1().doubleValue(), 0.0) == 0) &&
-        (measure.getVariation2() == null || NumberUtils.compare(measure.getVariation2().doubleValue(), 0.0) == 0) &&
-        (measure.getVariation3() == null || NumberUtils.compare(measure.getVariation3().doubleValue(), 0.0) == 0) &&
-        (measure.getVariation4() == null || NumberUtils.compare(measure.getVariation4().doubleValue(), 0.0) == 0) &&
-        (measure.getVariation5() == null || NumberUtils.compare(measure.getVariation5().doubleValue(), 0.0) == 0);
+    return measure.getId() == null
+      && metric.isOptimizedBestValue() == Boolean.TRUE
+      && metric.getBestValue() != null
+      && (measure.getValue() == null || NumberUtils.compare(metric.getBestValue(), measure.getValue()) == 0)
+      && measure.getAlertStatus() == null
+      && measure.getDescription() == null
+      && measure.getTendency() == null
+      && measure.getUrl() == null
+      && !measure.hasData()
+      && (measure.getVariation1() == null || NumberUtils.compare(measure.getVariation1().doubleValue(), 0.0) == 0)
+      && (measure.getVariation2() == null || NumberUtils.compare(measure.getVariation2().doubleValue(), 0.0) == 0)
+      && (measure.getVariation3() == null || NumberUtils.compare(measure.getVariation3().doubleValue(), 0.0) == 0)
+      && (measure.getVariation4() == null || NumberUtils.compare(measure.getVariation4().doubleValue(), 0.0) == 0)
+      && (measure.getVariation5() == null || NumberUtils.compare(measure.getVariation5().doubleValue(), 0.0) == 0);
   }
 
   public void dump() {
     LoggerFactory.getLogger(getClass()).debug("{} measures to dump", unsavedMeasuresByResource.size());
+
     Map<Resource, Collection<Measure>> map = unsavedMeasuresByResource.asMap();
     for (Map.Entry<Resource, Collection<Measure>> entry : map.entrySet()) {
       Resource resource = entry.getKey();
       Snapshot snapshot = resourcePersister.getSnapshot(entry.getKey());
       for (Measure measure : entry.getValue()) {
         if (shouldPersistMeasure(resource, measure)) {
-          MeasureModel model = createModel(measure);
-          model.setSnapshotId(snapshot.getId());
+          MeasureModel model = createModel(measure).setSnapshotId(snapshot.getId());
           model.save(session);
         }
       }
@@ -132,12 +130,12 @@ public final class MeasurePersister {
     unsavedMeasuresByResource.clear();
   }
 
-  MeasureModel createModel(Measure measure) {
+  private MeasureModel createModel(Measure measure) {
     return mergeModel(measure, new MeasureModel());
   }
 
-  MeasureModel mergeModel(Measure measure, MeasureModel merge) {
-    merge.setMetricId(measure.getMetric().getId());// we assume that the index has updated the metric
+  private MeasureModel mergeModel(Measure measure, MeasureModel merge) {
+    merge.setMetricId(measure.getMetric().getId()); // we assume that the index has updated the metric
     merge.setDescription(measure.getDescription());
     merge.setData(measure.getData());
     merge.setAlertStatus(measure.getAlertStatus());
@@ -161,11 +159,10 @@ public final class MeasurePersister {
       merge.setRulePriority(ruleMeasure.getSeverity());
       if (ruleMeasure.getRule() != null) {
         Rule ruleWithId = ruleFinder.findByKey(ruleMeasure.getRule().getRepositoryKey(), ruleMeasure.getRule().getKey());
-        if (ruleWithId != null) {
-          merge.setRuleId(ruleWithId.getId());
-        } else {
+        if (ruleWithId == null) {
           throw new SonarException("Can not save a measure with unknown rule " + ruleMeasure);
         }
+        merge.setRuleId(ruleWithId.getId());
       }
     }
     return merge;
index b37166c3d944c8a12076872fbf445c4bedaee43b..4d13104ba426c7eba6747042e9c446a70ff5e734 100644 (file)
@@ -30,16 +30,16 @@ import org.sonar.api.measures.PersistenceMode;
 import org.sonar.api.resources.JavaFile;
 import org.sonar.api.resources.JavaPackage;
 import org.sonar.api.resources.Project;
-import org.sonar.core.rule.DefaultRuleFinder;
 import org.sonar.jpa.test.AbstractDbUnitTestCase;
 
 import java.util.List;
 
-import static org.hamcrest.CoreMatchers.is;
-import static org.junit.Assert.assertThat;
-import static org.mockito.Matchers.anyObject;
+import static org.fest.assertions.Assertions.assertThat;
+import static org.mockito.Matchers.any;
 import static org.mockito.Matchers.eq;
-import static org.mockito.Mockito.*;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
 
 public class MeasurePersisterTest extends AbstractDbUnitTestCase {
 
@@ -48,38 +48,29 @@ public class MeasurePersisterTest extends AbstractDbUnitTestCase {
   public static final int FILE_SNAPSHOT_ID = 3003;
   public static final int COVERAGE_METRIC_ID = 2;
 
-  private ResourcePersister resourcePersister;
   private MeasurePersister measurePersister;
+  private ResourcePersister resourcePersister = mock(ResourcePersister.class);
+  private MemoryOptimizer memoryOptimizer = mock(MemoryOptimizer.class);
   private Project project = new Project("foo");
   private JavaPackage aPackage = new JavaPackage("org.foo");
   private JavaFile aFile = new JavaFile("org.foo.Bar");
-  private Snapshot projectSnapshot, packageSnapshot, fileSnapshot;
-  private Metric ncloc, coverage;
-  private MemoryOptimizer memoryOptimizer;
+  private Snapshot projectSnapshot = snapshot(PROJECT_SNAPSHOT_ID);
+  private Snapshot packageSnapshot = snapshot(PACKAGE_SNAPSHOT_ID);
 
   @Before
   public void mockResourcePersister() {
-    setupData("shared");
-    resourcePersister = mock(ResourcePersister.class);
-    projectSnapshot = getSession().getSingleResult(Snapshot.class, "id", PROJECT_SNAPSHOT_ID);
-    packageSnapshot = getSession().getSingleResult(Snapshot.class, "id", PACKAGE_SNAPSHOT_ID);
-    fileSnapshot = getSession().getSingleResult(Snapshot.class, "id", FILE_SNAPSHOT_ID);
-    ncloc = getSession().getSingleResult(Metric.class, "key", "ncloc");
-    coverage = getSession().getSingleResult(Metric.class, "key", "coverage");
-    when(resourcePersister.getSnapshotOrFail(eq(project))).thenReturn(projectSnapshot);
-    when(resourcePersister.getSnapshotOrFail(eq(aPackage))).thenReturn(packageSnapshot);
-    when(resourcePersister.getSnapshotOrFail(eq(aFile))).thenReturn(fileSnapshot);
+    when(resourcePersister.getSnapshotOrFail(project)).thenReturn(projectSnapshot);
     when(resourcePersister.getSnapshot(project)).thenReturn(projectSnapshot);
     when(resourcePersister.getSnapshot(aPackage)).thenReturn(packageSnapshot);
-    when(resourcePersister.getSnapshot(aFile)).thenReturn(fileSnapshot);
-    memoryOptimizer = mock(MemoryOptimizer.class);
-    measurePersister = new MeasurePersister(getSession(), resourcePersister, new DefaultRuleFinder(getSessionFactory()), memoryOptimizer);
+
+    measurePersister = new MeasurePersister(getSession(), resourcePersister, null, memoryOptimizer);
   }
 
   @Test
   public void shouldInsertMeasure() {
-    Measure measure = new Measure(ncloc).setValue(1234.0);
+    setupData("shared");
 
+    Measure measure = new Measure(ncloc()).setValue(1234.0);
     measurePersister.saveMeasure(project, measure);
 
     checkTables("shouldInsertMeasure", "project_measures");
@@ -87,19 +78,17 @@ public class MeasurePersisterTest extends AbstractDbUnitTestCase {
 
   @Test
   public void shouldRegisterPersistedMeasureToMemoryOptimizer() {
-    Measure measure = new Measure(ncloc).setValue(1234.0);
-
+    Measure measure = new Measure(ncloc()).setValue(1234.0);
     measurePersister.saveMeasure(project, measure);
 
-    verify(memoryOptimizer).evictDataMeasure(eq(measure), (MeasureModel)anyObject());
+    verify(memoryOptimizer).evictDataMeasure(eq(measure), any(MeasureModel.class));
   }
 
-
   @Test
   public void shouldUpdateMeasure() {
-    Measure measure = new Measure(coverage).setValue(12.5);
-    measure.setId(1L);
+    setupData("shared");
 
+    Measure measure = new Measure(coverage()).setValue(12.5).setId(1L);
     measurePersister.saveMeasure(project, measure);
 
     checkTables("shouldUpdateMeasure", "project_measures");
@@ -107,28 +96,28 @@ public class MeasurePersisterTest extends AbstractDbUnitTestCase {
 
   @Test
   public void shouldAddDelayedMeasureSeveralTimes() {
+    Measure measure = new Measure(ncloc()).setValue(200.0);
+
     measurePersister.setDelayedMode(true);
-    Measure measure = new Measure(ncloc).setValue(200.0);
     measurePersister.saveMeasure(project, measure);
 
     measure.setValue(300.0);
     measurePersister.saveMeasure(project, measure);
-
     measurePersister.dump();
 
     List<MeasureModel> coverageMeasures = getSession().getResults(MeasureModel.class, "snapshotId", PROJECT_SNAPSHOT_ID, "metricId", 1);
-    assertThat(coverageMeasures.size(), is(1));
-    assertThat(coverageMeasures.get(0).getValue(), is(300.0));
+    assertThat(coverageMeasures).onProperty("value").containsExactly(300.0);
   }
 
   @Test
   public void shouldDelaySaving() {
-    measurePersister.setDelayedMode(true);
+    setupData("shared");
 
-    measurePersister.saveMeasure(project, new Measure(ncloc).setValue(1234.0));
-    measurePersister.saveMeasure(aPackage, new Measure(ncloc).setValue(50.0));
+    measurePersister.setDelayedMode(true);
+    measurePersister.saveMeasure(project, new Measure(ncloc()).setValue(1234.0));
+    measurePersister.saveMeasure(aPackage, new Measure(ncloc()).setValue(50.0));
 
-    assertThat(getSession().getResults(MeasureModel.class, "metricId", 1).size(), is(0));
+    assertThat(getSession().getResults(MeasureModel.class, "metricId", 1)).isEmpty();
 
     measurePersister.dump();
     checkTables("shouldDelaySaving", "project_measures");
@@ -136,80 +125,92 @@ public class MeasurePersisterTest extends AbstractDbUnitTestCase {
 
   @Test
   public void shouldNotDelaySavingWithDatabaseOnlyMeasure() {
-    measurePersister.setDelayedMode(true);
-
-    measurePersister.saveMeasure(project, new Measure(ncloc).setValue(1234.0).setPersistenceMode(PersistenceMode.DATABASE)); // database only
-    measurePersister.saveMeasure(aPackage, new Measure(ncloc).setValue(50.0)); // database + memory
+    setupData("shared");
 
-    // no dump => the db-only measure is saved
+    measurePersister.setDelayedMode(true);
+    measurePersister.saveMeasure(project, new Measure(ncloc()).setValue(1234.0).setPersistenceMode(PersistenceMode.DATABASE)); // database
+    measurePersister.saveMeasure(aPackage, new Measure(ncloc()).setValue(50.0)); // database + memory
 
     checkTables("shouldNotDelaySavingWithDatabaseOnlyMeasure", "project_measures");
   }
 
   @Test
   public void shouldNotSaveBestValues() {
-    JavaFile file = new JavaFile("org.foo.MyClass");
-
-    Measure measure = new Measure(coverage).setValue(0.0);
-    assertThat(MeasurePersister.shouldPersistMeasure(file, measure), is(true));
+    Measure measure = new Measure(coverage()).setValue(0.0);
+    assertThat(MeasurePersister.shouldPersistMeasure(aFile, measure)).isTrue();
 
-    measure = new Measure(coverage).setValue(75.8);
-    assertThat(MeasurePersister.shouldPersistMeasure(file, measure), is(true));
+    measure = new Measure(coverage()).setValue(75.8);
+    assertThat(MeasurePersister.shouldPersistMeasure(aFile, measure)).isTrue();
 
-    measure = new Measure(coverage).setValue(100.0);
-    assertThat(MeasurePersister.shouldPersistMeasure(file, measure), is(false));
+    measure = new Measure(coverage()).setValue(100.0);
+    assertThat(MeasurePersister.shouldPersistMeasure(aFile, measure)).isFalse();
   }
 
   @Test
   public void shouldNotSaveBestValueMeasuresInDelayedMode() {
     measurePersister.setDelayedMode(true);
+    measurePersister.saveMeasure(aFile, new Measure(coverage()).setValue(100.0));
 
-    measurePersister.saveMeasure(aFile, new Measure(coverage).setValue(100.0));
-
-    assertThat(getSession().getResults(MeasureModel.class, "metricId", COVERAGE_METRIC_ID, "snapshotId", FILE_SNAPSHOT_ID).size(), is(0));
+    assertThat(getSession().getResults(MeasureModel.class, "metricId", COVERAGE_METRIC_ID, "snapshotId", FILE_SNAPSHOT_ID)).isEmpty();
 
     measurePersister.dump();
 
-    // not saved because it's a best value measure
-    assertThat(getSession().getResults(MeasureModel.class, "metricId", COVERAGE_METRIC_ID, "snapshotId", FILE_SNAPSHOT_ID).size(), is(0));
+    assertThat(getSession().getResults(MeasureModel.class, "metricId", COVERAGE_METRIC_ID, "snapshotId", FILE_SNAPSHOT_ID)).isEmpty();
   }
 
-
   @Test
   public void shouldNotSaveMemoryOnlyMeasures() {
     Measure measure = new Measure("ncloc").setPersistenceMode(PersistenceMode.MEMORY);
-    assertThat(MeasurePersister.shouldPersistMeasure(aPackage, measure), is(false));
+    assertThat(MeasurePersister.shouldPersistMeasure(aPackage, measure)).isFalse();
   }
 
   @Test
   public void shouldAlwaysPersistNonFileMeasures() {
-    assertThat(MeasurePersister.shouldPersistMeasure(project, new Measure(CoreMetrics.LINES, 200.0)), is(true));
-    assertThat(MeasurePersister.shouldPersistMeasure(aPackage, new Measure(CoreMetrics.LINES, 200.0)), is(true));
+    assertThat(MeasurePersister.shouldPersistMeasure(project, new Measure(CoreMetrics.LINES, 200.0))).isTrue();
+    assertThat(MeasurePersister.shouldPersistMeasure(aPackage, new Measure(CoreMetrics.LINES, 200.0))).isTrue();
   }
 
   @Test
   public void shouldNotPersistSomeFileMeasuresWithBestValue() {
-    JavaFile file = new JavaFile("org.foo.Bar");
+    assertThat(MeasurePersister.shouldPersistMeasure(aFile, new Measure(CoreMetrics.LINES, 200.0))).isTrue();
+    assertThat(MeasurePersister.shouldPersistMeasure(aFile, new Measure(CoreMetrics.DUPLICATED_LINES_DENSITY, 3.0))).isTrue();
 
-    // must persist:
-    assertThat(MeasurePersister.shouldPersistMeasure(file, new Measure(CoreMetrics.LINES, 200.0)), is(true));
-    assertThat(MeasurePersister.shouldPersistMeasure(file, new Measure(CoreMetrics.DUPLICATED_LINES_DENSITY, 3.0)), is(true));
-
-
-    // must not persist:
     Measure duplicatedLines = new Measure(CoreMetrics.DUPLICATED_LINES_DENSITY, 0.0);
-    assertThat(MeasurePersister.shouldPersistMeasure(file, duplicatedLines), is(false));
+    assertThat(MeasurePersister.shouldPersistMeasure(aFile, duplicatedLines)).isFalse();
 
     duplicatedLines.setVariation1(0.0);
-    assertThat(MeasurePersister.shouldPersistMeasure(file, duplicatedLines), is(false));
+    assertThat(MeasurePersister.shouldPersistMeasure(aFile, duplicatedLines)).isFalse();
 
     duplicatedLines.setVariation1(-3.0);
-    assertThat(MeasurePersister.shouldPersistMeasure(file, duplicatedLines), is(true));
+    assertThat(MeasurePersister.shouldPersistMeasure(aFile, duplicatedLines)).isTrue();
   }
 
   @Test
   public void nullValueAndNullVariationsShouldBeConsideredAsBestValue() {
     Measure measure = new Measure(CoreMetrics.NEW_VIOLATIONS_KEY);
-    assertThat(MeasurePersister.isBestValueMeasure(measure, CoreMetrics.NEW_VIOLATIONS), is(true));
+
+    assertThat(MeasurePersister.isBestValueMeasure(measure, CoreMetrics.NEW_VIOLATIONS)).isTrue();
+  }
+
+  private static Snapshot snapshot(int id) {
+    Snapshot snapshot = mock(Snapshot.class);
+    when(snapshot.getId()).thenReturn(id);
+    return snapshot;
+  }
+
+  private static Metric ncloc() {
+    Metric ncloc = mock(Metric.class);
+    when(ncloc.getId()).thenReturn(1);
+    when(ncloc.getKey()).thenReturn("ncloc");
+    return ncloc;
+  }
+
+  private static Metric coverage() {
+    Metric coverage = mock(Metric.class);
+    when(coverage.getId()).thenReturn(COVERAGE_METRIC_ID);
+    when(coverage.getKey()).thenReturn("coverage");
+    when(coverage.isOptimizedBestValue()).thenReturn(true);
+    when(coverage.getBestValue()).thenReturn(100.0);
+    return coverage;
   }
 }
index 2b8c2b91a705d00411e8eb575825a7a2c84668cc..f8900a3e2280904db134512ef27957686e6bdacd 100644 (file)
@@ -1,35 +1,5 @@
 <dataset>
 
-  <metrics delete_historical_data="[null]" id="1" name="ncloc" VAL_TYPE="INT" DESCRIPTION="[null]"  domain="[null]" short_name=""
-           enabled="true" worst_value="[null]" optimized_best_value="[null]" best_value="[null]" direction="0" hidden="false"/>
-  <metrics delete_historical_data="[null]" id="2" name="coverage" VAL_TYPE="INT" DESCRIPTION="[null]"  domain="[null]" short_name=""
-           enabled="true" worst_value="0" optimized_best_value="true" best_value="100" direction="1" hidden="false"/>
-
-  <projects id="1001" scope="PRJ" qualifier="TRK" kee="foo" root_id="[null]"
-            name="project name" long_name="project name" description="project description"
-            enabled="true" language="java" copy_resource_id="[null]" person_id="[null]" profile_id="[null]"/>
-
-  <projects id="1002" scope="DIR" qualifier="PAC" kee="foo:org.foo" root_id="1001"
-            name="org.foo" long_name="org.foo" description="[null]"
-            enabled="true" language="java" copy_resource_id="[null]" person_id="[null]" profile_id="[null]"/>
-
-  <projects id="1003" scope="FIL" qualifier="CLA" kee="foo:org.foo.Bar" root_id="1001"
-            name="Bar" long_name="org.foo.Bar" description="[null]"
-            enabled="true" language="java" copy_resource_id="[null]" person_id="[null]" profile_id="[null]"/>
-
-  <snapshots purge_status="[null]" period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" id="3001" project_id="1001" parent_snapshot_id="[null]" root_project_id="1001" root_snapshot_id="[null]"
-             scope="PRJ" qualifier="TRK" created_at="2010-12-23 00:00:00.00" build_date="2010-12-23 00:00:00.00" version="[null]" path=""
-             status="U" islast="false" depth="0" />
-
-  <snapshots purge_status="[null]" period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" id="3002" project_id="1002" parent_snapshot_id="3001" root_project_id="1001" root_snapshot_id="3001"
-             scope="DIR" qualifier="PAC" created_at="2010-12-23 00:00:00.00" build_date="2010-12-23 00:00:00.00" version="[null]" path="3001."
-             status="U" islast="false" depth="1" />
-
-  <snapshots purge_status="[null]" period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" id="3003" project_id="1003" parent_snapshot_id="3002" root_project_id="1001" root_snapshot_id="3001"
-             scope="FIL" qualifier="CLA" created_at="2010-12-23 00:00:00.00" build_date="2010-12-23 00:00:00.00" version="[null]" path="3001.3002."
-             status="U" islast="false" depth="2" />
-
-
   <project_measures id="1" VALUE="60" METRIC_ID="2" SNAPSHOT_ID="3001" alert_text="[null]" RULES_CATEGORY_ID="[null]"
                     RULE_ID="[null]" text_value="[null]" tendency="[null]" measure_date="[null]" project_id="[null]"
                     alert_status="[null]" description="[null]" rule_priority="[null]" characteristic_id="[null]" url="[null]"
index b6f2c36971e55f066b3b9b82fde52ec3b26c7e74..f0ac513c87d966c06b2d14efa18933172745cca5 100644 (file)
@@ -1,35 +1,5 @@
 <dataset>
 
-  <metrics delete_historical_data="[null]" id="1" name="ncloc" VAL_TYPE="INT" DESCRIPTION="[null]" domain="[null]" short_name=""
-           enabled="true" worst_value="[null]" optimized_best_value="[null]" best_value="[null]" direction="0"
-           hidden="false"/>
-  <metrics delete_historical_data="[null]" id="2" name="coverage" VAL_TYPE="INT" DESCRIPTION="[null]" domain="[null]" short_name=""
-           enabled="true" worst_value="0" optimized_best_value="true" best_value="100" direction="1" hidden="false"/>
-
-  <projects id="1001" scope="PRJ" qualifier="TRK" kee="foo" root_id="[null]"
-            name="project name" long_name="project name" description="project description"
-            enabled="true" language="java" copy_resource_id="[null]" person_id="[null]" profile_id="[null]"/>
-
-  <projects id="1002" scope="DIR" qualifier="PAC" kee="foo:org.foo" root_id="1001"
-            name="org.foo" long_name="org.foo" description="[null]"
-            enabled="true" language="java" copy_resource_id="[null]" person_id="[null]" profile_id="[null]"/>
-
-  <projects id="1003" scope="FIL" qualifier="CLA" kee="foo:org.foo.Bar" root_id="1001"
-            name="Bar" long_name="org.foo.Bar" description="[null]"
-            enabled="true" language="java" copy_resource_id="[null]" person_id="[null]" profile_id="[null]"/>
-
-  <snapshots purge_status="[null]" period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" id="3001" project_id="1001" parent_snapshot_id="[null]" root_project_id="1001" root_snapshot_id="[null]"
-             scope="PRJ" qualifier="TRK" created_at="2010-12-23 00:00:00.00" build_date="2010-12-23 00:00:00.00" version="[null]" path=""
-             status="U" islast="false" depth="0" />
-
-  <snapshots purge_status="[null]" period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" id="3002" project_id="1002" parent_snapshot_id="3001" root_project_id="1001" root_snapshot_id="3001"
-             scope="DIR" qualifier="PAC" created_at="2010-12-23 00:00:00.00" build_date="2010-12-23 00:00:00.00" version="[null]" path="3001."
-             status="U" islast="false" depth="1" />
-
-  <snapshots purge_status="[null]" period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" id="3003" project_id="1003" parent_snapshot_id="3002" root_project_id="1001" root_snapshot_id="3001"
-             scope="FIL" qualifier="CLA" created_at="2010-12-23 00:00:00.00" build_date="2010-12-23 00:00:00.00" version="[null]" path="3001.3002."
-             status="U" islast="false" depth="2" />
-
   <project_measures id="1" VALUE="60" METRIC_ID="2" SNAPSHOT_ID="3001" alert_text="[null]" RULES_CATEGORY_ID="[null]"
                     RULE_ID="[null]" text_value="[null]" tendency="[null]" measure_date="[null]" project_id="[null]"
                     alert_status="[null]" description="[null]" rule_priority="[null]" characteristic_id="[null]" url="[null]"
@@ -49,5 +19,4 @@
                     person_id="[null]"
                     variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]"/>
 
-
 </dataset>
index 933b0fff827ccdbc73600e47d5cd5c4b2668b8f5..1cd6e6d10c4add9d8cb035fc548cb3ccc983b989 100644 (file)
@@ -1,35 +1,5 @@
 <dataset>
 
-  <metrics delete_historical_data="[null]" id="1" name="ncloc" VAL_TYPE="INT" DESCRIPTION="[null]"  domain="[null]" short_name=""
-           enabled="true" worst_value="[null]" optimized_best_value="[null]" best_value="[null]" direction="0" hidden="false"/>
-
-  <metrics delete_historical_data="[null]" id="2" name="coverage" VAL_TYPE="INT" DESCRIPTION="[null]"  domain="[null]" short_name=""
-           enabled="true" worst_value="0" optimized_best_value="true" best_value="100" direction="1" hidden="false"/>
-
-  <projects id="1001" scope="PRJ" qualifier="TRK" kee="foo" root_id="[null]"
-            name="project name" long_name="project name" description="project description"
-            enabled="true" language="java" copy_resource_id="[null]" person_id="[null]" profile_id="[null]"/>
-
-  <projects id="1002" scope="DIR" qualifier="PAC" kee="foo:org.foo" root_id="1001"
-            name="org.foo" long_name="org.foo" description="[null]"
-            enabled="true" language="java" copy_resource_id="[null]" person_id="[null]" profile_id="[null]"/>
-
-  <projects id="1003" scope="FIL" qualifier="CLA" kee="foo:org.foo.Bar" root_id="1001"
-            name="Bar" long_name="org.foo.Bar" description="[null]"
-            enabled="true" language="java" copy_resource_id="[null]" person_id="[null]" profile_id="[null]"/>
-
-  <snapshots purge_status="[null]" period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" id="3001" project_id="1001" parent_snapshot_id="[null]" root_project_id="1001" root_snapshot_id="[null]"
-             scope="PRJ" qualifier="TRK" created_at="2010-12-23 00:00:00.00" build_date="2010-12-23 00:00:00.00" version="[null]" path=""
-             status="U" islast="false" depth="0" />
-
-  <snapshots purge_status="[null]" period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" id="3002" project_id="1002" parent_snapshot_id="3001" root_project_id="1001" root_snapshot_id="3001"
-             scope="DIR" qualifier="PAC" created_at="2010-12-23 00:00:00.00" build_date="2010-12-23 00:00:00.00" version="[null]" path="3001."
-             status="U" islast="false" depth="1" />
-
-  <snapshots purge_status="[null]" period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" id="3003" project_id="1003" parent_snapshot_id="3002" root_project_id="1001" root_snapshot_id="3001"
-             scope="FIL" qualifier="CLA" created_at="2010-12-23 00:00:00.00" build_date="2010-12-23 00:00:00.00" version="[null]" path="3001.3002."
-             status="U" islast="false" depth="2" />
-
   <project_measures id="1" VALUE="60" METRIC_ID="2" SNAPSHOT_ID="3001" alert_text="[null]" RULES_CATEGORY_ID="[null]"
                     RULE_ID="[null]" text_value="[null]" tendency="[null]" measure_date="[null]" project_id="[null]"
                     alert_status="[null]" description="[null]" rule_priority="[null]" characteristic_id="[null]" url="[null]"
index edc7e905a03d3de05f23602fbbd8488ed670b464..1cd6e6d10c4add9d8cb035fc548cb3ccc983b989 100644 (file)
@@ -1,35 +1,5 @@
 <dataset>
 
-  <metrics delete_historical_data="[null]" id="1" name="ncloc" VAL_TYPE="INT" DESCRIPTION="[null]"  domain="[null]" short_name=""
-           enabled="true" worst_value="[null]" optimized_best_value="[null]" best_value="[null]" direction="0" hidden="false"/>
-
-  <metrics delete_historical_data="[null]" id="2" name="coverage" VAL_TYPE="INT" DESCRIPTION="[null]"  domain="[null]" short_name=""
-           enabled="true" worst_value="0" optimized_best_value="true" best_value="100" direction="1" hidden="false"/>
-
-  <projects id="1001" scope="PRJ" qualifier="TRK" kee="foo" root_id="[null]"
-            name="project name" long_name="project name" description="project description"
-            enabled="true" language="java" copy_resource_id="[null]" person_id="[null]" profile_id="[null]"/>
-
-  <projects id="1002" scope="DIR" qualifier="PAC" kee="foo:org.foo" root_id="1001"
-            name="org.foo" long_name="org.foo" description="[null]"
-            enabled="true" language="java" copy_resource_id="[null]" person_id="[null]" profile_id="[null]"/>
-
-  <projects id="1003" scope="FIL" qualifier="CLA" kee="foo:org.foo.Bar" root_id="1001"
-            name="Bar" long_name="org.foo.Bar" description="[null]"
-            enabled="true" language="java" copy_resource_id="[null]" person_id="[null]" profile_id="[null]"/>
-
-  <snapshots purge_status="[null]" period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" id="3001" project_id="1001" parent_snapshot_id="[null]" root_project_id="1001" root_snapshot_id="[null]"
-             scope="PRJ" qualifier="TRK" created_at="2010-12-23 00:00:00.00" build_date="2010-12-23 00:00:00.00" version="[null]" path=""
-             status="U" islast="false" depth="0" />
-
-  <snapshots purge_status="[null]" period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" id="3002" project_id="1002" parent_snapshot_id="3001" root_project_id="1001" root_snapshot_id="3001"
-             scope="DIR" qualifier="PAC" created_at="2010-12-23 00:00:00.00" build_date="2010-12-23 00:00:00.00" version="[null]" path="3001."
-             status="U" islast="false" depth="1" />
-
-  <snapshots purge_status="[null]" period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" id="3003" project_id="1003" parent_snapshot_id="3002" root_project_id="1001" root_snapshot_id="3001"
-             scope="FIL" qualifier="CLA" created_at="2010-12-23 00:00:00.00" build_date="2010-12-23 00:00:00.00" version="[null]" path="3001.3002."
-             status="U" islast="false" depth="2" />
-
   <project_measures id="1" VALUE="60" METRIC_ID="2" SNAPSHOT_ID="3001" alert_text="[null]" RULES_CATEGORY_ID="[null]"
                     RULE_ID="[null]" text_value="[null]" tendency="[null]" measure_date="[null]" project_id="[null]"
                     alert_status="[null]" description="[null]" rule_priority="[null]" characteristic_id="[null]" url="[null]"
                     person_id="[null]"
                     variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]"/>
 
-  <!-- delayed -->
-  <!--<project_measures id="3" VALUE="50.0" METRIC_ID="1" SNAPSHOT_ID="3002" alert_text="[null]" RULES_CATEGORY_ID="[null]"-->
-                    <!--RULE_ID="[null]" text_value="[null]" tendency="[null]" measure_date="[null]" project_id="[null]"-->
-                    <!--alert_status="[null]" description="[null]" rule_priority="[null]" characteristic_id="[null]" url="[null]"-->
-                    <!--person_id="[null]"-->
-                    <!--variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]"/>-->
-
-
 </dataset>
index 4758f1589730bf1e93bf12676c3827b7ed2bd319..f4742847f205a87429943a3af54b1cbcb6df0e91 100644 (file)
@@ -1,35 +1,5 @@
 <dataset>
 
-  <metrics delete_historical_data="[null]" id="1" name="ncloc" VAL_TYPE="INT" DESCRIPTION="[null]"  domain="[null]" short_name=""
-           enabled="true" worst_value="[null]" optimized_best_value="[null]" best_value="[null]" direction="0" hidden="false"/>
-
-  <metrics delete_historical_data="[null]" id="2" name="coverage" VAL_TYPE="INT" DESCRIPTION="[null]"  domain="[null]" short_name=""
-           enabled="true" worst_value="0" optimized_best_value="true" best_value="100" direction="1" hidden="false"/>
-
-  <projects id="1001" scope="PRJ" qualifier="TRK" kee="foo" root_id="[null]"
-            name="project name" long_name="project name" description="project description"
-            enabled="true" language="java" copy_resource_id="[null]" person_id="[null]" profile_id="[null]"/>
-
-  <projects id="1002" scope="DIR" qualifier="PAC" kee="foo:org.foo" root_id="1001"
-            name="org.foo" long_name="org.foo" description="[null]"
-            enabled="true" language="java" copy_resource_id="[null]" person_id="[null]" profile_id="[null]"/>
-
-  <projects id="1003" scope="FIL" qualifier="CLA" kee="foo:org.foo.Bar" root_id="1001"
-            name="Bar" long_name="org.foo.Bar" description="[null]"
-            enabled="true" language="java" copy_resource_id="[null]" person_id="[null]" profile_id="[null]"/>
-
-  <snapshots purge_status="[null]" period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" id="3001" project_id="1001" parent_snapshot_id="[null]" root_project_id="1001" root_snapshot_id="[null]"
-             scope="PRJ" qualifier="TRK" created_at="2010-12-23 00:00:00.00" build_date="2010-12-23 00:00:00.00" version="[null]" path=""
-             status="U" islast="false" depth="0" />
-
-  <snapshots purge_status="[null]" period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" id="3002" project_id="1002" parent_snapshot_id="3001" root_project_id="1001" root_snapshot_id="3001"
-             scope="DIR" qualifier="PAC" created_at="2010-12-23 00:00:00.00" build_date="2010-12-23 00:00:00.00" version="[null]" path="3001."
-             status="U" islast="false" depth="1" />
-
-  <snapshots purge_status="[null]" period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" id="3003" project_id="1003" parent_snapshot_id="3002" root_project_id="1001" root_snapshot_id="3001"
-             scope="FIL" qualifier="CLA" created_at="2010-12-23 00:00:00.00" build_date="2010-12-23 00:00:00.00" version="[null]" path="3001.3002."
-             status="U" islast="false" depth="2" />
-
   <project_measures id="1" VALUE="12.5" METRIC_ID="2" SNAPSHOT_ID="3001" alert_text="[null]" RULES_CATEGORY_ID="[null]"
                     RULE_ID="[null]" text_value="[null]" tendency="[null]" measure_date="[null]" project_id="[null]"
                     alert_status="[null]" description="[null]" rule_priority="[null]" characteristic_id="[null]" url="[null]"