public class RunTestOnContext extends Object implements org.junit.jupiter.api.extension.BeforeAllCallback, org.junit.jupiter.api.extension.InvocationInterceptor, org.junit.jupiter.api.extension.AfterEachCallback, org.junit.jupiter.api.extension.AfterAllCallback
When used as a RegisterExtension
instance field, a new Vertx
object and Context
are created for each tested method.
BeforeEach
and AfterEach
methods are executed on this context.
When used as a RegisterExtension
static field, a single Vertx
object and Context
are created for all the tested methods.
BeforeAll
and AfterAll
methods are executed on this context too.
Constructor and Description |
---|
RunTestOnContext()
Create an instance of this extension that builds a
Vertx object using default options. |
RunTestOnContext(java.util.function.Supplier<Future<Vertx>> supplier)
Create an instance of this extension that gets a
Vertx object using the specified asynchronous supplier . |
RunTestOnContext(java.util.function.Supplier<Future<Vertx>> supplier,
java.util.function.Function<Vertx,Future<Void>> shutdown)
Create an instance of this extension that gets a
Vertx object using the specified asynchronous supplier . |
RunTestOnContext(VertxOptions options)
Create an instance of this extension that builds a
Vertx object using the specified options . |
Modifier and Type | Method and Description |
---|---|
void |
afterAll(org.junit.jupiter.api.extension.ExtensionContext context) |
void |
afterEach(org.junit.jupiter.api.extension.ExtensionContext context) |
void |
beforeAll(org.junit.jupiter.api.extension.ExtensionContext context) |
void |
interceptAfterAllMethod(org.junit.jupiter.api.extension.InvocationInterceptor.Invocation<Void> invocation,
org.junit.jupiter.api.extension.ReflectiveInvocationContext<Method> invocationContext,
org.junit.jupiter.api.extension.ExtensionContext extensionContext) |
void |
interceptAfterEachMethod(org.junit.jupiter.api.extension.InvocationInterceptor.Invocation<Void> invocation,
org.junit.jupiter.api.extension.ReflectiveInvocationContext<Method> invocationContext,
org.junit.jupiter.api.extension.ExtensionContext extensionContext) |
void |
interceptBeforeAllMethod(org.junit.jupiter.api.extension.InvocationInterceptor.Invocation<Void> invocation,
org.junit.jupiter.api.extension.ReflectiveInvocationContext<Method> invocationContext,
org.junit.jupiter.api.extension.ExtensionContext extensionContext) |
void |
interceptBeforeEachMethod(org.junit.jupiter.api.extension.InvocationInterceptor.Invocation<Void> invocation,
org.junit.jupiter.api.extension.ReflectiveInvocationContext<Method> invocationContext,
org.junit.jupiter.api.extension.ExtensionContext extensionContext) |
void |
interceptDynamicTest(org.junit.jupiter.api.extension.InvocationInterceptor.Invocation<Void> invocation,
org.junit.jupiter.api.extension.ExtensionContext extensionContext) |
<T> T |
interceptTestFactoryMethod(org.junit.jupiter.api.extension.InvocationInterceptor.Invocation<T> invocation,
org.junit.jupiter.api.extension.ReflectiveInvocationContext<Method> invocationContext,
org.junit.jupiter.api.extension.ExtensionContext extensionContext) |
void |
interceptTestMethod(org.junit.jupiter.api.extension.InvocationInterceptor.Invocation<Void> invocation,
org.junit.jupiter.api.extension.ReflectiveInvocationContext<Method> invocationContext,
org.junit.jupiter.api.extension.ExtensionContext extensionContext) |
void |
interceptTestTemplateMethod(org.junit.jupiter.api.extension.InvocationInterceptor.Invocation<Void> invocation,
org.junit.jupiter.api.extension.ReflectiveInvocationContext<Method> invocationContext,
org.junit.jupiter.api.extension.ExtensionContext extensionContext) |
Vertx |
vertx() |
public RunTestOnContext()
Vertx
object using default options.public RunTestOnContext(VertxOptions options)
Vertx
object using the specified options
.
When the options hold a ClusterManager
instance, a clustered Vertx
object is created.
options
- the vertx optionspublic RunTestOnContext(java.util.function.Supplier<Future<Vertx>> supplier)
Vertx
object using the specified asynchronous supplier
.supplier
- the asynchronous supplierpublic RunTestOnContext(java.util.function.Supplier<Future<Vertx>> supplier, java.util.function.Function<Vertx,Future<Void>> shutdown)
Vertx
object using the specified asynchronous supplier
.
The asynchronous shutdown
function is invoked when the Vertx
object is no longer needed.supplier
- the asynchronous suppliershutdown
- the asynchronous shutdown functionpublic Vertx vertx()
public void beforeAll(org.junit.jupiter.api.extension.ExtensionContext context)
beforeAll
in interface org.junit.jupiter.api.extension.BeforeAllCallback
public void interceptBeforeAllMethod(org.junit.jupiter.api.extension.InvocationInterceptor.Invocation<Void> invocation, org.junit.jupiter.api.extension.ReflectiveInvocationContext<Method> invocationContext, org.junit.jupiter.api.extension.ExtensionContext extensionContext) throws Throwable
interceptBeforeAllMethod
in interface org.junit.jupiter.api.extension.InvocationInterceptor
Throwable
public void interceptBeforeEachMethod(org.junit.jupiter.api.extension.InvocationInterceptor.Invocation<Void> invocation, org.junit.jupiter.api.extension.ReflectiveInvocationContext<Method> invocationContext, org.junit.jupiter.api.extension.ExtensionContext extensionContext) throws Throwable
interceptBeforeEachMethod
in interface org.junit.jupiter.api.extension.InvocationInterceptor
Throwable
public void interceptTestMethod(org.junit.jupiter.api.extension.InvocationInterceptor.Invocation<Void> invocation, org.junit.jupiter.api.extension.ReflectiveInvocationContext<Method> invocationContext, org.junit.jupiter.api.extension.ExtensionContext extensionContext) throws Throwable
interceptTestMethod
in interface org.junit.jupiter.api.extension.InvocationInterceptor
Throwable
public <T> T interceptTestFactoryMethod(org.junit.jupiter.api.extension.InvocationInterceptor.Invocation<T> invocation, org.junit.jupiter.api.extension.ReflectiveInvocationContext<Method> invocationContext, org.junit.jupiter.api.extension.ExtensionContext extensionContext) throws Throwable
interceptTestFactoryMethod
in interface org.junit.jupiter.api.extension.InvocationInterceptor
Throwable
public void interceptTestTemplateMethod(org.junit.jupiter.api.extension.InvocationInterceptor.Invocation<Void> invocation, org.junit.jupiter.api.extension.ReflectiveInvocationContext<Method> invocationContext, org.junit.jupiter.api.extension.ExtensionContext extensionContext) throws Throwable
interceptTestTemplateMethod
in interface org.junit.jupiter.api.extension.InvocationInterceptor
Throwable
public void interceptDynamicTest(org.junit.jupiter.api.extension.InvocationInterceptor.Invocation<Void> invocation, org.junit.jupiter.api.extension.ExtensionContext extensionContext) throws Throwable
interceptDynamicTest
in interface org.junit.jupiter.api.extension.InvocationInterceptor
Throwable
public void interceptAfterEachMethod(org.junit.jupiter.api.extension.InvocationInterceptor.Invocation<Void> invocation, org.junit.jupiter.api.extension.ReflectiveInvocationContext<Method> invocationContext, org.junit.jupiter.api.extension.ExtensionContext extensionContext) throws Throwable
interceptAfterEachMethod
in interface org.junit.jupiter.api.extension.InvocationInterceptor
Throwable
public void interceptAfterAllMethod(org.junit.jupiter.api.extension.InvocationInterceptor.Invocation<Void> invocation, org.junit.jupiter.api.extension.ReflectiveInvocationContext<Method> invocationContext, org.junit.jupiter.api.extension.ExtensionContext extensionContext) throws Throwable
interceptAfterAllMethod
in interface org.junit.jupiter.api.extension.InvocationInterceptor
Throwable
public void afterEach(org.junit.jupiter.api.extension.ExtensionContext context) throws Exception
afterEach
in interface org.junit.jupiter.api.extension.AfterEachCallback
Exception
Copyright © 2024 Eclipse. All rights reserved.