Package com.github.tadukoo.junit.logger
Class JUnitEasyLogger
java.lang.Object
com.github.tadukoo.util.logger.EasyLogger
com.github.tadukoo.junit.logger.JUnitEasyLogger
public class JUnitEasyLogger
extends com.github.tadukoo.util.logger.EasyLogger
JUnit Easy Logger is used when we don't want to create an actual log file during a JUnit test, but
want to verify that logging occurred properly. It contains a List of
JUnit Easy Logger Entries
that can be checked to verify log entries- Version:
- Alpha v.0.1
- Author:
- Logan Ferree (Tadukoo)
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final record
-
Field Summary
Modifier and TypeFieldDescriptionprivate final List<JUnitEasyLogger.JUnitEasyLoggerEntry>
The List of Logger entries for this logger -
Constructor Summary
ConstructorDescriptionConstructs a new JUnit Easy Logger with a null Logger and empty entries List -
Method Summary
Modifier and TypeMethodDescriptionstatic void
assertEntries
(JUnitEasyLogger.JUnitEasyLoggerEntry expectedEntry, JUnitEasyLogger logger) Will verify that the entries in the given logger contains one element and matches the expected entrystatic void
assertEntries
(JUnitEasyLogger.JUnitEasyLoggerEntry expectedEntry, List<JUnitEasyLogger.JUnitEasyLoggerEntry> actualEntries) Will verify that the given actual entries contains one element and matches the expected entrystatic void
assertEntries
(List<JUnitEasyLogger.JUnitEasyLoggerEntry> expectedEntries, JUnitEasyLogger logger) Will verify that the entries in the given logger match the expected entries.static void
assertEntries
(List<JUnitEasyLogger.JUnitEasyLoggerEntry> expectedEntries, List<JUnitEasyLogger.JUnitEasyLoggerEntry> actualEntries) Will verify that the given actual entries match the expected entries.static void
assertEntries
(Level level, String message, Throwable t, JUnitEasyLogger logger) static void
assertEntries
(Level level, String message, Throwable t, List<JUnitEasyLogger.JUnitEasyLoggerEntry> actualEntries) void
void
void
void
logDebugFine
(String debug) Logs the given debug message to theLogger
atLevel.FINE
void
logDebugFine
(String debug, Throwable t) void
void
logDebugFiner
(String debug) Logs the given debug message to theLogger
atLevel.FINER
void
logDebugFiner
(String debug, Throwable t) void
void
logDebugFinest
(String debug) Logs the given debug message to theLogger
atLevel.FINEST
void
logDebugFinest
(String debug, Throwable t) void
void
void
void
void
void
void
void
logWarning
(String warning) void
logWarning
(String warning, Throwable t) void
Methods inherited from class com.github.tadukoo.util.logger.EasyLogger
getLogger
-
Field Details
-
entries
The List of Logger entries for this logger
-
-
Constructor Details
-
JUnitEasyLogger
public JUnitEasyLogger()Constructs a new JUnit Easy Logger with a null Logger and empty entries List
-
-
Method Details
-
getEntries
- Returns:
- The List of logger entries for this logger
-
assertEntries
Will verify that the entries in the given logger contains one element with the givenLevel
, message, andThrowable
- Parameters:
level
- TheLevel
of the entry we're expectingmessage
- The message of the entry we're expectingt
- TheThrowable
of the entry we're expectinglogger
- TheJUnitEasyLogger
to check entries we actually have
-
assertEntries
public static void assertEntries(Level level, String message, Throwable t, List<JUnitEasyLogger.JUnitEasyLoggerEntry> actualEntries) -
assertEntries
public static void assertEntries(JUnitEasyLogger.JUnitEasyLoggerEntry expectedEntry, JUnitEasyLogger logger) Will verify that the entries in the given logger contains one element and matches the expected entry- Parameters:
expectedEntry
- The entry we're expectinglogger
- TheJUnitEasyLogger
to check entries we actually have
-
assertEntries
public static void assertEntries(JUnitEasyLogger.JUnitEasyLoggerEntry expectedEntry, List<JUnitEasyLogger.JUnitEasyLoggerEntry> actualEntries) Will verify that the given actual entries contains one element and matches the expected entry- Parameters:
expectedEntry
- The entry we're expectingactualEntries
- The entries we actually have
-
assertEntries
public static void assertEntries(List<JUnitEasyLogger.JUnitEasyLoggerEntry> expectedEntries, JUnitEasyLogger logger) Will verify that the entries in the given logger match the expected entries.- Parameters:
expectedEntries
- The entries we're expectinglogger
- TheJUnitEasyLogger
to check entries we actually have
-
assertEntries
public static void assertEntries(List<JUnitEasyLogger.JUnitEasyLoggerEntry> expectedEntries, List<JUnitEasyLogger.JUnitEasyLoggerEntry> actualEntries) Will verify that the given actual entries match the expected entries.- Parameters:
expectedEntries
- The entries we're expectingactualEntries
- The entries we actually have
-
logInfo
- Overrides:
logInfo
in classcom.github.tadukoo.util.logger.EasyLogger
- Parameters:
info
- The message to be logged
-
logInfo
Logs the givenThrowable
to theLogger
. UsesThrowable.getMessage()
as the message on the log entry. This entry is logged asinfo
- Overrides:
logInfo
in classcom.github.tadukoo.util.logger.EasyLogger
- Parameters:
t
- TheThrowable
to be logged
-
logInfo
- Overrides:
logInfo
in classcom.github.tadukoo.util.logger.EasyLogger
- Parameters:
info
- The message to be loggedt
- TheThrowable
to be logged
-
logWarning
- Overrides:
logWarning
in classcom.github.tadukoo.util.logger.EasyLogger
- Parameters:
warning
- The message to be logged
-
logWarning
Logs the givenThrowable
to theLogger
. UsesThrowable.getMessage()
as the message on the log entry. This entry is logged as awarning
- Overrides:
logWarning
in classcom.github.tadukoo.util.logger.EasyLogger
- Parameters:
t
- TheThrowable
to be logged
-
logWarning
- Overrides:
logWarning
in classcom.github.tadukoo.util.logger.EasyLogger
- Parameters:
warning
- The message to be loggedt
- TheThrowable
to be logged
-
logError
- Overrides:
logError
in classcom.github.tadukoo.util.logger.EasyLogger
- Parameters:
error
- The message to be logged
-
logError
Logs the givenThrowable
to theLogger
. UsesThrowable.getMessage()
as the message on the log entry. This entry is logged as anerror
- Overrides:
logError
in classcom.github.tadukoo.util.logger.EasyLogger
- Parameters:
t
- TheThrowable
to be logged
-
logError
- Overrides:
logError
in classcom.github.tadukoo.util.logger.EasyLogger
- Parameters:
error
- The message to be loggedt
- TheThrowable
to be logged
-
logConfig
- Overrides:
logConfig
in classcom.github.tadukoo.util.logger.EasyLogger
- Parameters:
config
- The message to be logged
-
logConfig
Logs the givenThrowable
to theLogger
. UsesThrowable.getMessage()
as the message on the log entry. This entry is logged as aconfig
message- Overrides:
logConfig
in classcom.github.tadukoo.util.logger.EasyLogger
- Parameters:
t
- TheThrowable
to be logged
-
logConfig
- Overrides:
logConfig
in classcom.github.tadukoo.util.logger.EasyLogger
- Parameters:
config
- The message to be loggedt
- TheThrowable
to be logged
-
logDebugFine
Logs the given debug message to theLogger
atLevel.FINE
- Overrides:
logDebugFine
in classcom.github.tadukoo.util.logger.EasyLogger
- Parameters:
debug
- The message to be logged
-
logDebugFine
Logs the givenThrowable
to theLogger
. UsesThrowable.getMessage()
as the message on the log entry. This entry is logged atLevel.FINE
- Overrides:
logDebugFine
in classcom.github.tadukoo.util.logger.EasyLogger
- Parameters:
t
- TheThrowable
to be logged
-
logDebugFine
- Overrides:
logDebugFine
in classcom.github.tadukoo.util.logger.EasyLogger
- Parameters:
debug
- The message to be loggedt
- TheThrowable
to be logged
-
logDebugFiner
Logs the given debug message to theLogger
atLevel.FINER
- Overrides:
logDebugFiner
in classcom.github.tadukoo.util.logger.EasyLogger
- Parameters:
debug
- The message to be logged
-
logDebugFiner
Logs the givenThrowable
to theLogger
. UsesThrowable.getMessage()
as the message on the log entry. This entry is logged atLevel.FINER
- Overrides:
logDebugFiner
in classcom.github.tadukoo.util.logger.EasyLogger
- Parameters:
t
- TheThrowable
to be logged
-
logDebugFiner
- Overrides:
logDebugFiner
in classcom.github.tadukoo.util.logger.EasyLogger
- Parameters:
debug
- The message to be loggedt
- TheThrowable
to be logged
-
logDebugFinest
Logs the given debug message to theLogger
atLevel.FINEST
- Overrides:
logDebugFinest
in classcom.github.tadukoo.util.logger.EasyLogger
- Parameters:
debug
- The message to be logged
-
logDebugFinest
Logs the givenThrowable
to theLogger
. UsesThrowable.getMessage()
as the message on the log entry. This entry is logged atLevel.FINEST
- Overrides:
logDebugFinest
in classcom.github.tadukoo.util.logger.EasyLogger
- Parameters:
t
- TheThrowable
to be logged
-
logDebugFinest
- Overrides:
logDebugFinest
in classcom.github.tadukoo.util.logger.EasyLogger
- Parameters:
debug
- The message to be loggedt
- TheThrowable
to be logged
-