Class ServiceRegistryExtension

java.lang.Object
org.hibernate.testing.orm.junit.ServiceRegistryExtension
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 ServiceRegistryExtension extends Object implements org.junit.jupiter.api.extension.TestInstancePostProcessor, org.junit.jupiter.api.extension.BeforeEachCallback, org.junit.jupiter.api.extension.TestExecutionExceptionHandler
JUnit extension used to manage the StandardServiceRegistry used by a test including creating the StandardServiceRegistry and releasing it afterwards
  • Nested Class Summary

    Nested classes/interfaces inherited from interface org.junit.jupiter.api.extension.TestInstantiationAwareExtension

    org.junit.jupiter.api.extension.TestInstantiationAwareExtension.ExtensionContextScope
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    beforeEach(org.junit.jupiter.api.extension.ExtensionContext context)
     
    findServiceRegistryScope(Object testInstance, org.junit.jupiter.api.extension.ExtensionContext context)
     
    void
    handleTestExecutionException(org.junit.jupiter.api.extension.ExtensionContext context, Throwable throwable)
     
    void
    postProcessTestInstance(Object testInstance, 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

    • ServiceRegistryExtension

      public ServiceRegistryExtension()
  • Method Details

    • postProcessTestInstance

      public void postProcessTestInstance(Object testInstance, org.junit.jupiter.api.extension.ExtensionContext context)
      Specified by:
      postProcessTestInstance in interface org.junit.jupiter.api.extension.TestInstancePostProcessor
    • beforeEach

      public void beforeEach(org.junit.jupiter.api.extension.ExtensionContext context)
      Specified by:
      beforeEach in interface org.junit.jupiter.api.extension.BeforeEachCallback
    • findServiceRegistryScope

      public static ServiceRegistryScope findServiceRegistryScope(Object testInstance, org.junit.jupiter.api.extension.ExtensionContext context)
    • handleTestExecutionException

      public void handleTestExecutionException(org.junit.jupiter.api.extension.ExtensionContext context, Throwable throwable) throws Throwable
      Specified by:
      handleTestExecutionException in interface org.junit.jupiter.api.extension.TestExecutionExceptionHandler
      Throws:
      Throwable