summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJulien HENRY <julien.henry@sonarsource.com>2016-05-09 15:18:18 +0200
committerJulien HENRY <julien.henry@sonarsource.com>2016-05-09 15:18:18 +0200
commitf11c338671f6a14f5a2c8033d6bb2126385a0744 (patch)
treea4831ab956a664be091c68b65899481566decc11
parentbe05a6f41935e760178dc86b79410c300f33f45f (diff)
downloadsonar-scanner-cli-f11c338671f6a14f5a2c8033d6bb2126385a0744.tar.gz
sonar-scanner-cli-f11c338671f6a14f5a2c8033d6bb2126385a0744.zip
SQSCANNER-18 Logs with level WARN are displayed with prefix "INFO: "
-rw-r--r--src/main/java/org/sonarsource/scanner/cli/ScannerFactory.java4
-rw-r--r--src/test/java/org/sonarsource/scanner/cli/ScannerFactoryTest.java19
2 files changed, 10 insertions, 13 deletions
diff --git a/src/main/java/org/sonarsource/scanner/cli/ScannerFactory.java b/src/main/java/org/sonarsource/scanner/cli/ScannerFactory.java
index c8144d7..135914e 100644
--- a/src/main/java/org/sonarsource/scanner/cli/ScannerFactory.java
+++ b/src/main/java/org/sonarsource/scanner/cli/ScannerFactory.java
@@ -46,8 +46,10 @@ class ScannerFactory {
case ERROR:
logger.error(formattedMessage);
break;
- case INFO:
case WARN:
+ logger.warn(formattedMessage);
+ break;
+ case INFO:
default:
logger.info(formattedMessage);
}
diff --git a/src/test/java/org/sonarsource/scanner/cli/ScannerFactoryTest.java b/src/test/java/org/sonarsource/scanner/cli/ScannerFactoryTest.java
index 2e60e81..d440427 100644
--- a/src/test/java/org/sonarsource/scanner/cli/ScannerFactoryTest.java
+++ b/src/test/java/org/sonarsource/scanner/cli/ScannerFactoryTest.java
@@ -19,23 +19,18 @@
*/
package org.sonarsource.scanner.cli;
+import java.util.Properties;
+import org.junit.Before;
+import org.junit.Test;
import org.sonarsource.scanner.api.EmbeddedScanner;
import org.sonarsource.scanner.api.LogOutput;
import org.sonarsource.scanner.api.LogOutput.Level;
-import org.sonarsource.scanner.cli.Logs;
-import org.sonarsource.scanner.cli.ScannerFactory;
-import org.junit.Before;
-
-import java.util.Properties;
-
-import static org.mockito.Mockito.verifyNoMoreInteractions;
+import static org.fest.assertions.Assertions.assertThat;
+import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.reset;
import static org.mockito.Mockito.verify;
-import static org.mockito.Mockito.mock;
-import org.junit.Test;
-
-import static org.fest.assertions.Assertions.assertThat;
+import static org.mockito.Mockito.verifyNoMoreInteractions;
public class ScannerFactoryTest {
@@ -78,7 +73,7 @@ public class ScannerFactoryTest {
reset(logs);
logOutput.log(msg, Level.WARN);
- verify(logs).info(msg);
+ verify(logs).warn(msg);
verifyNoMoreInteractions(logs);
reset(logs);