From b37e0615accadebdb29166ddb1e383ea54cca16f Mon Sep 17 00:00:00 2001 From: Duarte Meneses Date: Fri, 16 Sep 2016 16:08:38 +0200 Subject: SQSCANNER-23 Support the new 'MessageException' unchecked exception and log by default the error stack trace only when a non-MessageException is thrown --- src/test/java/org/sonarsource/scanner/cli/LogsTest.java | 8 +------- src/test/java/org/sonarsource/scanner/cli/MainTest.java | 1 - 2 files changed, 1 insertion(+), 8 deletions(-) (limited to 'src/test/java/org/sonarsource') diff --git a/src/test/java/org/sonarsource/scanner/cli/LogsTest.java b/src/test/java/org/sonarsource/scanner/cli/LogsTest.java index bda9d28..d688982 100644 --- a/src/test/java/org/sonarsource/scanner/cli/LogsTest.java +++ b/src/test/java/org/sonarsource/scanner/cli/LogsTest.java @@ -70,18 +70,12 @@ public class LogsTest { @Test public void testError() { Exception e = new NullPointerException("exception"); - logs.setDisplayStackTrace(false); logs.error("error1"); verify(stdErr).println("ERROR: error1"); logs.error("error2", e); verify(stdErr).println("ERROR: error2"); - - verifyNoMoreInteractions(stdOut, stdErr); - - logs.setDisplayStackTrace(true); - logs.error("error3", e); - verify(stdErr).println("ERROR: error3"); + verify(stdErr).println(e); // other interactions to print the exception.. } diff --git a/src/test/java/org/sonarsource/scanner/cli/MainTest.java b/src/test/java/org/sonarsource/scanner/cli/MainTest.java index 7efc17a..3484aef 100644 --- a/src/test/java/org/sonarsource/scanner/cli/MainTest.java +++ b/src/test/java/org/sonarsource/scanner/cli/MainTest.java @@ -220,7 +220,6 @@ public class MainTest { // Logger used for callback should have debug enabled verify(logs).setDebugEnabled(true); - verify(logs).setDisplayStackTrace(true); ArgumentCaptor propertiesCapture = ArgumentCaptor.forClass(Properties.class); verify(runner).runAnalysis(propertiesCapture.capture()); -- cgit v1.2.3