Class LoggerReaderRule

  • All Implemented Interfaces:
    org.junit.rules.TestRule

    public class LoggerReaderRule
    extends Object
    implements org.junit.rules.TestRule
    This rule permits to get all the logs written during the execution of a test.

    It tries to take care of the server logging configuration about formatting. If the formatter can not be guessed, the SimpleFormatter is used by default.

    To get logs written during a test, just call getReader() method from the rule instance.

    Author:
    silveryocha
    • Constructor Detail

      • LoggerReaderRule

        public LoggerReaderRule()
      • LoggerReaderRule

        public LoggerReaderRule​(Level level)
    • Method Detail

      • apply

        public org.junit.runners.model.Statement apply​(org.junit.runners.model.Statement base,
                                                       org.junit.runner.Description description)
        Specified by:
        apply in interface org.junit.rules.TestRule
      • beforeEvaluate

        protected void beforeEvaluate()
      • afterEvaluate

        protected void afterEvaluate()
      • getReader

        public Reader getReader()