diff options
author | Janos Gyerik <janos.gyerik@sonarsource.com> | 2016-12-13 17:39:00 +0100 |
---|---|---|
committer | Janos Gyerik <janos.gyerik@sonarsource.com> | 2016-12-13 17:39:00 +0100 |
commit | c83d8df9f2c43ed34295658b03e56b4a306bcd29 (patch) | |
tree | 007e6d1747020811e2180777b9a81ff0c80d8af2 /sonar-scanner-engine/src/test | |
parent | 548d182e257e940a9016123922c9fa6ce510d415 (diff) | |
download | sonarqube-c83d8df9f2c43ed34295658b03e56b4a306bcd29.tar.gz sonarqube-c83d8df9f2c43ed34295658b03e56b4a306bcd29.zip |
Make sure we always start with empty buffers before tests
Diffstat (limited to 'sonar-scanner-engine/src/test')
-rw-r--r-- | sonar-scanner-engine/src/test/java/org/sonar/scanner/mediumtest/log/LogListenerTest.java | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sonar-scanner-engine/src/test/java/org/sonar/scanner/mediumtest/log/LogListenerTest.java b/sonar-scanner-engine/src/test/java/org/sonar/scanner/mediumtest/log/LogListenerTest.java index 2719c3361bd..b695744dce0 100644 --- a/sonar-scanner-engine/src/test/java/org/sonar/scanner/mediumtest/log/LogListenerTest.java +++ b/sonar-scanner-engine/src/test/java/org/sonar/scanner/mediumtest/log/LogListenerTest.java @@ -55,8 +55,8 @@ public class LogListenerTest { private Pattern simpleTimePattern = Pattern.compile("\\d{2}:\\d{2}:\\d{2}"); private List<LogEvent> logOutput; private StringBuilder logOutputStr; - private ByteArrayOutputStream stdOutTarget = new ByteArrayOutputStream(); - private ByteArrayOutputStream stdErrTarget = new ByteArrayOutputStream(); + private ByteArrayOutputStream stdOutTarget; + private ByteArrayOutputStream stdErrTarget; private static PrintStream savedStdOut; private static PrintStream savedStdErr; @@ -88,6 +88,8 @@ public class LogListenerTest { @Before public void prepare() throws IOException { + stdOutTarget = new ByteArrayOutputStream(); + stdErrTarget = new ByteArrayOutputStream(); System.setOut(new PrintStream(stdOutTarget)); System.setErr(new PrintStream(stdErrTarget)); // logger from the batch might write to it asynchronously |