From 6f567b6f58819b8bbc6aeeddf780c4931f06315d Mon Sep 17 00:00:00 2001 From: Simon Brandhof Date: Tue, 7 Feb 2012 19:12:13 +0100 Subject: [PATCH] SONAR-2754 change default value of sonar.dbcleaner.cleanDirectory --- .../java/org/sonar/plugins/dbcleaner/DefaultPurgeTask.java | 2 +- .../org/sonar/plugins/dbcleaner/DefaultPurgeTaskTest.java | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/plugins/sonar-dbcleaner-plugin/src/main/java/org/sonar/plugins/dbcleaner/DefaultPurgeTask.java b/plugins/sonar-dbcleaner-plugin/src/main/java/org/sonar/plugins/dbcleaner/DefaultPurgeTask.java index 0027fcc3bf4..08a3c64ddec 100644 --- a/plugins/sonar-dbcleaner-plugin/src/main/java/org/sonar/plugins/dbcleaner/DefaultPurgeTask.java +++ b/plugins/sonar-dbcleaner-plugin/src/main/java/org/sonar/plugins/dbcleaner/DefaultPurgeTask.java @@ -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 { diff --git a/plugins/sonar-dbcleaner-plugin/src/test/java/org/sonar/plugins/dbcleaner/DefaultPurgeTaskTest.java b/plugins/sonar-dbcleaner-plugin/src/test/java/org/sonar/plugins/dbcleaner/DefaultPurgeTaskTest.java index f40c61b5fb2..51dee76ba54 100644 --- a/plugins/sonar-dbcleaner-plugin/src/test/java/org/sonar/plugins/dbcleaner/DefaultPurgeTaskTest.java +++ b/plugins/sonar-dbcleaner-plugin/src/test/java/org/sonar/plugins/dbcleaner/DefaultPurgeTaskTest.java @@ -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); -- 2.39.5