1 package org.apache.maven.surefire.report;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25 public class DefaultConsoleOutputReceiver
26 implements ConsoleOutputReceiver
27 {
28 private final ConsoleOutputReceiver defaultConsoleOutputReceiver;
29
30 private final boolean dumpToConsole;
31
32 public DefaultConsoleOutputReceiver( ConsoleOutputReceiver defaultConsoleOutputReceiver, boolean dumpToConsole )
33 {
34 this.defaultConsoleOutputReceiver = defaultConsoleOutputReceiver;
35 this.dumpToConsole = dumpToConsole;
36 }
37
38 public void writeTestOutput( byte[] buf, int off, int len, boolean stdout )
39 {
40 final ConsoleOutputReceiver consoleOutputReceiver = ConsoleOutputReceiverForCurrentThread.get();
41 if ( consoleOutputReceiver != null )
42 {
43 consoleOutputReceiver.writeTestOutput( buf, off, len, stdout );
44 }
45
46 if ( dumpToConsole )
47 {
48 defaultConsoleOutputReceiver.writeTestOutput( buf, off, len, stdout );
49 }
50 }
51 }