Class ConsoleCapture

java.lang.Object
org.oddjob.tools.ConsoleCapture

public class ConsoleCapture extends Object
Capturing Oddjob.CONSOLE: Because tests append to the console log to avoid capturing test logging then the Logger class must be Loaded before the Oddjob class is loaded. This is because Oddjob's static initialiser replaces the default stdout with its own console capture. If the Logger class loads first it will be appending to original stdout, not the new stdout.

This is most easily achieved by including a logger in the test.

Author:
rob
  • Constructor Details

    • ConsoleCapture

      public ConsoleCapture()
  • Method Details

    • captureConsole

      public ConsoleCapture.Close captureConsole()
    • capture

      public ConsoleCapture.Close capture(LogArchive archive)
    • getLines

      public String[] getLines()
    • getAsList

      public List<String> getAsList()
    • getAll

      public String getAll()
    • size

      public int size()
    • isLeaveLogging

      public boolean isLeaveLogging()
    • setLeaveLogging

      public void setLeaveLogging(boolean leaveLogging)
    • dump

      public void dump()
    • dump

      public void dump(org.slf4j.Logger logger)
    • getFilter

      public Predicate<String> getFilter()