Package org.hibernate.testing.orm.junit
Class DomainModelExtension
java.lang.Object
org.hibernate.testing.orm.junit.DomainModelExtension
- 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
,org.junit.jupiter.api.extension.TestInstantiationAwareExtension
public class DomainModelExtension
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 see
DomainModelScopeAware
)- See Also:
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface org.junit.jupiter.api.extension.TestInstantiationAwareExtension
org.junit.jupiter.api.extension.TestInstantiationAwareExtension.ExtensionContextScope
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected static void
applyCacheSettings
(org.hibernate.boot.Metadata metadata, boolean overrideCacheStrategy, String cacheConcurrencyStrategy) void
beforeEach
(org.junit.jupiter.api.extension.ExtensionContext context) static DomainModelScope
findDomainModelScope
(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) static DomainModelScope
resolveForMethodLevelSessionFactoryScope
(org.junit.jupiter.api.extension.ExtensionContext context) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.junit.jupiter.api.extension.TestInstantiationAwareExtension
getTestInstantiationExtensionContextScope
-
Constructor Details
-
DomainModelExtension
public DomainModelExtension()
-
-
Method Details
-
findDomainModelScope
public static DomainModelScope findDomainModelScope(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 -
resolveForMethodLevelSessionFactoryScope
public static DomainModelScope resolveForMethodLevelSessionFactoryScope(org.junit.jupiter.api.extension.ExtensionContext context) -
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
-
applyCacheSettings
protected static void applyCacheSettings(org.hibernate.boot.Metadata metadata, boolean overrideCacheStrategy, String cacheConcurrencyStrategy)
-