Package de.cuioss.test.juli.junit5
Annotation Interface EnableTestLogger
@Documented
@Retention(RUNTIME)
@Target(TYPE)
@ExtendWith(TestLoggerController.class)
public @interface EnableTestLogger
Meta-annotation that allows test classes to be extended with
TestLoggerController
instead of using
@ExtendWith(TestLoggerController.class)
.
Used on a Junit 5 test this annotation ensures that the test-logger /
assertion system is initialized properly, see
TestLoggerFactory.install()
, and
TestLoggerFactory.configureLogger()
, and the actual log-statements
are cleared before each test. After all tests the test-logger is uninstalled
again, see TestLoggerFactory.uninstall()
.
Use the annotations for specifying the log-level to be set for the concrete
unit-tests. The level defined within this annotation will overwrite settings
found either within System.getProperty(String)
and
"cui_logger.properties"
Use LogAsserts
to make assertions to logged data.
- Author:
- Oliver Wolff
-
Optional Element Summary
Optional Elements
-
Element Details
-
rootLevel
- Returns:
- The
TestLogLevel
to be set before each test. It defaults toTestLogLevel.INFO
- Default:
- INFO
-
trace
- Returns:
- the types for which
TestLogLevel.TRACE
will be enabled, which implicitly maps toLevel.FINEST
- Default:
- {}
-
debug
- Returns:
- the types for which
TestLogLevel.DEBUG
will be enabled, which implicitly maps toLevel.FINE
- Default:
- {}
-
info
- Returns:
- the types for which
TestLogLevel.INFO
will be enabled, which implicitly maps toLevel.INFO
- Default:
- {}
-
warn
- Returns:
- the types for which
TestLogLevel.WARN
will be enabled, which implicitly maps toLevel.WARNING
- Default:
- {}
-
error
- Returns:
- the types for which
TestLogLevel.ERROR
will be enabled, which implicitly maps toLevel.SEVERE
- Default:
- {}
-