Class BaseNonConfigCoreFunctionalTestCase

java.lang.Object
org.hibernate.testing.junit4.BaseUnitTestCase
org.hibernate.testing.junit4.BaseNonConfigCoreFunctionalTestCase

public class BaseNonConfigCoreFunctionalTestCase extends BaseUnitTestCase
Applies functional testing logic for core Hibernate testing on top of BaseUnitTestCase. Much like BaseCoreFunctionalTestCase, except that this form uses the new bootstrapping APIs while BaseCoreFunctionalTestCase continues to use (the neutered form of) Configuration.
  • Field Details

    • VALIDATE_DATA_CLEANUP

      public static final String VALIDATE_DATA_CLEANUP
      See Also:
    • NO_MAPPINGS

      protected static final String[] NO_MAPPINGS
    • NO_CLASSES

      protected static final Class<?>[] NO_CLASSES
  • Constructor Details

    • BaseNonConfigCoreFunctionalTestCase

      public BaseNonConfigCoreFunctionalTestCase()
  • Method Details

    • getDialect

      protected Dialect getDialect()
    • serviceRegistry

      protected StandardServiceRegistry serviceRegistry()
    • metadata

      protected MetadataImplementor metadata()
    • sessionFactory

      protected SessionFactoryImplementor sessionFactory()
    • openSession

      protected Session openSession() throws HibernateException
      Throws:
      HibernateException
    • openSession

      protected Session openSession(Interceptor interceptor) throws HibernateException
      Throws:
      HibernateException
    • getSession

      protected Session getSession()
    • rebuildSessionFactory

      protected void rebuildSessionFactory()
    • cleanupCache

      protected void cleanupCache()
    • startUp

      protected void startUp()
    • buildResources

      protected void buildResources()
    • constructStandardServiceRegistryBuilder

      protected final StandardServiceRegistryBuilder constructStandardServiceRegistryBuilder()
    • addSettings

      protected void addSettings(Map<String,Object> settings)
    • configureBootstrapServiceRegistryBuilder

      protected void configureBootstrapServiceRegistryBuilder(BootstrapServiceRegistryBuilder registryBuilder)
      Apply any desired config to the BootstrapServiceRegistryBuilder to be incorporated into the built BootstrapServiceRegistry
      Parameters:
      registryBuilder - The BootstrapServiceRegistryBuilder
    • afterBootstrapServiceRegistryBuilt

      protected void afterBootstrapServiceRegistryBuilt(BootstrapServiceRegistry bootstrapServiceRegistry)
      Hook to allow tests to use the BootstrapServiceRegistry if they wish
      Parameters:
      bootstrapServiceRegistry - The BootstrapServiceRegistry
    • createSchema

      protected boolean createSchema()
    • createSecondSchema

      protected String createSecondSchema()
    • configureStandardServiceRegistryBuilder

      protected void configureStandardServiceRegistryBuilder(StandardServiceRegistryBuilder serviceRegistryBuilder)
      Apply any desired config to the StandardServiceRegistryBuilder to be incorporated into the built StandardServiceRegistry
      Parameters:
      serviceRegistryBuilder - The StandardServiceRegistryBuilder
    • afterStandardServiceRegistryBuilt

      protected void afterStandardServiceRegistryBuilt(StandardServiceRegistry standardServiceRegistry)
      Hook to allow tests to use the StandardServiceRegistry if they wish
      Parameters:
      standardServiceRegistry - The StandardServiceRegistry
    • applyMetadataSources

      protected void applyMetadataSources(MetadataSources sources)
    • getMappings

      protected String[] getMappings()
    • getBaseForMappings

      protected String getBaseForMappings()
    • getAnnotatedClasses

      protected Class<?>[] getAnnotatedClasses()
    • getAnnotatedPackages

      protected String[] getAnnotatedPackages()
    • getXmlFiles

      protected String[] getXmlFiles()
    • afterMetadataSourcesApplied

      protected void afterMetadataSourcesApplied(MetadataSources metadataSources)
    • initialize

      protected void initialize(MetadataBuilder metadataBuilder)
    • configureMetadataBuilder

      protected void configureMetadataBuilder(MetadataBuilder metadataBuilder)
    • overrideCacheStrategy

      protected boolean overrideCacheStrategy()
    • getCacheConcurrencyStrategy

      protected String getCacheConcurrencyStrategy()
    • applyCacheSettings

      protected final void applyCacheSettings(Metadata metadata)
    • afterMetadataBuilt

      protected void afterMetadataBuilt(Metadata metadata)
    • configureSessionFactoryBuilder

      protected void configureSessionFactoryBuilder(SessionFactoryBuilder sfb)
    • afterSessionFactoryBuilt

      protected void afterSessionFactoryBuilt(SessionFactoryImplementor sessionFactory)
    • shutDown

      protected void shutDown()
    • releaseResources

      protected void releaseResources()
    • onFailure

      public void onFailure()
    • rebuildSessionFactoryOnError

      protected boolean rebuildSessionFactoryOnError()
    • beforeTest

      public final void beforeTest() throws Exception
      Throws:
      Exception
    • prepareTest

      protected void prepareTest() throws Exception
      Throws:
      Exception
    • afterTest

      public final void afterTest() throws Exception
      Throws:
      Exception
    • isCleanupTestDataRequired

      protected boolean isCleanupTestDataRequired()
    • cleanupTestData

      protected void cleanupTestData() throws Exception
      Throws:
      Exception
    • cleanupTest

      protected void cleanupTest() throws Exception
      Throws:
      Exception
    • assertAllDataRemoved

      protected void assertAllDataRemoved()
    • inSession

      public void inSession(Consumer<SessionImplementor> action)
    • inStatelessSession

      public void inStatelessSession(Consumer<StatelessSession> action)
    • fromSession

      public <R> R fromSession(Function<SessionImplementor,R> action)
    • inTransaction

      public void inTransaction(Consumer<SessionImplementor> action)
    • inStatelessTransaction

      public void inStatelessTransaction(Consumer<StatelessSession> action)
    • fromTransaction

      public <R> R fromTransaction(Function<SessionImplementor,R> action)