]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-2754 change default value of sonar.dbcleaner.cleanDirectory
authorSimon Brandhof <simon.brandhof@gmail.com>
Tue, 7 Feb 2012 18:12:13 +0000 (19:12 +0100)
committerSimon Brandhof <simon.brandhof@gmail.com>
Tue, 7 Feb 2012 18:12:13 +0000 (19:12 +0100)
plugins/sonar-dbcleaner-plugin/src/main/java/org/sonar/plugins/dbcleaner/DefaultPurgeTask.java
plugins/sonar-dbcleaner-plugin/src/test/java/org/sonar/plugins/dbcleaner/DefaultPurgeTaskTest.java

index 0027fcc3bf4fd1c9bb711209c1a031f0215cab56..08a3c64ddec1e737dd5375b43568bec20c4c783a 100644 (file)
@@ -37,7 +37,7 @@ import org.sonar.plugins.dbcleaner.period.DefaultPeriodCleaner;
 @Properties({
   @Property(
     key = DbCleanerConstants.PROPERTY_CLEAN_DIRECTORY,
-    defaultValue = "false",
+    defaultValue = "true",
     name = "Clean history data of directories/packages")
 })
 public class DefaultPurgeTask implements PurgeTask {
index f40c61b5fb23fce017a532334a5febb60392f62e..51dee76ba54395cc02e76dbe5f2700fdb33028ba 100644 (file)
@@ -34,9 +34,10 @@ import static org.mockito.Mockito.*;
 
 public class DefaultPurgeTaskTest {
   @Test
-  public void shouldNotDeleteHistoricalDataOfDirectoriesByDefault() {
+  public void shouldNotDeleteHistoricalDataOfDirectories() {
     PurgeDao purgeDao = mock(PurgeDao.class);
     Settings settings = new Settings(new PropertyDefinitions(DefaultPurgeTask.class));
+    settings.setProperty(DbCleanerConstants.PROPERTY_CLEAN_DIRECTORY, "false");
     DefaultPurgeTask task = new DefaultPurgeTask(purgeDao, settings, mock(DefaultPeriodCleaner.class));
 
     task.purgeProject(1L);
@@ -45,10 +46,9 @@ public class DefaultPurgeTaskTest {
   }
 
   @Test
-  public void shouldDeleteHistoricalDataOfDirectories() {
+  public void shouldDeleteHistoricalDataOfDirectoriesByDefault() {
     PurgeDao purgeDao = mock(PurgeDao.class);
     Settings settings = new Settings(new PropertyDefinitions(DefaultPurgeTask.class));
-    settings.setProperty(DbCleanerConstants.PROPERTY_CLEAN_DIRECTORY, "true");
     DefaultPurgeTask task = new DefaultPurgeTask(purgeDao, settings, mock(DefaultPeriodCleaner.class));
 
     task.purgeProject(1L);