Class Log4J2Logger
java.lang.Object
com.atlassian.confluence.util.test.rules.AnnotatedMethodTemplate<Log4J2Logger.Record>
com.atlassian.confluence.util.test.rules.Log4J2Logger
- All Implemented Interfaces:
org.junit.rules.TestRule
Deprecated.
since 7.20 no replcement
Record the logging output for a given log4j2 logger.
Usage:
public class MyTest
{
@literal @Rule public Log4JLogger logger = new Log4JLogger(MyTest.class);
@literal @Test
@literal @Log4JLogger.Record(loggerClass = MyUnitUnderTest.class, logLevel = Log4JLogger.LogLevel.DEBUG)
public void myTestMethod() throws Exception
{
// call unit under test
Assert.assertEquals("expected log message", logger.snapshot());
}
}
- Since:
- 7.5
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
Deprecated.static @interface
Deprecated. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final org.apache.logging.log4j.core.StringLayout
Deprecated.Fields inherited from class com.atlassian.confluence.util.test.rules.AnnotatedMethodTemplate
annotationClass, testClass
-
Constructor Summary
ConstructorsConstructorDescriptionLog4J2Logger
(Class testClass) Deprecated.Log4J2Logger
(Class testClass, org.apache.logging.log4j.core.StringLayout layout) Deprecated. -
Method Summary
Modifier and TypeMethodDescriptionprotected org.junit.runners.model.Statement
applyForAnnotation
(org.junit.runners.model.Statement statement, org.junit.runner.Description description, Log4J2Logger.Record record) Deprecated.snapshot()
Deprecated.Methods inherited from class com.atlassian.confluence.util.test.rules.AnnotatedMethodTemplate
apply
-
Field Details
-
layout
protected final org.apache.logging.log4j.core.StringLayout layoutDeprecated.
-
-
Constructor Details
-
Log4J2Logger
Deprecated. -
Log4J2Logger
Deprecated.
-
-
Method Details
-
applyForAnnotation
protected org.junit.runners.model.Statement applyForAnnotation(org.junit.runners.model.Statement statement, org.junit.runner.Description description, Log4J2Logger.Record record) Deprecated.- Specified by:
applyForAnnotation
in classAnnotatedMethodTemplate<Log4J2Logger.Record>
-
snapshot
Deprecated.
-