Class AssertionLoggerHandler

  • All Implemented Interfaces:
    java.io.Closeable, java.io.Flushable, java.lang.AutoCloseable, org.jboss.logmanager.handlers.FlushableCloseable, org.jboss.logmanager.Protectable

    public class AssertionLoggerHandler
    extends org.jboss.logmanager.ExtHandler
    This class contains a tool where programs could intercept for LogMessage given an interval of time between startCapture() and stopCapture() Be careful with this use as this is intended for testing only (such as testcases)
    • Field Summary

      • Fields inherited from class org.jboss.logmanager.ExtHandler

        handlers, handlersUpdater
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static void clear()  
      void close()
      static int countText​(java.lang.String... text)  
      protected void doPublish​(org.jboss.logmanager.ExtLogRecord record)  
      static boolean findText​(long mstimeout, java.lang.String... text)  
      static boolean findText​(java.lang.String... text)
      Find a line that contains the parameters passed as an argument
      void flush()
      static boolean hasLevel​(java.util.logging.Level level)
      is there any record matching Level?
      static boolean matchText​(java.lang.String pattern)  
      static void startCapture()  
      static void startCapture​(boolean individualMessages)  
      static void stopCapture()  
      • Methods inherited from class org.jboss.logmanager.ExtHandler

        addHandler, checkAccess, checkAccess, clearHandlers, disableAccess, enableAccess, getHandlers, isAutoFlush, isCallerCalculationRequired, isCloseChildren, isEnabled, protect, publish, publish, removeHandler, setAutoFlush, setCloseChildren, setEnabled, setEncoding, setErrorManager, setFilter, setFormatter, setHandlers, setLevel, unprotect
      • Methods inherited from class java.util.logging.Handler

        getEncoding, getErrorManager, getFilter, getFormatter, getLevel, isLoggable, reportError
      • Methods inherited from class java.lang.Object

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

      • AssertionLoggerHandler

        public AssertionLoggerHandler()
    • Method Detail

      • flush

        public void flush()
        Specified by:
        flush in interface java.io.Flushable
        Overrides:
        flush in class org.jboss.logmanager.ExtHandler
      • close

        public void close()
                   throws java.lang.SecurityException
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Overrides:
        close in class org.jboss.logmanager.ExtHandler
        Throws:
        java.lang.SecurityException
      • doPublish

        protected void doPublish​(org.jboss.logmanager.ExtLogRecord record)
        Overrides:
        doPublish in class org.jboss.logmanager.ExtHandler
      • hasLevel

        public static boolean hasLevel​(java.util.logging.Level level)
        is there any record matching Level?
        Parameters:
        level -
        Returns:
      • findText

        public static boolean findText​(long mstimeout,
                                       java.lang.String... text)
      • findText

        public static boolean findText​(java.lang.String... text)
        Find a line that contains the parameters passed as an argument
        Parameters:
        text -
        Returns:
      • countText

        public static int countText​(java.lang.String... text)
      • matchText

        public static boolean matchText​(java.lang.String pattern)
      • clear

        public static final void clear()
      • startCapture

        public static final void startCapture()
      • startCapture

        public static final void startCapture​(boolean individualMessages)
        Parameters:
        individualMessages - enables counting individual messages.
      • stopCapture

        public static final void stopCapture()