Package org.hibernate.testing.junit4
Class BaseCoreFunctionalTestCase
java.lang.Object
org.hibernate.testing.junit4.BaseUnitTestCase
org.hibernate.testing.junit4.BaseCoreFunctionalTestCase
Applies functional testing logic for core Hibernate testing on top of
BaseUnitTestCase-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final org.hibernate.dialect.Dialectprotected static final Class<?>[]protected static final String[]protected org.hibernate.Sessionstatic final StringFields inherited from class org.hibernate.testing.junit4.BaseUnitTestCase
executorService, globalTimeout, log -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddMappings(org.hibernate.cfg.Configuration configuration) protected voidafterConfigurationBuilt(org.hibernate.cfg.Configuration configuration) protected voidfinal voidprotected voidapplyCacheSettings(org.hibernate.cfg.Configuration configuration) protected voidfinal voidprotected org.hibernate.boot.registry.BootstrapServiceRegistryprotected org.hibernate.boot.registry.internal.StandardServiceRegistryImplbuildServiceRegistry(org.hibernate.boot.registry.BootstrapServiceRegistry bootRegistry, org.hibernate.cfg.Configuration configuration) protected voidprotected voidbuildSessionFactory(Consumer<org.hibernate.cfg.Configuration> configurationAdapter) protected voidprotected voidprotected voidprotected org.hibernate.cfg.Configurationprotected voidconfigure(org.hibernate.cfg.Configuration configuration) protected org.hibernate.cfg.ConfigurationconstructAndConfigureConfiguration(org.hibernate.boot.registry.BootstrapServiceRegistry bootstrapServiceRegistry) protected org.hibernate.cfg.ConfigurationconstructConfiguration(org.hibernate.boot.registry.BootstrapServiceRegistry bootstrapServiceRegistry) protected booleanprotected StringFeature supported only by H2 dialect.protected <T> TfromTransaction(Function<org.hibernate.engine.spi.SessionImplementor, T> action) protected Class<?>[]protected String[]protected Stringprotected Stringprotected static org.hibernate.dialect.Dialectprotected String[]protected String[]protected voidprotected voidinStatelessSession(Consumer<org.hibernate.StatelessSession> action) protected voidinTransaction(Consumer<org.hibernate.engine.spi.SessionImplementor> action) protected voidinTransaction(org.hibernate.engine.spi.SessionImplementor session, Consumer<org.hibernate.engine.spi.SessionImplementor> action) protected booleanprotected booleanvoidprotected org.hibernate.Sessionprotected org.hibernate.SessionopenSession(org.hibernate.Interceptor interceptor) protected voidprepareBasicRegistryBuilder(org.hibernate.boot.registry.StandardServiceRegistryBuilder serviceRegistryBuilder) protected voidprepareBootstrapRegistryBuilder(org.hibernate.boot.registry.BootstrapServiceRegistryBuilder builder) protected voidprotected booleanreadCommittedIsolationMaintained(String scenario) protected voidprotected voidrebuildSessionFactory(Consumer<org.hibernate.cfg.Configuration> configurationAdapter) protected booleanprotected voidprotected org.hibernate.boot.registry.internal.StandardServiceRegistryImplprotected org.hibernate.engine.spi.SessionFactoryImplementorMethods inherited from class org.hibernate.testing.junit4.BaseUnitTestCase
assertNoLeaks, executeAsync, executeSync, releaseTransactions, sleep
-
Field Details
-
VALIDATE_DATA_CLEANUP
- See Also:
-
DIALECT
public static final org.hibernate.dialect.Dialect DIALECT -
session
protected org.hibernate.Session session -
NO_MAPPINGS
-
NO_CLASSES
-
-
Constructor Details
-
BaseCoreFunctionalTestCase
public BaseCoreFunctionalTestCase()
-
-
Method Details
-
getDialect
protected static org.hibernate.dialect.Dialect getDialect() -
configuration
protected org.hibernate.cfg.Configuration configuration() -
serviceRegistry
protected org.hibernate.boot.registry.internal.StandardServiceRegistryImpl serviceRegistry() -
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
-
buildSessionFactory
protected void buildSessionFactory() -
buildSessionFactory
-
rebuildSessionFactory
protected void rebuildSessionFactory() -
rebuildSessionFactory
protected void rebuildSessionFactory(Consumer<org.hibernate.cfg.Configuration> configurationAdapter) -
constructAndConfigureConfiguration
protected org.hibernate.cfg.Configuration constructAndConfigureConfiguration(org.hibernate.boot.registry.BootstrapServiceRegistry bootstrapServiceRegistry) -
constructConfiguration
protected org.hibernate.cfg.Configuration constructConfiguration(org.hibernate.boot.registry.BootstrapServiceRegistry bootstrapServiceRegistry) -
configure
protected void configure(org.hibernate.cfg.Configuration configuration) -
addMappings
protected void addMappings(org.hibernate.cfg.Configuration configuration) -
getMappings
-
getBaseForMappings
-
getAnnotatedClasses
-
getAnnotatedPackages
-
getOrmXmlFiles
-
applyCacheSettings
protected void applyCacheSettings(org.hibernate.cfg.Configuration configuration) -
getCacheConcurrencyStrategy
-
afterConfigurationBuilt
protected void afterConfigurationBuilt(org.hibernate.cfg.Configuration configuration) -
buildBootstrapServiceRegistry
protected org.hibernate.boot.registry.BootstrapServiceRegistry buildBootstrapServiceRegistry() -
prepareBootstrapRegistryBuilder
protected void prepareBootstrapRegistryBuilder(org.hibernate.boot.registry.BootstrapServiceRegistryBuilder builder) -
buildServiceRegistry
protected org.hibernate.boot.registry.internal.StandardServiceRegistryImpl buildServiceRegistry(org.hibernate.boot.registry.BootstrapServiceRegistry bootRegistry, org.hibernate.cfg.Configuration configuration) -
prepareBasicRegistryBuilder
protected void prepareBasicRegistryBuilder(org.hibernate.boot.registry.StandardServiceRegistryBuilder serviceRegistryBuilder) -
afterSessionFactoryBuilt
protected void afterSessionFactoryBuilt() -
createSchema
protected boolean createSchema() -
createSecondSchema
Feature supported only by H2 dialect.- Returns:
- Provide not empty name to create second schema.
-
rebuildSessionFactoryOnError
protected boolean rebuildSessionFactoryOnError() -
releaseSessionFactory
protected void releaseSessionFactory() -
onFailure
public void onFailure() -
beforeTest
- Throws:
Exception
-
prepareTest
- Throws:
Exception
-
afterTest
- Throws:
Exception
-
cleanupCache
protected void cleanupCache() -
isCleanupTestDataRequired
protected boolean isCleanupTestDataRequired() -
isCleanupTestDataUsingBulkDelete
protected boolean isCleanupTestDataUsingBulkDelete() -
cleanupTestData
- Throws:
Exception
-
cleanupTest
- Throws:
Exception
-
assertAllDataRemoved
protected void assertAllDataRemoved() -
readCommittedIsolationMaintained
-
inTransaction
-
fromTransaction
-
inTransaction
protected void inTransaction(org.hibernate.engine.spi.SessionImplementor session, Consumer<org.hibernate.engine.spi.SessionImplementor> action) -
inSession
-
inStatelessSession
-