public class Log4jLoggerExtension extends Object implements org.junit.jupiter.api.extension.AfterEachCallback, org.junit.jupiter.api.extension.BeforeEachCallback, org.junit.jupiter.api.extension.ParameterResolver
ExtendWith
to inject constructor parameter into a test.Constructor and Description |
---|
Log4jLoggerExtension()
Creates a watcher of the root category
|
Log4jLoggerExtension(Class<?> clazz)
Creates a watcher of the given class category
|
Log4jLoggerExtension(String category)
Creates a watcher of the given category
|
Modifier and Type | Method and Description |
---|---|
void |
afterEach(org.junit.jupiter.api.extension.ExtensionContext extensionContext) |
void |
beforeEach(org.junit.jupiter.api.extension.ExtensionContext extensionContext) |
String |
getMessage() |
void |
reset() |
Object |
resolveParameter(org.junit.jupiter.api.extension.ParameterContext parameterContext,
org.junit.jupiter.api.extension.ExtensionContext extensionContext) |
void |
setLevel(org.apache.log4j.Level level) |
boolean |
supportsParameter(org.junit.jupiter.api.extension.ParameterContext parameterContext,
org.junit.jupiter.api.extension.ExtensionContext extensionContext) |
public Log4jLoggerExtension(String category)
category
- the category to watchpublic Log4jLoggerExtension()
public Log4jLoggerExtension(Class<?> clazz)
clazz
- the class category to watchpublic String getMessage()
public void reset()
public void setLevel(org.apache.log4j.Level level)
public void beforeEach(org.junit.jupiter.api.extension.ExtensionContext extensionContext) throws Exception
beforeEach
in interface org.junit.jupiter.api.extension.BeforeEachCallback
Exception
public void afterEach(org.junit.jupiter.api.extension.ExtensionContext extensionContext) throws Exception
afterEach
in interface org.junit.jupiter.api.extension.AfterEachCallback
Exception
public boolean supportsParameter(org.junit.jupiter.api.extension.ParameterContext parameterContext, org.junit.jupiter.api.extension.ExtensionContext extensionContext) throws org.junit.jupiter.api.extension.ParameterResolutionException
supportsParameter
in interface org.junit.jupiter.api.extension.ParameterResolver
org.junit.jupiter.api.extension.ParameterResolutionException
public Object resolveParameter(org.junit.jupiter.api.extension.ParameterContext parameterContext, org.junit.jupiter.api.extension.ExtensionContext extensionContext) throws org.junit.jupiter.api.extension.ParameterResolutionException
resolveParameter
in interface org.junit.jupiter.api.extension.ParameterResolver
org.junit.jupiter.api.extension.ParameterResolutionException
Copyright © 2002-2021 Atlassian. All Rights Reserved.