Package org.hibernate.testing.orm.junit
Class EntityManagerFactoryScopeExtension
- java.lang.Object
-
- org.hibernate.testing.orm.junit.EntityManagerFactoryScopeExtension
-
- All Implemented Interfaces:
org.junit.jupiter.api.extension.AfterAllCallback
,org.junit.jupiter.api.extension.Extension
,org.junit.jupiter.api.extension.TestExecutionExceptionHandler
,org.junit.jupiter.api.extension.TestInstancePostProcessor
public class EntityManagerFactoryScopeExtension extends java.lang.Object implements org.junit.jupiter.api.extension.TestInstancePostProcessor, org.junit.jupiter.api.extension.AfterAllCallback, org.junit.jupiter.api.extension.TestExecutionExceptionHandler
The thing that actually manages lifecycle of the EntityManagerFactory related to a test class. Work in conjunction with EntityManagerFactoryScope and EntityManagerFactoryScopeContainer.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.Object
ENTITYMANAGER_FACTORY_KEY
-
Constructor Summary
Constructors Constructor Description EntityManagerFactoryScopeExtension()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
afterAll(org.junit.jupiter.api.extension.ExtensionContext context)
static java.util.Optional<EntityManagerFactoryScope>
findEntityManagerFactoryScope(org.junit.jupiter.api.extension.ExtensionContext context)
void
handleTestExecutionException(org.junit.jupiter.api.extension.ExtensionContext context, java.lang.Throwable throwable)
static org.junit.jupiter.api.extension.ExtensionContext.Namespace
namespace(java.lang.Object testInstance)
void
postProcessTestInstance(java.lang.Object testInstance, org.junit.jupiter.api.extension.ExtensionContext context)
-
-
-
Method Detail
-
namespace
public static org.junit.jupiter.api.extension.ExtensionContext.Namespace namespace(java.lang.Object testInstance)
-
findEntityManagerFactoryScope
public static java.util.Optional<EntityManagerFactoryScope> findEntityManagerFactoryScope(org.junit.jupiter.api.extension.ExtensionContext context)
-
postProcessTestInstance
public void postProcessTestInstance(java.lang.Object testInstance, org.junit.jupiter.api.extension.ExtensionContext context)
- Specified by:
postProcessTestInstance
in interfaceorg.junit.jupiter.api.extension.TestInstancePostProcessor
-
afterAll
public void afterAll(org.junit.jupiter.api.extension.ExtensionContext context)
- Specified by:
afterAll
in interfaceorg.junit.jupiter.api.extension.AfterAllCallback
-
handleTestExecutionException
public void handleTestExecutionException(org.junit.jupiter.api.extension.ExtensionContext context, java.lang.Throwable throwable) throws java.lang.Throwable
- Specified by:
handleTestExecutionException
in interfaceorg.junit.jupiter.api.extension.TestExecutionExceptionHandler
- Throws:
java.lang.Throwable
-
-