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
Nested ClassesModifier and TypeClassDescriptionstatic final record -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final List<JUnitEasyLogger.JUnitEasyLoggerEntry>The List of Logger entries for this logger -
Constructor Summary
ConstructorsConstructorDescriptionConstructs a new JUnit Easy Logger with a null Logger and empty entries List -
Method Summary
Modifier and TypeMethodDescriptionstatic voidassertEntries(JUnitEasyLogger.JUnitEasyLoggerEntry expectedEntry, JUnitEasyLogger logger) Will verify that the entries in the given logger contains one element and matches the expected entrystatic voidassertEntries(JUnitEasyLogger.JUnitEasyLoggerEntry expectedEntry, List<JUnitEasyLogger.JUnitEasyLoggerEntry> actualEntries) Will verify that the given actual entries contains one element and matches the expected entrystatic voidassertEntries(List<JUnitEasyLogger.JUnitEasyLoggerEntry> expectedEntries, JUnitEasyLogger logger) Will verify that the entries in the given logger match the expected entries.static voidassertEntries(List<JUnitEasyLogger.JUnitEasyLoggerEntry> expectedEntries, List<JUnitEasyLogger.JUnitEasyLoggerEntry> actualEntries) Will verify that the given actual entries match the expected entries.static voidassertEntries(Level level, String message, Throwable t, JUnitEasyLogger logger) static voidassertEntries(Level level, String message, Throwable t, List<JUnitEasyLogger.JUnitEasyLoggerEntry> actualEntries) voidvoidvoidvoidlogDebugFine(String debug) Logs the given debug message to theLoggeratLevel.FINEvoidlogDebugFine(String debug, Throwable t) voidvoidlogDebugFiner(String debug) Logs the given debug message to theLoggeratLevel.FINERvoidlogDebugFiner(String debug, Throwable t) voidvoidlogDebugFinest(String debug) Logs the given debug message to theLoggeratLevel.FINESTvoidlogDebugFinest(String debug, Throwable t) voidvoidvoidvoidvoidvoidvoidvoidlogWarning(String warning) voidlogWarning(String warning, Throwable t) voidMethods 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- TheLevelof the entry we're expectingmessage- The message of the entry we're expectingt- TheThrowableof the entry we're expectinglogger- TheJUnitEasyLoggerto 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- TheJUnitEasyLoggerto 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- TheJUnitEasyLoggerto 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:
logInfoin classcom.github.tadukoo.util.logger.EasyLogger- Parameters:
info- The message to be logged
-
logInfo
Logs the givenThrowableto theLogger. UsesThrowable.getMessage()as the message on the log entry. This entry is logged asinfo- Overrides:
logInfoin classcom.github.tadukoo.util.logger.EasyLogger- Parameters:
t- TheThrowableto be logged
-
logInfo
- Overrides:
logInfoin classcom.github.tadukoo.util.logger.EasyLogger- Parameters:
info- The message to be loggedt- TheThrowableto be logged
-
logWarning
- Overrides:
logWarningin classcom.github.tadukoo.util.logger.EasyLogger- Parameters:
warning- The message to be logged
-
logWarning
Logs the givenThrowableto theLogger. UsesThrowable.getMessage()as the message on the log entry. This entry is logged as awarning- Overrides:
logWarningin classcom.github.tadukoo.util.logger.EasyLogger- Parameters:
t- TheThrowableto be logged
-
logWarning
- Overrides:
logWarningin classcom.github.tadukoo.util.logger.EasyLogger- Parameters:
warning- The message to be loggedt- TheThrowableto be logged
-
logError
- Overrides:
logErrorin classcom.github.tadukoo.util.logger.EasyLogger- Parameters:
error- The message to be logged
-
logError
Logs the givenThrowableto theLogger. UsesThrowable.getMessage()as the message on the log entry. This entry is logged as anerror- Overrides:
logErrorin classcom.github.tadukoo.util.logger.EasyLogger- Parameters:
t- TheThrowableto be logged
-
logError
- Overrides:
logErrorin classcom.github.tadukoo.util.logger.EasyLogger- Parameters:
error- The message to be loggedt- TheThrowableto be logged
-
logConfig
- Overrides:
logConfigin classcom.github.tadukoo.util.logger.EasyLogger- Parameters:
config- The message to be logged
-
logConfig
Logs the givenThrowableto theLogger. UsesThrowable.getMessage()as the message on the log entry. This entry is logged as aconfigmessage- Overrides:
logConfigin classcom.github.tadukoo.util.logger.EasyLogger- Parameters:
t- TheThrowableto be logged
-
logConfig
- Overrides:
logConfigin classcom.github.tadukoo.util.logger.EasyLogger- Parameters:
config- The message to be loggedt- TheThrowableto be logged
-
logDebugFine
Logs the given debug message to theLoggeratLevel.FINE- Overrides:
logDebugFinein classcom.github.tadukoo.util.logger.EasyLogger- Parameters:
debug- The message to be logged
-
logDebugFine
Logs the givenThrowableto theLogger. UsesThrowable.getMessage()as the message on the log entry. This entry is logged atLevel.FINE- Overrides:
logDebugFinein classcom.github.tadukoo.util.logger.EasyLogger- Parameters:
t- TheThrowableto be logged
-
logDebugFine
- Overrides:
logDebugFinein classcom.github.tadukoo.util.logger.EasyLogger- Parameters:
debug- The message to be loggedt- TheThrowableto be logged
-
logDebugFiner
Logs the given debug message to theLoggeratLevel.FINER- Overrides:
logDebugFinerin classcom.github.tadukoo.util.logger.EasyLogger- Parameters:
debug- The message to be logged
-
logDebugFiner
Logs the givenThrowableto theLogger. UsesThrowable.getMessage()as the message on the log entry. This entry is logged atLevel.FINER- Overrides:
logDebugFinerin classcom.github.tadukoo.util.logger.EasyLogger- Parameters:
t- TheThrowableto be logged
-
logDebugFiner
- Overrides:
logDebugFinerin classcom.github.tadukoo.util.logger.EasyLogger- Parameters:
debug- The message to be loggedt- TheThrowableto be logged
-
logDebugFinest
Logs the given debug message to theLoggeratLevel.FINEST- Overrides:
logDebugFinestin classcom.github.tadukoo.util.logger.EasyLogger- Parameters:
debug- The message to be logged
-
logDebugFinest
Logs the givenThrowableto theLogger. UsesThrowable.getMessage()as the message on the log entry. This entry is logged atLevel.FINEST- Overrides:
logDebugFinestin classcom.github.tadukoo.util.logger.EasyLogger- Parameters:
t- TheThrowableto be logged
-
logDebugFinest
- Overrides:
logDebugFinestin classcom.github.tadukoo.util.logger.EasyLogger- Parameters:
debug- The message to be loggedt- TheThrowableto be logged
-