Class TestLogger


  • public class TestLogger
    extends java.lang.Object
    Improve Readability of console output by indenting
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static int METHOD_LEVEL
      1 Level Indentation for test methods
      static int ROOT_LEVEL
      No Indentation
      static int STEP_LEVEL
      2 Level Indentation for test steps in methods
    • Constructor Summary

      Constructors 
      Constructor Description
      TestLogger()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean add​(java.lang.String entry)
      adds the String to the list considering the indentation
      void addChildLevel​(java.lang.String describe)
      Adds a describing line to the output and increases indentation afterwards
      void addEmptyLine()
      Add an empty line to the log.
      void addSiblingLevel​(java.lang.String describe)
      Unindents, adds a describing line to the output and increases indentation afterwards
      void appendToLastEntry​(java.lang.String string)
      append text to the last entry.
      void indent()
      increase indentation
      void reset()
      Delete all entries.
      void setIndentLevel​(int lvl)
      set specific indentation level.
      void sysout()
      Prints all log entries to .
      void unIndent()
      decrease indentation
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • METHOD_LEVEL

        public static final int METHOD_LEVEL
        1 Level Indentation for test methods
        See Also:
        Constant Field Values
      • STEP_LEVEL

        public static final int STEP_LEVEL
        2 Level Indentation for test steps in methods
        See Also:
        Constant Field Values
    • Constructor Detail

      • TestLogger

        public TestLogger()
    • Method Detail

      • add

        public boolean add​(java.lang.String entry)
        adds the String to the list considering the indentation
        Parameters:
        entry - element to be appended to this list
        Returns:
        true (as specified by Collection.add)
      • addChildLevel

        public void addChildLevel​(java.lang.String describe)
        Adds a describing line to the output and increases indentation afterwards
        Parameters:
        describe - describing line
      • addSiblingLevel

        public void addSiblingLevel​(java.lang.String describe)
        Unindents, adds a describing line to the output and increases indentation afterwards
        Parameters:
        describe - describing line
      • indent

        public void indent()
        increase indentation
      • unIndent

        public void unIndent()
        decrease indentation
      • setIndentLevel

        public void setIndentLevel​(int lvl)
        set specific indentation level.
        Parameters:
        lvl - Level of indentation
      • sysout

        public void sysout()
        Prints all log entries to .
      • appendToLastEntry

        public void appendToLastEntry​(java.lang.String string)
        append text to the last entry.
        Parameters:
        string - text to append
      • addEmptyLine

        public void addEmptyLine()
        Add an empty line to the log.
      • reset

        public void reset()
        Delete all entries.