Package de.cuioss.test.juli
Class LogAsserts
- java.lang.Object
-
- de.cuioss.test.juli.LogAsserts
-
public final class LogAsserts extends Object
Provides a number of asserts against theLogRecords gathered byTestLogHandler. Caution: In order to use the asserts theTestLogHandlermust be properly configured by callingTestLoggerFactory.install()prior to usage. Usually this is done byEnableTestLogger- Author:
- Oliver Wolff
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidassertLogMessagePresent(TestLogLevel logLevel, String message)Asserts whether at least oneLogRecordfor the given parameter is presentstatic voidassertLogMessagePresent(TestLogLevel logLevel, String message, Class<? extends Throwable> throwableClass)Asserts whether at least oneLogRecordfor the given parameter is presentstatic voidassertLogMessagePresent(TestLogLevel logLevel, String message, Throwable throwable)Asserts whether at least oneLogRecordfor the given parameter is presentstatic voidassertLogMessagePresentContaining(TestLogLevel logLevel, String messagePart)Asserts whether at least oneLogRecordfor the given parameter is presentstatic voidassertLogMessagePresentContaining(TestLogLevel logLevel, String messagePart, Class<? extends Throwable> throwableClass)Asserts whether at least oneLogRecordfor the given parameter is presentstatic voidassertLogMessagePresentContaining(TestLogLevel logLevel, String messagePart, Throwable throwable)Asserts whether at least oneLogRecordfor the given parameter is presentstatic voidassertNoLogMessagePresent(TestLogLevel logLevel, Class<?> logger)Asserts whether noLogRecordfor the given parameter is presentstatic voidassertNoLogMessagePresent(TestLogLevel logLevel, String messagePart)Asserts whether noLogRecordfor the given parameter is presentstatic voidassertSingleLogMessagePresent(TestLogLevel logLevel, String message)Asserts whether exactly oneLogRecordfor the given parameter is presentstatic voidassertSingleLogMessagePresent(TestLogLevel logLevel, String message, Class<? extends Throwable> throwableClass)Asserts whether exactly oneLogRecordfor the given parameter is presentstatic voidassertSingleLogMessagePresent(TestLogLevel logLevel, String message, Throwable throwable)Asserts whether exactly oneLogRecordfor the given parameter is presentstatic voidassertSingleLogMessagePresentContaining(TestLogLevel logLevel, String messagePart)Asserts whether exactly oneLogRecordfor the given parameter is presentstatic voidassertSingleLogMessagePresentContaining(TestLogLevel logLevel, String messagePart, Class<? extends Throwable> throwableClass)Asserts whether exactly oneLogRecordfor the given parameter is presentstatic voidassertSingleLogMessagePresentContaining(TestLogLevel logLevel, String messagePart, Throwable throwable)Asserts whether exactly oneLogRecordfor the given parameter is present
-
-
-
Method Detail
-
assertLogMessagePresent
public static void assertLogMessagePresent(TestLogLevel logLevel, String message)
Asserts whether at least oneLogRecordfor the given parameter is present- Parameters:
logLevel- to be checked, must not be nullmessage- to be checked, must not be null
-
assertNoLogMessagePresent
public static void assertNoLogMessagePresent(TestLogLevel logLevel, String messagePart)
Asserts whether noLogRecordfor the given parameter is present- Parameters:
logLevel- to be checked, must not be nullmessagePart- to be checked, must not be null
-
assertNoLogMessagePresent
public static void assertNoLogMessagePresent(TestLogLevel logLevel, Class<?> logger)
Asserts whether noLogRecordfor the given parameter is present- Parameters:
logLevel- to be checked, must not be nulllogger- to be checked, must not be null
-
assertSingleLogMessagePresent
public static void assertSingleLogMessagePresent(TestLogLevel logLevel, String message)
Asserts whether exactly oneLogRecordfor the given parameter is present- Parameters:
logLevel- to be checked, must not be nullmessage- to be checked, must not be null
-
assertLogMessagePresent
public static void assertLogMessagePresent(TestLogLevel logLevel, String message, Throwable throwable)
Asserts whether at least oneLogRecordfor the given parameter is present- Parameters:
logLevel- to be checked, must not be nullmessage- to be checked, must not be nullthrowable- to be checked, must not be null
-
assertSingleLogMessagePresent
public static void assertSingleLogMessagePresent(TestLogLevel logLevel, String message, Throwable throwable)
Asserts whether exactly oneLogRecordfor the given parameter is present- Parameters:
logLevel- to be checked, must not be nullmessage- to be checked, must not be nullthrowable- to be checked, must not be null
-
assertLogMessagePresent
public static void assertLogMessagePresent(TestLogLevel logLevel, String message, Class<? extends Throwable> throwableClass)
Asserts whether at least oneLogRecordfor the given parameter is present- Parameters:
logLevel- to be checked, must not be nullmessage- to be checked, must not be nullthrowableClass- to be checked, must not be null
-
assertSingleLogMessagePresent
public static void assertSingleLogMessagePresent(TestLogLevel logLevel, String message, Class<? extends Throwable> throwableClass)
Asserts whether exactly oneLogRecordfor the given parameter is present- Parameters:
logLevel- to be checked, must not be nullmessage- to be checked, must not be nullthrowableClass- to be checked, must not be null
-
assertLogMessagePresentContaining
public static void assertLogMessagePresentContaining(TestLogLevel logLevel, String messagePart)
Asserts whether at least oneLogRecordfor the given parameter is present- Parameters:
logLevel- to be checked, must not be nullmessagePart- to be checked, must not be null
-
assertSingleLogMessagePresentContaining
public static void assertSingleLogMessagePresentContaining(TestLogLevel logLevel, String messagePart)
Asserts whether exactly oneLogRecordfor the given parameter is present- Parameters:
logLevel- to be checked, must not be nullmessagePart- to be checked, must not be null
-
assertLogMessagePresentContaining
public static void assertLogMessagePresentContaining(TestLogLevel logLevel, String messagePart, Throwable throwable)
Asserts whether at least oneLogRecordfor the given parameter is present- Parameters:
logLevel- to be checked, must not be nullmessagePart- to be checked, must not be nullthrowable- to be checked, must not be null
-
assertLogMessagePresentContaining
public static void assertLogMessagePresentContaining(TestLogLevel logLevel, String messagePart, Class<? extends Throwable> throwableClass)
Asserts whether at least oneLogRecordfor the given parameter is present- Parameters:
logLevel- to be checked, must not be nullmessagePart- to be checked, must not be nullthrowableClass- to be checked, must not be null
-
assertSingleLogMessagePresentContaining
public static void assertSingleLogMessagePresentContaining(TestLogLevel logLevel, String messagePart, Throwable throwable)
Asserts whether exactly oneLogRecordfor the given parameter is present- Parameters:
logLevel- to be checked, must not be nullmessagePart- to be checked, must not be nullthrowable- to be checked, must not be null
-
assertSingleLogMessagePresentContaining
public static void assertSingleLogMessagePresentContaining(TestLogLevel logLevel, String messagePart, Class<? extends Throwable> throwableClass)
Asserts whether exactly oneLogRecordfor the given parameter is present- Parameters:
logLevel- to be checked, must not be nullmessagePart- to be checked, must not be nullthrowableClass- to be checked, must not be null
-
-