Snapshot snapshot = new Snapshot(project1, true, "", new Date(1));
getSession().save(snapshot);
getSession().save(CoreMetrics.CLASSES);
getSession().commit();
Metric metric = new MeasuresDao(getSession()).getMetric(CoreMetrics.CLASSES_KEY);
for (int i = 0; i < NB_INSERTS; i++) {
MeasureModel pm = new MeasureModel(metric.getId(), 1.0).setSnapshotId(snapshot.getId());
getSession().save(pm);
}