Package org.hibernate.testing.junit4
Class BaseNonConfigCoreFunctionalTestCase
java.lang.Object
org.hibernate.testing.junit4.BaseUnitTestCase
org.hibernate.testing.junit4.BaseNonConfigCoreFunctionalTestCase
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.-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final Class[]protected static final String[]static final StringFields inherited from class org.hibernate.testing.junit4.BaseUnitTestCase
executorService, globalTimeout, log -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddSettings(Map<String, Object> settings) protected voidafterBootstrapServiceRegistryBuilt(org.hibernate.boot.registry.BootstrapServiceRegistry bsr) Hook to allow tests to use the BootstrapServiceRegistry if they wishprotected voidafterMetadataBuilt(org.hibernate.boot.Metadata metadata) protected voidafterMetadataSourcesApplied(org.hibernate.boot.MetadataSources metadataSources) protected voidafterSessionFactoryBuilt(org.hibernate.engine.spi.SessionFactoryImplementor sessionFactory) protected voidafterStandardServiceRegistryBuilt(org.hibernate.boot.registry.StandardServiceRegistry ssr) Hook to allow tests to use the StandardServiceRegistry if they wishfinal voidprotected final voidapplyCacheSettings(org.hibernate.boot.Metadata metadata) protected voidapplyMetadataSources(org.hibernate.boot.MetadataSources sources) protected voidfinal voidprotected voidprotected voidprotected voidprotected voidprotected voidconfigureBootstrapServiceRegistryBuilder(org.hibernate.boot.registry.BootstrapServiceRegistryBuilder bsrb) Apply any desired config to the BootstrapServiceRegistryBuilder to be incorporated into the built BootstrapServiceRegistryprotected voidconfigureMetadataBuilder(org.hibernate.boot.MetadataBuilder metadataBuilder) protected voidconfigureSessionFactoryBuilder(org.hibernate.boot.SessionFactoryBuilder sfb) protected voidconfigureStandardServiceRegistryBuilder(org.hibernate.boot.registry.StandardServiceRegistryBuilder ssrb) Apply any desired config to the StandardServiceRegistryBuilder to be incorporated into the built StandardServiceRegistryprotected final org.hibernate.boot.registry.StandardServiceRegistryBuilderprotected booleanprotected String<R> RfromSession(Function<org.hibernate.engine.spi.SessionImplementor, R> action) <R> RfromTransaction(Function<org.hibernate.engine.spi.SessionImplementor, R> action) protected Class[]protected String[]protected Stringprotected Stringprotected org.hibernate.dialect.Dialectprotected String[]protected org.hibernate.Sessionprotected String[]protected voidinitialize(org.hibernate.boot.MetadataBuilder metadataBuilder) voidvoidinStatelessSession(Consumer<org.hibernate.StatelessSession> action) voidinStatelessTransaction(Consumer<org.hibernate.StatelessSession> action) voidinTransaction(Consumer<org.hibernate.engine.spi.SessionImplementor> action) protected booleanprotected org.hibernate.boot.spi.MetadataImplementormetadata()voidprotected org.hibernate.Sessionprotected org.hibernate.SessionopenSession(org.hibernate.Interceptor interceptor) protected booleanprotected voidprotected voidprotected booleanprotected voidprotected org.hibernate.boot.registry.StandardServiceRegistryprotected org.hibernate.engine.spi.SessionFactoryImplementorprotected voidshutDown()protected voidstartUp()Methods inherited from class org.hibernate.testing.junit4.BaseUnitTestCase
assertNoLeaks, executeAsync, executeSync, releaseTransactions, sleep
-
Field Details
-
VALIDATE_DATA_CLEANUP
- See Also:
-
NO_MAPPINGS
-
NO_CLASSES
-
-
Constructor Details
-
BaseNonConfigCoreFunctionalTestCase
public BaseNonConfigCoreFunctionalTestCase()
-
-
Method Details
-
getDialect
protected org.hibernate.dialect.Dialect getDialect() -
serviceRegistry
protected org.hibernate.boot.registry.StandardServiceRegistry serviceRegistry() -
metadata
protected org.hibernate.boot.spi.MetadataImplementor metadata() -
sessionFactory
protected org.hibernate.engine.spi.SessionFactoryImplementor sessionFactory() -
openSession
protected org.hibernate.Session openSession() throws org.hibernate.HibernateException- Throws:
org.hibernate.HibernateException
-
openSession
protected org.hibernate.Session openSession(org.hibernate.Interceptor interceptor) throws org.hibernate.HibernateException - Throws:
org.hibernate.HibernateException
-
getSession
protected org.hibernate.Session getSession() -
rebuildSessionFactory
protected void rebuildSessionFactory() -
cleanupCache
protected void cleanupCache() -
startUp
protected void startUp() -
buildResources
protected void buildResources() -
constructStandardServiceRegistryBuilder
protected final org.hibernate.boot.registry.StandardServiceRegistryBuilder constructStandardServiceRegistryBuilder() -
addSettings
-
configureBootstrapServiceRegistryBuilder
protected void configureBootstrapServiceRegistryBuilder(org.hibernate.boot.registry.BootstrapServiceRegistryBuilder bsrb) Apply any desired config to the BootstrapServiceRegistryBuilder to be incorporated into the built BootstrapServiceRegistry- Parameters:
bsrb- The BootstrapServiceRegistryBuilder
-
afterBootstrapServiceRegistryBuilt
protected void afterBootstrapServiceRegistryBuilt(org.hibernate.boot.registry.BootstrapServiceRegistry bsr) Hook to allow tests to use the BootstrapServiceRegistry if they wish- Parameters:
bsr- The BootstrapServiceRegistry
-
createSchema
protected boolean createSchema() -
createSecondSchema
-
configureStandardServiceRegistryBuilder
protected void configureStandardServiceRegistryBuilder(org.hibernate.boot.registry.StandardServiceRegistryBuilder ssrb) Apply any desired config to the StandardServiceRegistryBuilder to be incorporated into the built StandardServiceRegistry- Parameters:
ssrb- The StandardServiceRegistryBuilder
-
afterStandardServiceRegistryBuilt
protected void afterStandardServiceRegistryBuilt(org.hibernate.boot.registry.StandardServiceRegistry ssr) Hook to allow tests to use the StandardServiceRegistry if they wish- Parameters:
ssr- The StandardServiceRegistry
-
applyMetadataSources
protected void applyMetadataSources(org.hibernate.boot.MetadataSources sources) -
getMappings
-
getBaseForMappings
-
getAnnotatedClasses
-
getAnnotatedPackages
-
getXmlFiles
-
afterMetadataSourcesApplied
protected void afterMetadataSourcesApplied(org.hibernate.boot.MetadataSources metadataSources) -
initialize
protected void initialize(org.hibernate.boot.MetadataBuilder metadataBuilder) -
configureMetadataBuilder
protected void configureMetadataBuilder(org.hibernate.boot.MetadataBuilder metadataBuilder) -
overrideCacheStrategy
protected boolean overrideCacheStrategy() -
getCacheConcurrencyStrategy
-
applyCacheSettings
protected final void applyCacheSettings(org.hibernate.boot.Metadata metadata) -
afterMetadataBuilt
protected void afterMetadataBuilt(org.hibernate.boot.Metadata metadata) -
configureSessionFactoryBuilder
protected void configureSessionFactoryBuilder(org.hibernate.boot.SessionFactoryBuilder sfb) -
afterSessionFactoryBuilt
protected void afterSessionFactoryBuilt(org.hibernate.engine.spi.SessionFactoryImplementor sessionFactory) -
shutDown
protected void shutDown() -
releaseResources
protected void releaseResources() -
onFailure
public void onFailure() -
rebuildSessionFactoryOnError
protected boolean rebuildSessionFactoryOnError() -
beforeTest
- Throws:
Exception
-
prepareTest
- Throws:
Exception
-
afterTest
- Throws:
Exception
-
isCleanupTestDataRequired
protected boolean isCleanupTestDataRequired() -
cleanupTestData
- Throws:
Exception
-
cleanupTest
- Throws:
Exception
-
assertAllDataRemoved
protected void assertAllDataRemoved() -
inSession
-
inStatelessSession
-
fromSession
-
inTransaction
-
inStatelessTransaction
-
fromTransaction
-