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 classBaseCoreFunctionalTestCase.RollbackWork
-
Field Summary
Fields Modifier and Type Field Description static org.hibernate.dialect.DialectDIALECTprotected static java.lang.Class<?>[]NO_CLASSESprotected static java.lang.String[]NO_MAPPINGSprotected org.hibernate.Sessionsessionstatic java.lang.StringVALIDATE_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 Deprecated Methods Modifier and Type Method Description protected voidaddMappings(org.hibernate.cfg.Configuration configuration)protected voidafterConfigurationBuilt(org.hibernate.cfg.Configuration configuration)protected voidafterSessionFactoryBuilt()voidafterTest()protected voidapplyCacheSettings(org.hibernate.cfg.Configuration configuration)protected voidassertAllDataRemoved()voidbeforeTest()protected org.hibernate.boot.registry.BootstrapServiceRegistrybuildBootstrapServiceRegistry()protected org.hibernate.boot.registry.internal.StandardServiceRegistryImplbuildServiceRegistry(org.hibernate.boot.registry.BootstrapServiceRegistry bootRegistry, org.hibernate.cfg.Configuration configuration)protected voidbuildSessionFactory()protected voidbuildSessionFactory(java.util.function.Consumer<org.hibernate.cfg.Configuration> configurationAdapter)protected voidcleanupCache()protected voidcleanupTest()protected voidcleanupTestData()protected org.hibernate.cfg.Configurationconfiguration()protected 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 booleancreateSchema()protected java.lang.StringcreateSecondSchema()Feature supported only by H2 dialect.protected java.lang.Class<?>[]getAnnotatedClasses()protected java.lang.String[]getAnnotatedPackages()protected java.lang.StringgetBaseForMappings()protected java.lang.StringgetCacheConcurrencyStrategy()protected static org.hibernate.dialect.DialectgetDialect()protected java.lang.String[]getMappings()protected java.lang.String[]getXmlFiles()Deprecated.(Since 6.0) this method will be renamed to getOrmXmlFile().protected voidinSession(java.util.function.Consumer<org.hibernate.engine.spi.SessionImplementor> action)protected voidinStatelessSession(java.util.function.Consumer<org.hibernate.StatelessSession> action)protected voidinTransaction(java.util.function.Consumer<org.hibernate.engine.spi.SessionImplementor> action)protected voidinTransaction(org.hibernate.engine.spi.SessionImplementor session, java.util.function.Consumer<org.hibernate.engine.spi.SessionImplementor> action)protected booleanisCleanupTestDataRequired()protected booleanisCleanupTestDataUsingBulkDelete()voidonFailure()protected org.hibernate.SessionopenSession()protected org.hibernate.SessionopenSession(org.hibernate.Interceptor interceptor)protected voidprepareBasicRegistryBuilder(org.hibernate.boot.registry.StandardServiceRegistryBuilder serviceRegistryBuilder)protected voidprepareBootstrapRegistryBuilder(org.hibernate.boot.registry.BootstrapServiceRegistryBuilder builder)protected voidprepareTest()protected booleanreadCommittedIsolationMaintained(java.lang.String scenario)protected voidrebuildSessionFactory()protected voidrebuildSessionFactory(java.util.function.Consumer<org.hibernate.cfg.Configuration> configurationAdapter)protected booleanrebuildSessionFactoryOnError()protected voidreleaseSessionFactory()protected org.hibernate.boot.registry.internal.StandardServiceRegistryImplserviceRegistry()protected org.hibernate.engine.spi.SessionFactoryImplementorsessionFactory()-
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 org.hibernate.dialect.Dialect DIALECT
-
session
protected org.hibernate.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 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(java.util.function.Consumer<org.hibernate.cfg.Configuration> configurationAdapter)
-
rebuildSessionFactory
protected void rebuildSessionFactory()
-
rebuildSessionFactory
protected void rebuildSessionFactory(java.util.function.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
protected java.lang.String[] getMappings()
-
getBaseForMappings
protected java.lang.String getBaseForMappings()
-
getAnnotatedClasses
protected java.lang.Class<?>[] getAnnotatedClasses()
-
getAnnotatedPackages
protected java.lang.String[] getAnnotatedPackages()
-
getXmlFiles
@Deprecated protected java.lang.String[] getXmlFiles()
Deprecated.(Since 6.0) this method will be renamed to getOrmXmlFile().
-
applyCacheSettings
protected void applyCacheSettings(org.hibernate.cfg.Configuration configuration)
-
getCacheConcurrencyStrategy
protected java.lang.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 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<org.hibernate.engine.spi.SessionImplementor> action)
-
inTransaction
protected void inTransaction(org.hibernate.engine.spi.SessionImplementor session, java.util.function.Consumer<org.hibernate.engine.spi.SessionImplementor> action)
-
inSession
protected void inSession(java.util.function.Consumer<org.hibernate.engine.spi.SessionImplementor> action)
-
inStatelessSession
protected void inStatelessSession(java.util.function.Consumer<org.hibernate.StatelessSession> action)
-
-