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 voidapplyCacheSettings(org.hibernate.boot.Metadata metadata, boolean overrideCacheStrategy, String cacheConcurrencyStrategy) voidbeforeEach(org.junit.jupiter.api.extension.ExtensionContext context) static DomainModelScopefindDomainModelScope(Object testInstance, org.junit.jupiter.api.extension.ExtensionContext context) Intended for use from external consumers.static DomainModelScopegetOrCreateDomainModelScope(Object testInstance, org.junit.jupiter.api.extension.ExtensionContext context) voidhandleTestExecutionException(org.junit.jupiter.api.extension.ExtensionContext context, Throwable throwable) voidpostProcessTestInstance(Object testInstance, org.junit.jupiter.api.extension.ExtensionContext context) static DomainModelScoperequireDomainModelScope(Object testInstance, org.junit.jupiter.api.extension.ExtensionContext context) static DomainModelScoperesolveForMethodLevelSessionFactoryScope(org.junit.jupiter.api.extension.ExtensionContext context) Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.junit.jupiter.api.extension.TestInstantiationAwareExtension
getTestInstantiationExtensionContextScope
-
Constructor Details
-
DomainModelExtension
public DomainModelExtension()
-
-
Method Details
-
requireDomainModelScope
public static DomainModelScope requireDomainModelScope(Object testInstance, org.junit.jupiter.api.extension.ExtensionContext context) -
getOrCreateDomainModelScope
public static DomainModelScope getOrCreateDomainModelScope(Object testInstance, org.junit.jupiter.api.extension.ExtensionContext context) -
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:
postProcessTestInstancein interfaceorg.junit.jupiter.api.extension.TestInstancePostProcessor
-
beforeEach
public void beforeEach(org.junit.jupiter.api.extension.ExtensionContext context) - Specified by:
beforeEachin interfaceorg.junit.jupiter.api.extension.BeforeEachCallback
-
handleTestExecutionException
-
applyCacheSettings
protected static void applyCacheSettings(org.hibernate.boot.Metadata metadata, boolean overrideCacheStrategy, String cacheConcurrencyStrategy)
-