public class NutzBootExtension extends Object implements org.junit.jupiter.api.extension.BeforeAllCallback, org.junit.jupiter.api.extension.AfterAllCallback, org.junit.jupiter.api.extension.TestInstancePostProcessor, org.junit.jupiter.api.extension.BeforeEachCallback, org.junit.jupiter.api.extension.AfterEachCallback, org.junit.jupiter.api.extension.BeforeTestExecutionCallback, org.junit.jupiter.api.extension.AfterTestExecutionCallback, org.junit.jupiter.api.extension.ParameterResolver
| 构造器和说明 |
|---|
NutzBootExtension() |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
_init_fields(org.nutz.ioc.Ioc ioc,
Object testInstance)
遍历当前对象中的属性,如果标注了@Inject则从ioc容器取出对象,注入进去
|
void |
afterAll(org.junit.jupiter.api.extension.ExtensionContext context) |
void |
afterEach(org.junit.jupiter.api.extension.ExtensionContext context) |
void |
afterTestExecution(org.junit.jupiter.api.extension.ExtensionContext context) |
void |
beforeAll(org.junit.jupiter.api.extension.ExtensionContext context) |
void |
beforeEach(org.junit.jupiter.api.extension.ExtensionContext context) |
void |
beforeTestExecution(org.junit.jupiter.api.extension.ExtensionContext context) |
static AppContext |
getApplicationContext(org.junit.jupiter.api.extension.ExtensionContext context)
Get the
AppContext associated with the supplied ExtensionContext. |
void |
postProcessTestInstance(Object testInstance,
org.junit.jupiter.api.extension.ExtensionContext context) |
Object |
resolveParameter(org.junit.jupiter.api.extension.ParameterContext parameterContext,
org.junit.jupiter.api.extension.ExtensionContext extensionContext) |
boolean |
supportsParameter(org.junit.jupiter.api.extension.ParameterContext parameterContext,
org.junit.jupiter.api.extension.ExtensionContext extensionContext) |
public void beforeAll(org.junit.jupiter.api.extension.ExtensionContext context)
throws Exception
beforeAll 在接口中 org.junit.jupiter.api.extension.BeforeAllCallbackExceptionpublic void afterAll(org.junit.jupiter.api.extension.ExtensionContext context)
throws Exception
afterAll 在接口中 org.junit.jupiter.api.extension.AfterAllCallbackExceptionpublic void afterEach(org.junit.jupiter.api.extension.ExtensionContext context)
throws Exception
afterEach 在接口中 org.junit.jupiter.api.extension.AfterEachCallbackExceptionpublic void afterTestExecution(org.junit.jupiter.api.extension.ExtensionContext context)
throws Exception
afterTestExecution 在接口中 org.junit.jupiter.api.extension.AfterTestExecutionCallbackExceptionpublic void beforeEach(org.junit.jupiter.api.extension.ExtensionContext context)
throws Exception
beforeEach 在接口中 org.junit.jupiter.api.extension.BeforeEachCallbackExceptionpublic void beforeTestExecution(org.junit.jupiter.api.extension.ExtensionContext context)
throws Exception
beforeTestExecution 在接口中 org.junit.jupiter.api.extension.BeforeTestExecutionCallbackExceptionpublic boolean supportsParameter(org.junit.jupiter.api.extension.ParameterContext parameterContext,
org.junit.jupiter.api.extension.ExtensionContext extensionContext)
throws org.junit.jupiter.api.extension.ParameterResolutionException
supportsParameter 在接口中 org.junit.jupiter.api.extension.ParameterResolverorg.junit.jupiter.api.extension.ParameterResolutionExceptionpublic Object resolveParameter(org.junit.jupiter.api.extension.ParameterContext parameterContext, org.junit.jupiter.api.extension.ExtensionContext extensionContext) throws org.junit.jupiter.api.extension.ParameterResolutionException
resolveParameter 在接口中 org.junit.jupiter.api.extension.ParameterResolverorg.junit.jupiter.api.extension.ParameterResolutionExceptionpublic void postProcessTestInstance(Object testInstance, org.junit.jupiter.api.extension.ExtensionContext context) throws Exception
postProcessTestInstance 在接口中 org.junit.jupiter.api.extension.TestInstancePostProcessorExceptionpublic void _init_fields(org.nutz.ioc.Ioc ioc,
Object testInstance)
throws Exception
Exception - 注入过程中如果抛出异常public static AppContext getApplicationContext(org.junit.jupiter.api.extension.ExtensionContext context)
AppContext associated with the supplied ExtensionContext.context - the current ExtensionContext (never null)IllegalStateException - if an error occurs while retrieving the application context
//@see org.springframework.test.context.TestContext#getApplicationContext()Copyright © 2020. All rights reserved.