aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDuarte Meneses <duarte.meneses@sonarsource.com>2015-06-09 10:47:55 +0200
committerDuarte Meneses <duarte.meneses@sonarsource.com>2015-06-09 10:47:55 +0200
commit7c9561f15be509eec4ea9b798a4f7b787bef95a3 (patch)
tree73702743f3b2e9a3136767313e04c6888451161b
parente2eacb0d4ff09b3db6a6a42e20b59054320ed536 (diff)
downloadsonarqube-7c9561f15be509eec4ea9b798a4f7b787bef95a3.tar.gz
sonarqube-7c9561f15be509eec4ea9b798a4f7b787bef95a3.zip
SONAR-6577 offline mode in preview mode
-rw-r--r--sonar-batch/src/main/java/org/sonar/batch/bootstrap/PersistentCacheProvider.java4
-rw-r--r--sonar-batch/src/test/java/org/sonar/batch/bootstrap/PersistentCacheProviderTest.java10
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();
}
}