@Test public void testConsoleLoggerTraceEnablement() { final PrintStream oldOutStream = System.out; ByteArrayOutputStream systemOutStream = new ByteArrayOutputStream(); System.setOut(new PrintStream(systemOutStream)); final String logMessage = "FooMessage4"; loggingClass.logTrace(logMessage); Assert.assertEquals(0, systemOutStream.size()); JUnitLoggerProvider.getConsoleLoggerEnablement().setTraceEnabled(true); loggingClass.logTrace(logMessage); Assert.assertTrue(systemOutStream.toString().contains(logMessage)); systemOutStream = new ByteArrayOutputStream(); System.setOut(new PrintStream(systemOutStream)); JUnitLoggerProvider.getConsoleLoggerEnablement().setTraceEnabled(false); loggingClass.logTrace(logMessage); Assert.assertEquals(0, systemOutStream.size()); System.setOut(oldOutStream); }
public static LoggerEnablement getConsoleLoggerEnablement() { return getInstance().consoleLoggerEnablement.getLoggerEnablementForThread(); }
JUnitLoggerProvider implements ILoggerProvider { public static LoggerEnablement getConsoleLoggerEnablement() { return getInstance().consoleLoggerEnablement.getLoggerEnablementForThread(); } }
JUnitLoggerProvider implements ILoggerProvider { public static LoggerEnablement getConsoleLoggerEnablement() { return getInstance().consoleLoggerEnablement.getLoggerEnablementForThread(); } private  JUnitLoggerProvider(); }
JUnitLoggerProvider implements ILoggerProvider { public static LoggerEnablement getConsoleLoggerEnablement() { return getInstance().consoleLoggerEnablement.getLoggerEnablementForThread(); } private  JUnitLoggerProvider(); @Override JUnitLoggerComposite get(final String name, final String wrapperFQCN); static void reset(); static JUnitLogger getGlobalLogger(); @SuppressWarnings("unchecked") static JUnitLogger getLogger(final String name, final String wrapperFQCN); static JUnitLogger getLogger(final Class<?> clazz); static LoggerEnablement getConsoleLoggerEnablement(); static JUnitLoggerComposite getLoggerComposite(final String name, final String wrapperFQCN); }
JUnitLoggerProvider implements ILoggerProvider { public static LoggerEnablement getConsoleLoggerEnablement() { return getInstance().consoleLoggerEnablement.getLoggerEnablementForThread(); } private  JUnitLoggerProvider(); @Override JUnitLoggerComposite get(final String name, final String wrapperFQCN); static void reset(); static JUnitLogger getGlobalLogger(); @SuppressWarnings("unchecked") static JUnitLogger getLogger(final String name, final String wrapperFQCN); static JUnitLogger getLogger(final Class<?> clazz); static LoggerEnablement getConsoleLoggerEnablement(); static JUnitLoggerComposite getLoggerComposite(final String name, final String wrapperFQCN);  }