tom.platform
Class TestHandler
java.lang.Object
java.util.logging.Handler
tom.platform.TestHandler
public class TestHandler
- extends Handler
Methods inherited from class java.util.logging.Handler |
getEncoding, getErrorManager, getFilter, getFormatter, getLevel, reportError, setEncoding, setErrorManager, setFilter, setFormatter, setLevel |
TestHandler
public TestHandler(String fileName)
- Constructor
hasLog
public boolean hasLog(Level level)
hasError
public boolean hasError()
hasWarning
public boolean hasWarning()
nbOfLogs
public int nbOfLogs(Level level)
nbOfErrors
public int nbOfErrors()
nbOfWarnings
public int nbOfWarnings()
publish
public void publish(LogRecord record)
- Specified by:
publish
in class Handler
close
public void close()
- Specified by:
close
in class Handler
flush
public void flush()
- Specified by:
flush
in class Handler
clear
public void clear()
toString
public String toString()
- Overrides:
toString
in class Object
isLoggable
public boolean isLoggable(LogRecord record)
- This Handler keeps track of all LogRecords, therefore this method always
returns true. Please note that since we receive the LogRecords from a
Logger, we actually only keep track of logs with a Level equal or higher
than the Logger's.
- Overrides:
isLoggable
in class Handler
- Parameters:
record
- a given LogRecord
- Returns:
- true
nonRegressionTest
public void nonRegressionTest(PlatformLogRecord record)
- This method tests if this current record was attempted by the test file
by comparing the content of the message, the line, the filepath and paramaters.
Currently, only the type of message is tested. It is insufficient because
most of the messages are encapsulated in a message of type DetailedMessage
- Parameters:
record
- a given LogRecord