]> source.dussan.org Git - sonarqube.git/blob
d0524a9bd0b0fee062f1eed6996e304118a55512
[sonarqube.git] /
1 /*
2  * SonarQube
3  * Copyright (C) 2009-2016 SonarSource SA
4  * mailto:contact AT sonarsource DOT com
5  *
6  * This program is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 3 of the License, or (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public License
17  * along with this program; if not, write to the Free Software Foundation,
18  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
19  */
20 package org.sonar.server.computation.task.projectanalysis.step;
21
22 import com.tngtech.java.junit.dataprovider.DataProvider;
23 import com.tngtech.java.junit.dataprovider.DataProviderRunner;
24 import com.tngtech.java.junit.dataprovider.UseDataProvider;
25 import java.text.SimpleDateFormat;
26 import java.util.List;
27 import org.junit.Before;
28 import org.junit.Rule;
29 import org.junit.Test;
30 import org.junit.runner.RunWith;
31 import org.sonar.api.config.Settings;
32 import org.sonar.api.utils.System2;
33 import org.sonar.api.utils.log.LogTester;
34 import org.sonar.db.DbClient;
35 import org.sonar.db.DbTester;
36 import org.sonar.server.computation.task.projectanalysis.analysis.AnalysisMetadataHolderRule;
37 import org.sonar.server.computation.task.projectanalysis.component.TreeRootHolderRule;
38 import org.sonar.server.computation.task.projectanalysis.component.Component;
39 import org.sonar.server.computation.task.projectanalysis.component.ReportComponent;
40 import org.sonar.server.computation.task.projectanalysis.component.SettingsRepository;
41 import org.sonar.server.computation.task.projectanalysis.component.ViewsComponent;
42 import org.sonar.server.computation.task.projectanalysis.period.Period;
43 import org.sonar.server.computation.task.projectanalysis.period.PeriodsHolderImpl;
44 import org.sonar.server.computation.task.step.ComputationStep;
45
46 import static org.assertj.core.api.Assertions.assertThat;
47 import static org.mockito.Mockito.mock;
48 import static org.mockito.Mockito.when;
49 import static org.sonar.core.config.CorePropertyDefinitions.TIMEMACHINE_MODE_DATE;
50 import static org.sonar.core.config.CorePropertyDefinitions.TIMEMACHINE_MODE_DAYS;
51 import static org.sonar.core.config.CorePropertyDefinitions.TIMEMACHINE_MODE_PREVIOUS_ANALYSIS;
52 import static org.sonar.core.config.CorePropertyDefinitions.TIMEMACHINE_MODE_PREVIOUS_VERSION;
53 import static org.sonar.core.config.CorePropertyDefinitions.TIMEMACHINE_MODE_VERSION;
54
55
56 @RunWith(DataProviderRunner.class)
57 public class LoadPeriodsStepTest extends BaseStepTest {
58
59   private static final SimpleDateFormat DATE_FORMAT = new SimpleDateFormat("yyyy-MM-dd");
60   private static final String ROOT_KEY = "ROOT_KEY";
61   private static final ReportComponent PROJECT_ROOT = ReportComponent.builder(Component.Type.PROJECT, 1).setUuid("ABCD").setKey(ROOT_KEY).setVersion("1.1").build();
62   private static final ViewsComponent VIEW_ROOT = ViewsComponent.builder(Component.Type.VIEW, ROOT_KEY).setUuid("ABCD").build();
63
64   @Rule
65   public DbTester dbTester = DbTester.create(System2.INSTANCE);
66   @Rule
67   public TreeRootHolderRule treeRootHolder = new TreeRootHolderRule();
68   @Rule
69   public AnalysisMetadataHolderRule analysisMetadataHolder = new AnalysisMetadataHolderRule();
70   @Rule
71   public LogTester logTester = new LogTester();
72
73   PeriodsHolderImpl periodsHolder = new PeriodsHolderImpl();
74   DbClient dbClient = dbTester.getDbClient();
75   Settings settings = new Settings();
76   SettingsRepository settingsRepository = mock(SettingsRepository.class);
77
78   LoadPeriodsStep underTest;
79
80   @Override
81   protected ComputationStep step() {
82     return underTest;
83   }
84
85   @Before
86   public void setUp() throws Exception {
87     analysisMetadataHolder.setAnalysisDate(DATE_FORMAT.parse("2008-11-30").getTime());
88
89     underTest = new LoadPeriodsStep(dbClient, settingsRepository, treeRootHolder, analysisMetadataHolder, periodsHolder);
90   }
91
92   private void setupRoot(Component root) {
93     treeRootHolder.setRoot(root);
94     when(settingsRepository.getSettings(root)).thenReturn(settings);
95   }
96
97   @DataProvider
98   public static Object[][] projectAndViewRoots() {
99     return new Object[][] {
100       {PROJECT_ROOT},
101       {VIEW_ROOT}
102     };
103   }
104
105   @Test
106   @UseDataProvider("projectAndViewRoots")
107   public void no_period_on_first_analysis(Component root) {
108     setupRoot(root);
109
110     // No project, no snapshot
111
112     underTest.execute();
113     assertThat(periodsHolder.getPeriods()).isEmpty();
114   }
115
116   @Test
117   @UseDataProvider("projectAndViewRoots")
118   public void feed_one_period(Component root) {
119     setupRoot(root);
120
121     dbTester.prepareDbUnit(getClass(), "shared.xml");
122
123     String textDate = "2008-11-22";
124     settings.setProperty("sonar.timemachine.period1", textDate);
125
126     underTest.execute();
127     List<Period> periods = periodsHolder.getPeriods();
128     assertThat(periods).hasSize(1);
129
130     Period period = periods.get(0);
131     assertThat(period.getMode()).isEqualTo(TIMEMACHINE_MODE_DATE);
132     assertThat(period.getModeParameter()).isEqualTo(textDate);
133     assertThat(period.getSnapshotDate()).isEqualTo(1227358680000L);
134     assertThat(period.getAnalysisUuid()).isEqualTo("u1003");
135   }
136
137   @Test
138   @UseDataProvider("projectAndViewRoots")
139   public void no_period_when_settings_match_no_analysis(Component root) {
140     setupRoot(root);
141
142     dbTester.prepareDbUnit(getClass(), "shared.xml");
143
144     settings.setProperty("sonar.timemachine.period1", "UNKNWOWN VERSION");
145
146     underTest.execute();
147     assertThat(periodsHolder.getPeriods()).isEmpty();
148   }
149
150   @Test
151   @UseDataProvider("projectAndViewRoots")
152   public void no_period_when_settings_is_empty(Component root) {
153     setupRoot(root);
154
155     dbTester.prepareDbUnit(getClass(), "shared.xml");
156
157     settings.setProperty("sonar.timemachine.period1", "");
158
159     underTest.execute();
160     assertThat(periodsHolder.getPeriods()).isEmpty();
161   }
162
163   @Test
164   @UseDataProvider("projectAndViewRoots")
165   public void ignore_unprocessed_snapshots(Component root) {
166     setupRoot(root);
167
168     dbTester.prepareDbUnit(getClass(), "unprocessed_snapshots.xml");
169
170     settings.setProperty("sonar.timemachine.period1", "100");
171
172     underTest.execute();
173     assertThat(periodsHolder.getPeriods()).isEmpty();
174   }
175
176   @Test
177   @UseDataProvider("projectAndViewRoots")
178   public void feed_period_by_date(Component root) {
179     setupRoot(root);
180
181     dbTester.prepareDbUnit(getClass(), "shared.xml");
182
183     String textDate = "2008-11-22";
184     settings.setProperty("sonar.timemachine.period1", textDate);
185
186     underTest.execute();
187     List<Period> periods = periodsHolder.getPeriods();
188     assertThat(periods).hasSize(1);
189
190     Period period = periods.get(0);
191     // Return analysis from given date 2008-11-22
192     assertThat(period.getMode()).isEqualTo(TIMEMACHINE_MODE_DATE);
193     assertThat(period.getModeParameter()).isEqualTo(textDate);
194     assertThat(period.getSnapshotDate()).isEqualTo(1227358680000L);
195     assertThat(period.getAnalysisUuid()).isEqualTo("u1003");
196
197     assertThat(logTester.logs()).hasSize(1);
198     assertThat(logTester.logs().get(0)).startsWith("Compare to date 2008-11-22 (analysis of ");
199   }
200
201   @Test
202   @UseDataProvider("projectAndViewRoots")
203   public void search_by_date_return_nearest_later_analysis(Component root) {
204     setupRoot(root);
205
206     dbTester.prepareDbUnit(getClass(), "shared.xml");
207     String date = "2008-11-24";
208
209     settings.setProperty("sonar.timemachine.period1", date);
210
211     underTest.execute();
212     List<Period> periods = periodsHolder.getPeriods();
213     assertThat(periods).hasSize(1);
214
215     // Analysis form 2008-11-29
216     Period period = periods.get(0);
217     assertThat(period.getMode()).isEqualTo(TIMEMACHINE_MODE_DATE);
218     assertThat(period.getModeParameter()).isEqualTo(date);
219     assertThat(period.getSnapshotDate()).isEqualTo(1227934800000L);
220     assertThat(period.getAnalysisUuid()).isEqualTo("u1004");
221   }
222
223   @Test
224   @UseDataProvider("projectAndViewRoots")
225   public void no_period_by_date(Component root) {
226     setupRoot(root);
227
228     dbTester.prepareDbUnit(getClass(), "shared.xml");
229
230     // No analysis at and after this date
231     settings.setProperty("sonar.timemachine.period1", "2008-11-30");
232
233     underTest.execute();
234     assertThat(periodsHolder.getPeriods()).isEmpty();
235   }
236
237   @Test
238   @UseDataProvider("projectAndViewRoots")
239   public void feed_period_by_days(Component root) {
240     setupRoot(root);
241
242     dbTester.prepareDbUnit(getClass(), "shared.xml");
243
244     settings.setProperty("sonar.timemachine.period1", "10");
245
246     underTest.execute();
247     List<Period> periods = periodsHolder.getPeriods();
248     assertThat(periods).hasSize(1);
249
250     // return analysis from 2008-11-20
251     Period period = periods.get(0);
252     assertThat(period.getMode()).isEqualTo(TIMEMACHINE_MODE_DAYS);
253     assertThat(period.getModeParameter()).isEqualTo("10");
254     assertThat(period.getSnapshotDate()).isEqualTo(1227157200000L);
255     assertThat(period.getAnalysisUuid()).isEqualTo("u1002");
256
257     assertThat(logTester.logs()).hasSize(1);
258     assertThat(logTester.logs().get(0)).startsWith("Compare over 10 days (2008-11-20, analysis of ");
259   }
260
261   @Test
262   @UseDataProvider("projectAndViewRoots")
263   public void no_period_by_days(Component root) {
264     setupRoot(root);
265
266     dbTester.prepareDbUnit(getClass(), "empty.xml");
267
268     settings.setProperty("sonar.timemachine.period1", "0");
269
270     underTest.execute();
271     assertThat(periodsHolder.getPeriods()).isEmpty();
272   }
273
274   @Test
275   @UseDataProvider("projectAndViewRoots")
276   public void feed_period_by_previous_analysis(Component root) {
277     setupRoot(root);
278
279     dbTester.prepareDbUnit(getClass(), "shared.xml");
280
281     settings.setProperty("sonar.timemachine.period1", "previous_analysis");
282
283     underTest.execute();
284     List<Period> periods = periodsHolder.getPeriods();
285     assertThat(periods).hasSize(1);
286
287     // return analysis from 2008-11-29
288     Period period = periods.get(0);
289     assertThat(period.getMode()).isEqualTo(TIMEMACHINE_MODE_PREVIOUS_ANALYSIS);
290     assertThat(period.getModeParameter()).isNotNull();
291     assertThat(period.getSnapshotDate()).isEqualTo(1227934800000L);
292     assertThat(period.getAnalysisUuid()).isEqualTo("u1004");
293
294     assertThat(logTester.logs()).hasSize(1);
295     assertThat(logTester.logs().get(0)).startsWith("Compare to previous analysis (");
296   }
297
298   @Test
299   @UseDataProvider("projectAndViewRoots")
300   public void no_period_by_previous_analysis(Component root) {
301     setupRoot(root);
302
303     dbTester.prepareDbUnit(getClass(), "empty.xml");
304
305     settings.setProperty("sonar.timemachine.period1", "previous_analysis");
306
307     underTest.execute();
308     assertThat(periodsHolder.getPeriods()).isEmpty();
309   }
310
311   @Test
312   public void feed_period_by_previous_version() {
313     setupRoot(PROJECT_ROOT);
314
315     dbTester.prepareDbUnit(getClass(), "shared.xml");
316
317     settings.setProperty("sonar.timemachine.period1", "previous_version");
318
319     underTest.execute();
320     List<Period> periods = periodsHolder.getPeriods();
321     assertThat(periods).hasSize(1);
322
323     // Analysis form 2008-11-12
324     Period period = periods.get(0);
325     assertThat(period.getMode()).isEqualTo(TIMEMACHINE_MODE_PREVIOUS_VERSION);
326     assertThat(period.getModeParameter()).isEqualTo("1.0");
327     assertThat(period.getSnapshotDate()).isEqualTo(1226494680000L);
328     assertThat(period.getAnalysisUuid()).isEqualTo("u1001");
329
330     assertThat(logTester.logs()).hasSize(1);
331     assertThat(logTester.logs().get(0)).startsWith("Compare to previous version (");
332   }
333
334   @Test
335   public void feed_period_by_previous_version_is_not_supported_for_views() {
336     setupRoot(VIEW_ROOT);
337
338     dbTester.prepareDbUnit(getClass(), "shared.xml");
339
340     settings.setProperty("sonar.timemachine.period1", "previous_version");
341
342     underTest.execute();
343     List<Period> periods = periodsHolder.getPeriods();
344     assertThat(periods).hasSize(0);
345   }
346
347   @Test
348   public void feed_period_by_previous_version_with_previous_version_deleted() {
349     setupRoot(PROJECT_ROOT);
350
351     dbTester.prepareDbUnit(getClass(), "previous_version_deleted.xml");
352
353     settings.setProperty("sonar.timemachine.period1", "previous_version");
354
355     underTest.execute();
356     List<Period> periods = periodsHolder.getPeriods();
357     assertThat(periods).hasSize(1);
358
359     // Analysis form 2008-11-11
360     Period period = periods.get(0);
361     assertThat(period.getMode()).isEqualTo(TIMEMACHINE_MODE_PREVIOUS_VERSION);
362     assertThat(period.getModeParameter()).isEqualTo("0.9");
363     assertThat(period.getSnapshotDate()).isEqualTo(1226379600000L);
364     assertThat(period.getAnalysisUuid()).isEqualTo("u1000");
365   }
366
367   @Test
368   @UseDataProvider("projectAndViewRoots")
369   public void no_period_by_previous_version(Component root) {
370     setupRoot(root);
371
372     dbTester.prepareDbUnit(getClass(), "empty.xml");
373
374     settings.setProperty("sonar.timemachine.period1", "previous_version");
375
376     underTest.execute();
377     assertThat(periodsHolder.getPeriods()).isEmpty();
378   }
379
380   @Test
381   public void feed_period_by_previous_version_with_first_analysis_when_no_previous_version_found() {
382     setupRoot(PROJECT_ROOT);
383
384     dbTester.prepareDbUnit(getClass(), "no_previous_version.xml");
385
386     settings.setProperty("sonar.timemachine.period1", "previous_version");
387
388     underTest.execute();
389     List<Period> periods = periodsHolder.getPeriods();
390     assertThat(periods).hasSize(1);
391
392     Period period = periods.get(0);
393     assertThat(period.getMode()).isEqualTo(TIMEMACHINE_MODE_PREVIOUS_VERSION);
394     assertThat(period.getModeParameter()).isNull();
395     assertThat(period.getSnapshotDate()).isEqualTo(1226379600000L);
396     assertThat(period.getAnalysisUuid()).isEqualTo("u1000");
397   }
398
399   @Test
400   public void feed_period_by_previous_version_with_first_analysis_when_previous_snapshot_is_the_last_one() {
401     setupRoot(PROJECT_ROOT);
402
403     dbTester.prepareDbUnit(getClass(), "previous_version_is_last_one.xml");
404
405     settings.setProperty("sonar.timemachine.period1", "previous_version");
406
407     underTest.execute();
408     List<Period> periods = periodsHolder.getPeriods();
409     assertThat(periods).hasSize(1);
410
411     Period period = periods.get(0);
412     assertThat(period.getMode()).isEqualTo(TIMEMACHINE_MODE_PREVIOUS_VERSION);
413     assertThat(period.getModeParameter()).isNull();
414     assertThat(period.getSnapshotDate()).isEqualTo(1226379600000L);
415     assertThat(period.getAnalysisUuid()).isEqualTo("u1000");
416   }
417
418   @Test
419   public void no_period_by_previous_version_when_no_event_version_for_views() {
420     setupRoot(VIEW_ROOT);
421
422     dbTester.prepareDbUnit(getClass(), "no_previous_version.xml");
423
424     settings.setProperty("sonar.timemachine.period1", "previous_version");
425
426     underTest.execute();
427     assertThat(periodsHolder.getPeriods()).isEmpty();
428   }
429
430   @Test
431   @UseDataProvider("projectAndViewRoots")
432   public void feed_period_by_version(Component root) {
433     setupRoot(root);
434
435     dbTester.prepareDbUnit(getClass(), "shared.xml");
436
437     settings.setProperty("sonar.timemachine.period1", "0.9");
438
439     underTest.execute();
440     List<Period> periods = periodsHolder.getPeriods();
441     assertThat(periods).hasSize(1);
442
443     // Analysis form 2008-11-11
444     Period period = periods.get(0);
445     assertThat(period.getMode()).isEqualTo(TIMEMACHINE_MODE_VERSION);
446     assertThat(period.getModeParameter()).isEqualTo("0.9");
447     assertThat(period.getSnapshotDate()).isEqualTo(1226379600000L);
448     assertThat(period.getAnalysisUuid()).isEqualTo("u1000");
449
450     assertThat(logTester.logs()).hasSize(1);
451     assertThat(logTester.logs().get(0)).startsWith("Compare to version (0.9) (");
452   }
453
454   @Test
455   @UseDataProvider("projectAndViewRoots")
456   public void no_period_by_version(Component root) {
457     setupRoot(root);
458
459     dbTester.prepareDbUnit(getClass(), "empty.xml");
460
461     settings.setProperty("sonar.timemachine.period1", "0.8");
462
463     underTest.execute();
464     assertThat(periodsHolder.getPeriods()).isEmpty();
465   }
466
467   @Test
468   public void all_five_types_of_periods_are_supported_for_PROJECT_component_tree() {
469     setupRoot(PROJECT_ROOT);
470
471     dbTester.prepareDbUnit(getClass(), "shared.xml");
472
473     settings.setProperty("sonar.timemachine.period1", "2008-11-22"); // Analysis from 2008-11-22 should be returned
474     settings.setProperty("sonar.timemachine.period2", "10"); // Analysis from 2008-11-20 should be returned
475     settings.setProperty("sonar.timemachine.period3", "previous_analysis"); // Analysis from 2008-11-29 should be returned
476     settings.setProperty("sonar.timemachine.period4", "previous_version"); // Analysis from 2008-11-12 should be returned
477     settings.setProperty("sonar.timemachine.period5", "0.9"); // Analysis from 2008-11-11
478
479     underTest.execute();
480     List<Period> periods = periodsHolder.getPeriods();
481
482     assertThat(periods).extracting("mode").containsExactly(TIMEMACHINE_MODE_DATE, TIMEMACHINE_MODE_DAYS,
483       TIMEMACHINE_MODE_PREVIOUS_ANALYSIS, TIMEMACHINE_MODE_PREVIOUS_VERSION,
484       TIMEMACHINE_MODE_VERSION);
485
486     assertThat(periods.get(0).getMode()).isEqualTo(TIMEMACHINE_MODE_DATE);
487     assertThat(periods.get(0).getIndex()).isEqualTo(1);
488     assertThat(periods.get(0).getSnapshotDate()).isEqualTo(1227358680000L);
489
490     assertThat(periods.get(1).getMode()).isEqualTo(TIMEMACHINE_MODE_DAYS);
491     assertThat(periods.get(1).getIndex()).isEqualTo(2);
492     assertThat(periods.get(1).getSnapshotDate()).isEqualTo(1227157200000L);
493
494     assertThat(periods.get(2).getMode()).isEqualTo(TIMEMACHINE_MODE_PREVIOUS_ANALYSIS);
495     assertThat(periods.get(2).getIndex()).isEqualTo(3);
496     assertThat(periods.get(2).getSnapshotDate()).isEqualTo(1227934800000L);
497
498     assertThat(periods.get(3).getMode()).isEqualTo(TIMEMACHINE_MODE_PREVIOUS_VERSION);
499     assertThat(periods.get(3).getIndex()).isEqualTo(4);
500     assertThat(periods.get(3).getSnapshotDate()).isEqualTo(1226494680000L);
501
502     assertThat(periods.get(4).getMode()).isEqualTo(TIMEMACHINE_MODE_VERSION);
503     assertThat(periods.get(4).getIndex()).isEqualTo(5);
504     assertThat(periods.get(4).getSnapshotDate()).isEqualTo(1226379600000L);
505   }
506
507   @Test
508   public void feed_four_different_periods() {
509     setupRoot(VIEW_ROOT);
510
511     dbTester.prepareDbUnit(getClass(), "shared.xml");
512
513     settings.setProperty("sonar.timemachine.period1", "2008-11-22"); // Analysis from 2008-11-22 should be returned
514     settings.setProperty("sonar.timemachine.period2", "10"); // Analysis from 2008-11-20 should be returned
515     settings.setProperty("sonar.timemachine.period3", "previous_analysis"); // Analysis from 2008-11-29 should be returned
516     settings.setProperty("sonar.timemachine.period4", "previous_version"); // Analysis from 2008-11-12 should be returned
517     settings.setProperty("sonar.timemachine.period5", "0.9"); // Analysis from 2008-11-11
518
519     underTest.execute();
520     List<Period> periods = periodsHolder.getPeriods();
521
522     assertThat(periods).extracting("mode").containsExactly(
523       TIMEMACHINE_MODE_DATE, TIMEMACHINE_MODE_DAYS,
524       TIMEMACHINE_MODE_PREVIOUS_ANALYSIS, TIMEMACHINE_MODE_VERSION);
525
526     assertThat(periods.get(0).getMode()).isEqualTo(TIMEMACHINE_MODE_DATE);
527     assertThat(periods.get(0).getIndex()).isEqualTo(1);
528     assertThat(periods.get(0).getSnapshotDate()).isEqualTo(1227358680000L);
529
530     assertThat(periods.get(1).getMode()).isEqualTo(TIMEMACHINE_MODE_DAYS);
531     assertThat(periods.get(1).getIndex()).isEqualTo(2);
532     assertThat(periods.get(1).getSnapshotDate()).isEqualTo(1227157200000L);
533
534     assertThat(periods.get(2).getMode()).isEqualTo(TIMEMACHINE_MODE_PREVIOUS_ANALYSIS);
535     assertThat(periods.get(2).getIndex()).isEqualTo(3);
536     assertThat(periods.get(2).getSnapshotDate()).isEqualTo(1227934800000L);
537
538     assertThat(periods.get(3).getMode()).isEqualTo(TIMEMACHINE_MODE_VERSION);
539     assertThat(periods.get(3).getIndex()).isEqualTo(5);
540     assertThat(periods.get(3).getSnapshotDate()).isEqualTo(1226379600000L);
541   }
542
543   @Test
544   public void can_use_project_qualifier_in_settings() {
545     setupRoot(PROJECT_ROOT);
546
547     dbTester.prepareDbUnit(getClass(), "shared.xml");
548
549     settings.setProperty("sonar.timemachine.period4.TRK", "2008-11-22");
550     settings.setProperty("sonar.timemachine.period5.TRK", "previous_analysis");
551
552     underTest.execute();
553     assertThat(periodsHolder.getPeriods()).hasSize(2);
554   }
555
556   @Test
557   public void can_use_views_qualifier_in_settings() {
558     setupRoot(VIEW_ROOT);
559
560     dbTester.prepareDbUnit(getClass(), "shared.xml");
561
562     settings.setProperty("sonar.timemachine.period4.VW", "2008-11-22");
563     settings.setProperty("sonar.timemachine.period5.VW", "previous_analysis");
564
565     underTest.execute();
566     assertThat(periodsHolder.getPeriods()).hasSize(2);
567   }
568
569 }