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