Package org.hibernate.testing.orm.junit
Class SessionFactoryExtension
- java.lang.Object
-
- org.hibernate.testing.orm.junit.SessionFactoryExtension
-
- All Implemented Interfaces:
org.junit.jupiter.api.extension.BeforeEachCallback
,org.junit.jupiter.api.extension.Extension
,org.junit.jupiter.api.extension.TestExecutionExceptionHandler
,org.junit.jupiter.api.extension.TestInstancePostProcessor
public class SessionFactoryExtension extends Object implements org.junit.jupiter.api.extension.TestInstancePostProcessor, org.junit.jupiter.api.extension.BeforeEachCallback, org.junit.jupiter.api.extension.TestExecutionExceptionHandler
hibernate-testing implementation of a few JUnit5 contracts to support SessionFactory-based testing, including argument injection (or seeSessionFactoryScopeAware
)- See Also:
SessionFactoryScope
,DomainModelExtension
-
-
Constructor Summary
Constructors Constructor Description SessionFactoryExtension()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
beforeEach(org.junit.jupiter.api.extension.ExtensionContext context)
static SessionFactoryScope
findSessionFactoryScope(Object testInstance, org.junit.jupiter.api.extension.ExtensionContext context)
Intended for use from external consumers.void
handleTestExecutionException(org.junit.jupiter.api.extension.ExtensionContext context, Throwable throwable)
void
postProcessTestInstance(Object testInstance, org.junit.jupiter.api.extension.ExtensionContext context)
-
-
-
Method Detail
-
findSessionFactoryScope
public static SessionFactoryScope findSessionFactoryScope(Object testInstance, org.junit.jupiter.api.extension.ExtensionContext context)
Intended for use from external consumers. Will never create a scope, just attempt to consume an already created and stored one
-
postProcessTestInstance
public void postProcessTestInstance(Object testInstance, org.junit.jupiter.api.extension.ExtensionContext context)
- Specified by:
postProcessTestInstance
in interfaceorg.junit.jupiter.api.extension.TestInstancePostProcessor
-
beforeEach
public void beforeEach(org.junit.jupiter.api.extension.ExtensionContext context)
- Specified by:
beforeEach
in interfaceorg.junit.jupiter.api.extension.BeforeEachCallback
-
handleTestExecutionException
public void handleTestExecutionException(org.junit.jupiter.api.extension.ExtensionContext context, Throwable throwable) throws Throwable
- Specified by:
handleTestExecutionException
in interfaceorg.junit.jupiter.api.extension.TestExecutionExceptionHandler
- Throws:
Throwable
-
-