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 Dialect
DIALECT
protected static java.lang.Class<?>[]
NO_CLASSES
protected static java.lang.String[]
NO_MAPPINGS
protected Session
session
static java.lang.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(Configuration configuration)
protected void
afterConfigurationBuilt(Configuration configuration)
protected void
afterSessionFactoryBuilt()
void
afterTest()
protected void
applyCacheSettings(Configuration configuration)
protected void
assertAllDataRemoved()
void
beforeTest()
protected BootstrapServiceRegistry
buildBootstrapServiceRegistry()
protected Configuration
buildConfiguration()
protected org.hibernate.boot.registry.internal.StandardServiceRegistryImpl
buildServiceRegistry(BootstrapServiceRegistry bootRegistry, Configuration configuration)
protected void
buildSessionFactory()
protected void
buildSessionFactory(java.util.function.Consumer<Configuration> configurationAdapter)
protected void
cleanupCache()
protected void
cleanupTest()
protected void
cleanupTestData()
protected Configuration
configuration()
protected void
configure(Configuration configuration)
protected Configuration
constructAndConfigureConfiguration()
protected Configuration
constructConfiguration()
protected boolean
createSchema()
protected java.lang.String
createSecondSchema()
Feature supported only by H2 dialect.protected java.lang.Class<?>[]
getAnnotatedClasses()
protected java.lang.String[]
getAnnotatedPackages()
protected java.lang.String
getBaseForMappings()
protected java.lang.String
getCacheConcurrencyStrategy()
protected static Dialect
getDialect()
protected java.lang.String[]
getMappings()
protected java.lang.String[]
getXmlFiles()
protected void
inSession(java.util.function.Consumer<SessionImplementor> action)
protected void
inTransaction(java.util.function.Consumer<SessionImplementor> action)
protected void
inTransaction(SessionImplementor session, java.util.function.Consumer<SessionImplementor> action)
protected boolean
isCleanupTestDataRequired()
protected boolean
isCleanupTestDataUsingBulkDelete()
void
onFailure()
protected Session
openSession()
protected Session
openSession(Interceptor interceptor)
protected void
prepareBasicRegistryBuilder(StandardServiceRegistryBuilder serviceRegistryBuilder)
protected void
prepareBootstrapRegistryBuilder(BootstrapServiceRegistryBuilder builder)
protected void
prepareTest()
protected boolean
readCommittedIsolationMaintained(java.lang.String scenario)
protected void
rebuildSessionFactory()
protected void
rebuildSessionFactory(java.util.function.Consumer<Configuration> configurationAdapter)
protected boolean
rebuildSessionFactoryOnError()
protected void
releaseSessionFactory()
protected org.hibernate.boot.registry.internal.StandardServiceRegistryImpl
serviceRegistry()
protected SessionFactoryImplementor
sessionFactory()
-
Methods inherited from class org.hibernate.testing.junit4.BaseUnitTestCase
assertNoLeaks, executeAsync, executeSync, releaseTransactions, sleep
-
-
-
-
Field Detail
-
VALIDATE_DATA_CLEANUP
public static final java.lang.String VALIDATE_DATA_CLEANUP
- See Also:
- Constant Field Values
-
DIALECT
public static final Dialect DIALECT
-
session
protected Session session
-
NO_MAPPINGS
protected static final java.lang.String[] NO_MAPPINGS
-
NO_CLASSES
protected static final java.lang.Class<?>[] NO_CLASSES
-
-
Method Detail
-
getDialect
protected static Dialect getDialect()
-
configuration
protected Configuration configuration()
-
serviceRegistry
protected org.hibernate.boot.registry.internal.StandardServiceRegistryImpl serviceRegistry()
-
sessionFactory
protected SessionFactoryImplementor sessionFactory()
-
openSession
protected Session openSession() throws HibernateException
- Throws:
HibernateException
-
openSession
protected Session openSession(Interceptor interceptor) throws HibernateException
- Throws:
HibernateException
-
buildSessionFactory
protected void buildSessionFactory()
-
buildSessionFactory
protected void buildSessionFactory(java.util.function.Consumer<Configuration> configurationAdapter)
-
rebuildSessionFactory
protected void rebuildSessionFactory()
-
rebuildSessionFactory
protected void rebuildSessionFactory(java.util.function.Consumer<Configuration> configurationAdapter)
-
buildConfiguration
protected Configuration buildConfiguration()
-
constructAndConfigureConfiguration
protected Configuration constructAndConfigureConfiguration()
-
constructConfiguration
protected Configuration constructConfiguration()
-
configure
protected void configure(Configuration configuration)
-
addMappings
protected void addMappings(Configuration configuration)
-
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()
-
applyCacheSettings
protected void applyCacheSettings(Configuration configuration)
-
getCacheConcurrencyStrategy
protected java.lang.String getCacheConcurrencyStrategy()
-
afterConfigurationBuilt
protected void afterConfigurationBuilt(Configuration configuration)
-
buildBootstrapServiceRegistry
protected BootstrapServiceRegistry buildBootstrapServiceRegistry()
-
prepareBootstrapRegistryBuilder
protected void prepareBootstrapRegistryBuilder(BootstrapServiceRegistryBuilder builder)
-
buildServiceRegistry
protected org.hibernate.boot.registry.internal.StandardServiceRegistryImpl buildServiceRegistry(BootstrapServiceRegistry bootRegistry, Configuration configuration)
-
prepareBasicRegistryBuilder
protected void prepareBasicRegistryBuilder(StandardServiceRegistryBuilder serviceRegistryBuilder)
-
afterSessionFactoryBuilt
protected void afterSessionFactoryBuilt()
-
createSchema
protected boolean createSchema()
-
createSecondSchema
protected java.lang.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()
-
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
-
cleanupCache
protected void cleanupCache()
-
isCleanupTestDataRequired
protected boolean isCleanupTestDataRequired()
-
isCleanupTestDataUsingBulkDelete
protected boolean isCleanupTestDataUsingBulkDelete()
-
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()
-
readCommittedIsolationMaintained
protected boolean readCommittedIsolationMaintained(java.lang.String scenario)
-
inTransaction
protected void inTransaction(java.util.function.Consumer<SessionImplementor> action)
-
inTransaction
protected void inTransaction(SessionImplementor session, java.util.function.Consumer<SessionImplementor> action)
-
inSession
protected void inSession(java.util.function.Consumer<SessionImplementor> action)
-
-