Class 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 Detail

      • VALIDATE_DATA_CLEANUP

        public static final java.lang.String VALIDATE_DATA_CLEANUP
        See Also:
        Constant Field Values
      • NO_MAPPINGS

        protected static final java.lang.String[] NO_MAPPINGS
      • NO_CLASSES

        protected static final java.lang.Class[] NO_CLASSES
    • Constructor Detail

      • BaseNonConfigCoreFunctionalTestCase

        public BaseNonConfigCoreFunctionalTestCase()
    • Method Detail

      • getDialect

        protected Dialect getDialect()
      • getSession

        protected Session getSession()
      • rebuildSessionFactory

        protected void rebuildSessionFactory()
      • cleanupCache

        protected void cleanupCache()
      • startUp

        protected void startUp()
      • buildResources

        protected void buildResources()
      • addSettings

        protected void addSettings​(java.util.Map settings)
      • configureBootstrapServiceRegistryBuilder

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

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

        protected boolean createSchema()
      • createSecondSchema

        protected java.lang.String createSecondSchema()
      • configureStandardServiceRegistryBuilder

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

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

        protected void applyMetadataSources​(MetadataSources sources)
      • getMappings

        protected java.lang.String[] getMappings()
      • getBaseForMappings

        protected java.lang.String getBaseForMappings()
      • getAnnotatedClasses

        protected java.lang.Class[] getAnnotatedClasses()
      • getAnnotatedPackages

        protected java.lang.String[] getAnnotatedPackages()
      • getXmlFiles

        protected java.lang.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 java.lang.String getCacheConcurrencyStrategy()
      • applyCacheSettings

        protected final void applyCacheSettings​(Metadata metadata)
      • afterMetadataBuilt

        protected void afterMetadataBuilt​(Metadata metadata)
      • configureSessionFactoryBuilder

        protected void configureSessionFactoryBuilder​(SessionFactoryBuilder sfb)
      • shutDown

        protected void shutDown()
      • releaseResources

        protected void releaseResources()
      • onFailure

        public void onFailure()
      • rebuildSessionFactoryOnError

        protected boolean rebuildSessionFactoryOnError()
      • beforeTest

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

        protected void prepareTest()
                            throws java.lang.Exception
        Throws:
        java.lang.Exception
      • afterTest

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

        protected boolean isCleanupTestDataRequired()
      • cleanupTestData

        protected void cleanupTestData()
                                throws java.lang.Exception
        Throws:
        java.lang.Exception
      • cleanupTest

        protected void cleanupTest()
                            throws java.lang.Exception
        Throws:
        java.lang.Exception
      • assertAllDataRemoved

        protected void assertAllDataRemoved()
      • inSession

        public void inSession​(java.util.function.Consumer<SessionImplementor> action)
      • inStatelessSession

        public void inStatelessSession​(java.util.function.Consumer<StatelessSession> action)
      • fromSession

        public <R> R fromSession​(java.util.function.Function<SessionImplementor,​R> action)
      • inTransaction

        public void inTransaction​(java.util.function.Consumer<SessionImplementor> action)
      • inStatelessTransaction

        public void inStatelessTransaction​(java.util.function.Consumer<StatelessSession> action)
      • fromTransaction

        public <R> R fromTransaction​(java.util.function.Function<SessionImplementor,​R> action)