File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
cf-java-logging-support-log4j2/src/test/java/com/sap/hcp/cf/logging/common Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -20,16 +20,21 @@ public abstract class AbstractTest {
20
20
21
21
protected final ByteArrayOutputStream outContent = new ByteArrayOutputStream ();
22
22
protected final ByteArrayOutputStream errContent = new ByteArrayOutputStream ();
23
+ private PrintStream stdout ;
24
+ private PrintStream stderr ;
25
+
23
26
@ Before
24
27
public void setupStreams () {
28
+ stdout = System .out ;
29
+ stderr = System .err ;
25
30
System .setOut (new PrintStream (outContent ));
26
31
System .setErr (new PrintStream (errContent ));
27
32
}
28
33
29
34
@ After
30
35
public void teardownStreams () {
31
- System .setOut (null );
32
- System .setErr (null );
36
+ System .setOut (stdout );
37
+ System .setErr (stderr );
33
38
}
34
39
protected String getMessage () {
35
40
return getField ("msg" );
You can’t perform that action at this time.
0 commit comments