Package org.hibernate.testing.junit4
Class BaseNonConfigCoreFunctionalTestCase
- java.lang.Object
-
- org.hibernate.testing.junit4.BaseUnitTestCase
-
- org.hibernate.testing.junit4.BaseNonConfigCoreFunctionalTestCase
-
public class BaseNonConfigCoreFunctionalTestCase extends BaseUnitTestCase
Applies functional testing logic for core Hibernate testing on top ofBaseUnitTestCase
. Much likeBaseCoreFunctionalTestCase
, except that this form uses the new bootstrapping APIs while BaseCoreFunctionalTestCase continues to use (the neutered form of) Configuration.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
BaseNonConfigCoreFunctionalTestCase.RollbackWork
-
Field Summary
Fields Modifier and Type Field Description protected static Class[]
NO_CLASSES
protected static String[]
NO_MAPPINGS
static String
VALIDATE_DATA_CLEANUP
-
Fields inherited from class org.hibernate.testing.junit4.BaseUnitTestCase
executorService, globalTimeout, log
-
-
Constructor Summary
Constructors Constructor Description BaseNonConfigCoreFunctionalTestCase()
-
Method Summary
-
Methods inherited from class org.hibernate.testing.junit4.BaseUnitTestCase
assertNoLeaks, checkClearSchema, executeAsync, executeSync, releaseTransactions, sleep
-
-
-
-
Field Detail
-
VALIDATE_DATA_CLEANUP
public static final String VALIDATE_DATA_CLEANUP
- See Also:
- Constant Field Values
-
NO_MAPPINGS
protected static final String[] NO_MAPPINGS
-
NO_CLASSES
protected static final Class[] NO_CLASSES
-
-
Method Detail
-
getDialect
protected Dialect getDialect()
-
serviceRegistry
protected StandardServiceRegistry serviceRegistry()
-
metadata
protected MetadataImplementor metadata()
-
sessionFactory
protected SessionFactoryImplementor sessionFactory()
-
openSession
protected Session openSession() throws HibernateException
- Throws:
HibernateException
-
openSession
protected Session openSession(Interceptor interceptor) throws HibernateException
- Throws:
HibernateException
-
getSession
protected Session getSession()
-
rebuildSessionFactory
protected void rebuildSessionFactory()
-
cleanupCache
protected void cleanupCache()
-
startUp
protected void startUp()
-
buildResources
protected void buildResources()
-
constructStandardServiceRegistryBuilder
protected final StandardServiceRegistryBuilder constructStandardServiceRegistryBuilder()
-
configureBootstrapServiceRegistryBuilder
protected void configureBootstrapServiceRegistryBuilder(BootstrapServiceRegistryBuilder bsrb)
Apply any desired config to the BootstrapServiceRegistryBuilder to be incorporated into the built BootstrapServiceRegistry- Parameters:
bsrb
- The BootstrapServiceRegistryBuilder
-
afterBootstrapServiceRegistryBuilt
protected void afterBootstrapServiceRegistryBuilt(BootstrapServiceRegistry bsr)
Hook to allow tests to use the BootstrapServiceRegistry if they wish- Parameters:
bsr
- The BootstrapServiceRegistry
-
createSchema
protected boolean createSchema()
-
createSecondSchema
protected String createSecondSchema()
-
configureStandardServiceRegistryBuilder
protected void configureStandardServiceRegistryBuilder(StandardServiceRegistryBuilder ssrb)
Apply any desired config to the StandardServiceRegistryBuilder to be incorporated into the built StandardServiceRegistry- Parameters:
ssrb
- The StandardServiceRegistryBuilder
-
afterStandardServiceRegistryBuilt
protected void afterStandardServiceRegistryBuilt(StandardServiceRegistry ssr)
Hook to allow tests to use the StandardServiceRegistry if they wish- Parameters:
ssr
- The StandardServiceRegistry
-
applyMetadataSources
protected void applyMetadataSources(MetadataSources sources)
-
getMappings
protected String[] getMappings()
-
getBaseForMappings
protected String getBaseForMappings()
-
getAnnotatedClasses
protected Class[] getAnnotatedClasses()
-
getAnnotatedPackages
protected String[] getAnnotatedPackages()
-
getXmlFiles
protected String[] getXmlFiles()
-
afterMetadataSourcesApplied
protected void afterMetadataSourcesApplied(MetadataSources metadataSources)
-
initialize
protected void initialize(MetadataBuilder metadataBuilder)
-
configureMetadataBuilder
protected void configureMetadataBuilder(MetadataBuilder metadataBuilder)
-
overrideCacheStrategy
protected boolean overrideCacheStrategy()
-
getCacheConcurrencyStrategy
protected String getCacheConcurrencyStrategy()
-
applyCacheSettings
protected final void applyCacheSettings(Metadata metadata)
-
afterMetadataBuilt
protected void afterMetadataBuilt(Metadata metadata)
-
configureSessionFactoryBuilder
protected void configureSessionFactoryBuilder(SessionFactoryBuilder sfb)
-
afterSessionFactoryBuilt
protected void afterSessionFactoryBuilt(SessionFactoryImplementor sessionFactory)
-
shutDown
protected void shutDown()
-
releaseResources
protected void releaseResources()
-
onFailure
public void onFailure()
-
rebuildSessionFactoryOnError
protected boolean rebuildSessionFactoryOnError()
-
isCleanupTestDataRequired
protected boolean isCleanupTestDataRequired()
-
assertAllDataRemoved
protected void assertAllDataRemoved()
-
inSession
public void inSession(Consumer<SessionImplementor> action)
-
inStatelessSession
public void inStatelessSession(Consumer<StatelessSession> action)
-
fromSession
public <R> R fromSession(Function<SessionImplementor,R> action)
-
inTransaction
public void inTransaction(Consumer<SessionImplementor> action)
-
inStatelessTransaction
public void inStatelessTransaction(Consumer<StatelessSession> action)
-
fromTransaction
public <R> R fromTransaction(Function<SessionImplementor,R> action)
-
-