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 classBaseNonConfigCoreFunctionalTestCase.RollbackWork
-
Field Summary
Fields Modifier and Type Field Description protected static Class[]NO_CLASSESprotected static String[]NO_MAPPINGSstatic StringVALIDATE_DATA_CLEANUP-
Fields inherited from class org.hibernate.testing.junit4.BaseUnitTestCase
executorService, globalTimeout, log
-
-
Constructor Summary
Constructors Constructor Description BaseNonConfigCoreFunctionalTestCase()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddSettings(Map settings)protected voidafterBootstrapServiceRegistryBuilt(org.hibernate.boot.registry.BootstrapServiceRegistry bsr)Hook to allow tests to use the BootstrapServiceRegistry if they wishprotected voidafterMetadataBuilt(org.hibernate.boot.Metadata metadata)protected voidafterMetadataSourcesApplied(org.hibernate.boot.MetadataSources metadataSources)protected voidafterSessionFactoryBuilt(org.hibernate.engine.spi.SessionFactoryImplementor sessionFactory)protected voidafterStandardServiceRegistryBuilt(org.hibernate.boot.registry.StandardServiceRegistry ssr)Hook to allow tests to use the StandardServiceRegistry if they wishvoidafterTest()protected voidapplyCacheSettings(org.hibernate.boot.Metadata metadata)protected voidapplyMetadataSources(org.hibernate.boot.MetadataSources sources)protected voidassertAllDataRemoved()voidbeforeTest()protected voidbuildResources()protected voidcleanupCache()protected voidcleanupTest()protected voidcleanupTestData()protected voidconfigureBootstrapServiceRegistryBuilder(org.hibernate.boot.registry.BootstrapServiceRegistryBuilder bsrb)Apply any desired config to the BootstrapServiceRegistryBuilder to be incorporated into the built BootstrapServiceRegistryprotected voidconfigureMetadataBuilder(org.hibernate.boot.MetadataBuilder metadataBuilder)protected voidconfigureSessionFactoryBuilder(org.hibernate.boot.SessionFactoryBuilder sfb)protected voidconfigureStandardServiceRegistryBuilder(org.hibernate.boot.registry.StandardServiceRegistryBuilder ssrb)Apply any desired config to the StandardServiceRegistryBuilder to be incorporated into the built StandardServiceRegistryprotected org.hibernate.boot.registry.StandardServiceRegistryBuilderconstructStandardServiceRegistryBuilder()protected booleancreateSchema()protected StringcreateSecondSchema()<R> RfromSession(Function<org.hibernate.engine.spi.SessionImplementor,R> action)<R> RfromTransaction(Function<org.hibernate.engine.spi.SessionImplementor,R> action)protected Class[]getAnnotatedClasses()protected String[]getAnnotatedPackages()protected StringgetBaseForMappings()protected StringgetCacheConcurrencyStrategy()protected org.hibernate.dialect.DialectgetDialect()protected String[]getMappings()protected org.hibernate.SessiongetSession()protected String[]getXmlFiles()protected voidinitialize(org.hibernate.boot.MetadataBuilder metadataBuilder)voidinSession(Consumer<org.hibernate.engine.spi.SessionImplementor> action)voidinStatelessSession(Consumer<org.hibernate.StatelessSession> action)voidinStatelessTransaction(Consumer<org.hibernate.StatelessSession> action)voidinTransaction(Consumer<org.hibernate.engine.spi.SessionImplementor> action)protected booleanisCleanupTestDataRequired()protected org.hibernate.boot.spi.MetadataImplementormetadata()voidonFailure()protected org.hibernate.SessionopenSession()protected org.hibernate.SessionopenSession(org.hibernate.Interceptor interceptor)protected booleanoverrideCacheStrategy()protected voidprepareTest()protected voidrebuildSessionFactory()protected booleanrebuildSessionFactoryOnError()protected voidreleaseResources()protected org.hibernate.boot.registry.StandardServiceRegistryserviceRegistry()protected org.hibernate.engine.spi.SessionFactoryImplementorsessionFactory()protected voidshutDown()protected voidstartUp()-
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
-
NO_MAPPINGS
protected static final String[] NO_MAPPINGS
-
NO_CLASSES
protected static final Class[] NO_CLASSES
-
-
Method Detail
-
getDialect
protected org.hibernate.dialect.Dialect getDialect()
-
serviceRegistry
protected org.hibernate.boot.registry.StandardServiceRegistry serviceRegistry()
-
metadata
protected org.hibernate.boot.spi.MetadataImplementor metadata()
-
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
-
getSession
protected org.hibernate.Session getSession()
-
rebuildSessionFactory
protected void rebuildSessionFactory()
-
cleanupCache
protected void cleanupCache()
-
startUp
protected void startUp()
-
buildResources
protected void buildResources()
-
constructStandardServiceRegistryBuilder
protected final org.hibernate.boot.registry.StandardServiceRegistryBuilder constructStandardServiceRegistryBuilder()
-
addSettings
protected void addSettings(Map settings)
-
configureBootstrapServiceRegistryBuilder
protected void configureBootstrapServiceRegistryBuilder(org.hibernate.boot.registry.BootstrapServiceRegistryBuilder bsrb)
Apply any desired config to the BootstrapServiceRegistryBuilder to be incorporated into the built BootstrapServiceRegistry- Parameters:
bsrb- The BootstrapServiceRegistryBuilder
-
afterBootstrapServiceRegistryBuilt
protected void afterBootstrapServiceRegistryBuilt(org.hibernate.boot.registry.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(org.hibernate.boot.registry.StandardServiceRegistryBuilder ssrb)
Apply any desired config to the StandardServiceRegistryBuilder to be incorporated into the built StandardServiceRegistry- Parameters:
ssrb- The StandardServiceRegistryBuilder
-
afterStandardServiceRegistryBuilt
protected void afterStandardServiceRegistryBuilt(org.hibernate.boot.registry.StandardServiceRegistry ssr)
Hook to allow tests to use the StandardServiceRegistry if they wish- Parameters:
ssr- The StandardServiceRegistry
-
applyMetadataSources
protected void applyMetadataSources(org.hibernate.boot.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(org.hibernate.boot.MetadataSources metadataSources)
-
initialize
protected void initialize(org.hibernate.boot.MetadataBuilder metadataBuilder)
-
configureMetadataBuilder
protected void configureMetadataBuilder(org.hibernate.boot.MetadataBuilder metadataBuilder)
-
overrideCacheStrategy
protected boolean overrideCacheStrategy()
-
getCacheConcurrencyStrategy
protected String getCacheConcurrencyStrategy()
-
applyCacheSettings
protected final void applyCacheSettings(org.hibernate.boot.Metadata metadata)
-
afterMetadataBuilt
protected void afterMetadataBuilt(org.hibernate.boot.Metadata metadata)
-
configureSessionFactoryBuilder
protected void configureSessionFactoryBuilder(org.hibernate.boot.SessionFactoryBuilder sfb)
-
afterSessionFactoryBuilt
protected void afterSessionFactoryBuilt(org.hibernate.engine.spi.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<org.hibernate.engine.spi.SessionImplementor> action)
-
inStatelessSession
public void inStatelessSession(Consumer<org.hibernate.StatelessSession> action)
-
fromSession
public <R> R fromSession(Function<org.hibernate.engine.spi.SessionImplementor,R> action)
-
inTransaction
public void inTransaction(Consumer<org.hibernate.engine.spi.SessionImplementor> action)
-
inStatelessTransaction
public void inStatelessTransaction(Consumer<org.hibernate.StatelessSession> action)
-
fromTransaction
public <R> R fromTransaction(Function<org.hibernate.engine.spi.SessionImplementor,R> action)
-
-