]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-7175 Fix IT
authorJulien Lancelot <julien.lancelot@sonarsource.com>
Mon, 23 May 2016 11:36:18 +0000 (13:36 +0200)
committerJulien Lancelot <julien.lancelot@sonarsource.com>
Mon, 23 May 2016 12:44:20 +0000 (14:44 +0200)
it/it-tests/src/test/java/it/dbCleaner/PurgeTest.java

index d2040c301ae847b8acc689eb48df3b600e62196f..0278e76396c98bb31d6e3f96388ee7e2fc8e75a7 100644 (file)
@@ -176,29 +176,29 @@ public class PurgeTest {
     // Keep all snapshots from last 4 weeks
     setServerProperty(orchestrator, "sonar.dbcleaner.weeksBeforeKeepingOnlyOneSnapshotByWeek", "4");
 
+    // Execute an analysis 11 days ago
+    String elevenDaysAgo = formatDate(addDays(new Date(), -11));
+    runProjectAnalysis(orchestrator, PROJECT_SAMPLE_PATH, "sonar.projectDate", elevenDaysAgo);
+
     // Execute an analysis 10 days ago
     String tenDaysAgo = formatDate(addDays(new Date(), -10));
     runProjectAnalysis(orchestrator, PROJECT_SAMPLE_PATH, "sonar.projectDate", tenDaysAgo);
 
-    // Execute an analysis 8 days ago
-    String eightDaysAgo = formatDate(addDays(new Date(), -8));
-    runProjectAnalysis(orchestrator, PROJECT_SAMPLE_PATH, "sonar.projectDate", eightDaysAgo);
-
     // Now only keep 1 snapshot per week
     setServerProperty(orchestrator, "sonar.dbcleaner.weeksBeforeKeepingOnlyOneSnapshotByWeek", "0");
 
     // Execute an analysis today to execute the purge of previous weeks snapshots
     runProjectAnalysis(orchestrator, PROJECT_SAMPLE_PATH);
 
-    // Check that only analysis from 8 days ago is kept (as it's the last one from previous week)
+    // Check that only analysis from 10 days ago is kept (as it's the last one from previous week)
     WsResponse response = newAdminWsClient(orchestrator).wsConnector().call(
       new GetRequest("/api/timemachine/index")
         .setParam("resource", PROJECT_KEY)
         .setParam("metrics", "ncloc"))
       .failIfNotSuccessful();
     String content = response.content();
-    assertThat(content).contains(eightDaysAgo);
-    assertThat(content).doesNotContain(tenDaysAgo);
+    assertThat(content).contains(tenDaysAgo);
+    assertThat(content).doesNotContain(elevenDaysAgo);
   }
 
   /**