Package org.hibernate.testing.junit4
Class BaseCoreFunctionalTestCase
- java.lang.Object
-
- org.hibernate.testing.junit4.BaseUnitTestCase
-
- org.hibernate.testing.junit4.BaseCoreFunctionalTestCase
-
public abstract class BaseCoreFunctionalTestCase extends BaseUnitTestCase
Applies functional testing logic for core Hibernate testing on top ofBaseUnitTestCase
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
BaseCoreFunctionalTestCase.RollbackWork
-
Field Summary
Fields Modifier and Type Field Description static org.hibernate.dialect.Dialect
DIALECT
protected static Class<?>[]
NO_CLASSES
protected static String[]
NO_MAPPINGS
protected org.hibernate.Session
session
static String
VALIDATE_DATA_CLEANUP
-
Fields inherited from class org.hibernate.testing.junit4.BaseUnitTestCase
executorService, globalTimeout, log
-
-
Constructor Summary
Constructors Constructor Description BaseCoreFunctionalTestCase()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
addMappings(org.hibernate.cfg.Configuration configuration)
protected void
afterConfigurationBuilt(org.hibernate.cfg.Configuration configuration)
protected void
afterSessionFactoryBuilt()
void
afterTest()
protected void
applyCacheSettings(org.hibernate.cfg.Configuration configuration)
protected void
assertAllDataRemoved()
void
beforeTest()
protected org.hibernate.boot.registry.BootstrapServiceRegistry
buildBootstrapServiceRegistry()
protected org.hibernate.cfg.Configuration
buildConfiguration()
protected org.hibernate.boot.registry.internal.StandardServiceRegistryImpl
buildServiceRegistry(org.hibernate.boot.registry.BootstrapServiceRegistry bootRegistry, org.hibernate.cfg.Configuration configuration)
protected void
buildSessionFactory()
protected void
buildSessionFactory(Consumer<org.hibernate.cfg.Configuration> configurationAdapter)
protected void
cleanupCache()
protected void
cleanupTest()
protected void
cleanupTestData()
protected org.hibernate.cfg.Configuration
configuration()
protected void
configure(org.hibernate.cfg.Configuration configuration)
protected org.hibernate.cfg.Configuration
constructAndConfigureConfiguration()
protected org.hibernate.cfg.Configuration
constructConfiguration()
protected boolean
createSchema()
protected String
createSecondSchema()
Feature supported only by H2 dialect.protected Class<?>[]
getAnnotatedClasses()
protected String[]
getAnnotatedPackages()
protected String
getBaseForMappings()
protected String
getCacheConcurrencyStrategy()
protected static org.hibernate.dialect.Dialect
getDialect()
protected String[]
getMappings()
protected String[]
getXmlFiles()
protected void
inSession(Consumer<org.hibernate.engine.spi.SessionImplementor> action)
protected void
inTransaction(Consumer<org.hibernate.engine.spi.SessionImplementor> action)
protected void
inTransaction(org.hibernate.engine.spi.SessionImplementor session, Consumer<org.hibernate.engine.spi.SessionImplementor> action)
protected boolean
isCleanupTestDataRequired()
protected boolean
isCleanupTestDataUsingBulkDelete()
void
onFailure()
protected org.hibernate.Session
openSession()
protected org.hibernate.Session
openSession(org.hibernate.Interceptor interceptor)
protected void
prepareBasicRegistryBuilder(org.hibernate.boot.registry.StandardServiceRegistryBuilder serviceRegistryBuilder)
protected void
prepareBootstrapRegistryBuilder(org.hibernate.boot.registry.BootstrapServiceRegistryBuilder builder)
protected void
prepareTest()
protected boolean
readCommittedIsolationMaintained(String scenario)
protected void
rebuildSessionFactory()
protected void
rebuildSessionFactory(Consumer<org.hibernate.cfg.Configuration> configurationAdapter)
protected boolean
rebuildSessionFactoryOnError()
protected void
releaseSessionFactory()
protected org.hibernate.boot.registry.internal.StandardServiceRegistryImpl
serviceRegistry()
protected org.hibernate.engine.spi.SessionFactoryImplementor
sessionFactory()
-
Methods inherited from class org.hibernate.testing.junit4.BaseUnitTestCase
assertNoLeaks, executeAsync, executeSync, releaseTransactions, sleep
-
-
-
-
Field Detail
-
VALIDATE_DATA_CLEANUP
public static final String VALIDATE_DATA_CLEANUP
- See Also:
- Constant Field Values
-
DIALECT
public static final org.hibernate.dialect.Dialect DIALECT
-
session
protected org.hibernate.Session session
-
NO_MAPPINGS
protected static final String[] NO_MAPPINGS
-
NO_CLASSES
protected static final Class<?>[] NO_CLASSES
-
-
Method Detail
-
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
protected void buildSessionFactory(Consumer<org.hibernate.cfg.Configuration> configurationAdapter)
-
rebuildSessionFactory
protected void rebuildSessionFactory()
-
rebuildSessionFactory
protected void rebuildSessionFactory(Consumer<org.hibernate.cfg.Configuration> configurationAdapter)
-
buildConfiguration
protected org.hibernate.cfg.Configuration buildConfiguration()
-
constructAndConfigureConfiguration
protected org.hibernate.cfg.Configuration constructAndConfigureConfiguration()
-
constructConfiguration
protected org.hibernate.cfg.Configuration constructConfiguration()
-
configure
protected void configure(org.hibernate.cfg.Configuration configuration)
-
addMappings
protected void addMappings(org.hibernate.cfg.Configuration configuration)
-
getMappings
protected String[] getMappings()
-
getBaseForMappings
protected String getBaseForMappings()
-
getAnnotatedClasses
protected Class<?>[] getAnnotatedClasses()
-
getAnnotatedPackages
protected String[] getAnnotatedPackages()
-
getXmlFiles
protected String[] getXmlFiles()
-
applyCacheSettings
protected void applyCacheSettings(org.hibernate.cfg.Configuration configuration)
-
getCacheConcurrencyStrategy
protected String 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
protected String 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()
-
cleanupCache
protected void cleanupCache()
-
isCleanupTestDataRequired
protected boolean isCleanupTestDataRequired()
-
isCleanupTestDataUsingBulkDelete
protected boolean isCleanupTestDataUsingBulkDelete()
-
assertAllDataRemoved
protected void assertAllDataRemoved()
-
readCommittedIsolationMaintained
protected boolean readCommittedIsolationMaintained(String scenario)
-
inTransaction
protected void inTransaction(Consumer<org.hibernate.engine.spi.SessionImplementor> action)
-
inTransaction
protected void inTransaction(org.hibernate.engine.spi.SessionImplementor session, Consumer<org.hibernate.engine.spi.SessionImplementor> action)
-
inSession
protected void inSession(Consumer<org.hibernate.engine.spi.SessionImplementor> action)
-
-