The following unit test will pass repeatedly in both your IDE (ex: run
until failure) or in stressNewTest:
public class SystemOutRuleTest {
@Rule
public SystemOutRule systemOutRule = new SystemOutRule().enableLog();
@Test
public void passesRepeatedly() {
System.out.println("hello");
Log4J and Logback both capture a reference to System.out and/or System.err
and then use that reference thereafter. This means that any manipulation of
System.out or System.err -- using System.setOut(PrintStream) or
System.setErr(PrintStream) -- probably isn't going to play nicely with
logging in ge