aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-process
diff options
context:
space:
mode:
authorSimon Brandhof <simon.brandhof@sonarsource.com>2015-07-07 13:37:49 +0200
committerSimon Brandhof <simon.brandhof@sonarsource.com>2015-07-07 13:38:03 +0200
commitc92a8b41dab2dbb3a98e35225639634e97488615 (patch)
treeafdd9cbf2450508f5d934979222843dfff3e793c /server/sonar-process
parent59afc6c59adc54f04c12e330cb8457b1462e5b39 (diff)
downloadsonarqube-c92a8b41dab2dbb3a98e35225639634e97488615.tar.gz
sonarqube-c92a8b41dab2dbb3a98e35225639634e97488615.zip
Attempt to remove false-positive on LogbackHelperTest
Diffstat (limited to 'server/sonar-process')
-rw-r--r--server/sonar-process/src/test/java/org/sonar/process/LogbackHelperTest.java12
1 files changed, 12 insertions, 0 deletions
diff --git a/server/sonar-process/src/test/java/org/sonar/process/LogbackHelperTest.java b/server/sonar-process/src/test/java/org/sonar/process/LogbackHelperTest.java
index 1e2a9756224..dc3f8fd0112 100644
--- a/server/sonar-process/src/test/java/org/sonar/process/LogbackHelperTest.java
+++ b/server/sonar-process/src/test/java/org/sonar/process/LogbackHelperTest.java
@@ -39,12 +39,24 @@ import org.junit.rules.TemporaryFolder;
import java.io.File;
import java.util.Properties;
+import org.slf4j.LoggerFactory;
import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.Assert.fail;
public class LogbackHelperTest {
+ static {
+ // Attempt to prevent test false-positives :
+ // java.lang.ClassCastException: org.slf4j.helpers.SubstituteLogger cannot be cast to ch.qos.logback.classic.Logger
+ // at org.sonar.process.LogbackHelper.getRootContext(LogbackHelper.java:51)
+ // at org.sonar.process.LogbackHelperTest.createRollingPolicy_none(LogbackHelperTest.java:119)
+ //
+ // It occurs when the initialization step is still not finished. Substitute loggers are used.
+ // http://www.slf4j.org/codes.html#substituteLogger
+ LoggerFactory.getLogger(LogbackHelperTest.class);
+ }
+
Props props = new Props(new Properties());
LogbackHelper sut = new LogbackHelper();