diff options
author | Duarte Meneses <duarte.meneses@sonarsource.com> | 2015-06-09 10:47:55 +0200 |
---|---|---|
committer | Duarte Meneses <duarte.meneses@sonarsource.com> | 2015-06-09 10:47:55 +0200 |
commit | 7c9561f15be509eec4ea9b798a4f7b787bef95a3 (patch) | |
tree | 73702743f3b2e9a3136767313e04c6888451161b /sonar-batch | |
parent | e2eacb0d4ff09b3db6a6a42e20b59054320ed536 (diff) | |
download | sonarqube-7c9561f15be509eec4ea9b798a4f7b787bef95a3.tar.gz sonarqube-7c9561f15be509eec4ea9b798a4f7b787bef95a3.zip |
SONAR-6577 offline mode in preview mode
Diffstat (limited to 'sonar-batch')
-rw-r--r-- | sonar-batch/src/main/java/org/sonar/batch/bootstrap/PersistentCacheProvider.java | 4 | ||||
-rw-r--r-- | sonar-batch/src/test/java/org/sonar/batch/bootstrap/PersistentCacheProviderTest.java | 10 |
2 files changed, 7 insertions, 7 deletions
diff --git a/sonar-batch/src/main/java/org/sonar/batch/bootstrap/PersistentCacheProvider.java b/sonar-batch/src/main/java/org/sonar/batch/bootstrap/PersistentCacheProvider.java index 7ed124eafa0..9ca57407d6c 100644 --- a/sonar-batch/src/main/java/org/sonar/batch/bootstrap/PersistentCacheProvider.java +++ b/sonar-batch/src/main/java/org/sonar/batch/bootstrap/PersistentCacheProvider.java @@ -36,9 +36,9 @@ public class PersistentCacheProvider extends ProviderAdapter { PersistentCacheBuilder builder = new PersistentCacheBuilder(); builder.setLog(new Slf4jLog(PersistentCache.class)); - String forceUpdate = props.property("sonar.forceUpdate"); + String enableCache = props.property("sonar.enableHttpCache"); - if ("true".equals(forceUpdate)) { + if (!"true".equals(enableCache)) { builder.forceUpdate(true); } diff --git a/sonar-batch/src/test/java/org/sonar/batch/bootstrap/PersistentCacheProviderTest.java b/sonar-batch/src/test/java/org/sonar/batch/bootstrap/PersistentCacheProviderTest.java index fb07230e741..5b6db572df5 100644 --- a/sonar-batch/src/test/java/org/sonar/batch/bootstrap/PersistentCacheProviderTest.java +++ b/sonar-batch/src/test/java/org/sonar/batch/bootstrap/PersistentCacheProviderTest.java @@ -51,12 +51,12 @@ public class PersistentCacheProviderTest { } @Test - public void test_forceUpdate() { - // normally don't force update - assertThat(provider.provide(props).isForceUpdate()).isFalse(); + public void test_enableCache() { + // normally force update (cache disabled) + assertThat(provider.provide(props).isForceUpdate()).isTrue(); - when(props.property("sonar.forceUpdate")).thenReturn("true"); + when(props.property("sonar.enableHttpCache")).thenReturn("true"); provider = new PersistentCacheProvider(); - assertThat(provider.provide(props).isForceUpdate()).isTrue(); + assertThat(provider.provide(props).isForceUpdate()).isFalse(); } } |