Class BaseDatabaseTest5
- Direct Known Subclasses:
AbstractServiceTest, AclLinterParentInheritanceTest, AclLinterServiceTest, AclSemanticsContractTest, AnalysisResultSetCacheStalenessTest, AnnotationRelationDaoTest, AnnotationRelationHarvestTest, ArrayDesignDaoTest, AuditEventDaoTest, BioAssayDimensionCacheStalenessTest, BioMaterialDaoTest, BlacklistedEntityDaoImplTest, CachedProcessedExpressionDataVectorServiceTest, CharacteristicDaoTest, ChebiSeedResolverSlotsTest, CompositeSequenceDaoTest, CuratableDaoTest, DifferentialExpressionAnalysisDaoTest, DifferentialExpressionResultDaoTest, ExperimentalFactorServiceTest, ExpressionAnalysisResultSetDaoTest, ExpressionExperimentDaoCursorTest, ExpressionExperimentDaoTest, ExpressionExperimentServiceDetachedEntityTest, ExpressionExperimentSetDaoTest, ExpressionExperimentSubSetDaoTest, FactorValueDaoTest, FactorValueServiceTest, GeneDaoTest, HibernateSqmFragileShapesIT, HqlSmokeIT, MexSingleCellDataLoaderPersistenceTest, ParentIdentityRetrievalStrategyTest, PreboardedExperimentMappingTest, PrincipalComponentAnalysisDaoImplTest, ProcessedExpressionDataVectorDaoTest, QuantitationTypeDaoTest, RawAndProcessedExpressionDataVectorDaoTest, RawExpressionDataVectorDaoTest, RawExpressionDataVectorTest, ReplaceAllRawDataVectorsQtCollisionTest, SingleCellDimensionCacheStalenessTest, SingleCellExpressionExperimentServiceTest, SingleCellStreamingAddTest, StatementTagPersistenceTest, UserDaoTest, UserManagerTest
BaseDatabaseTest.
Where BaseDatabaseTest inherits AbstractTransactionalJUnit4SpringContextTests
to get JUnit 4-style per-test transaction wrapping, this base uses Spring's
Transactional annotation directly. @Transactional at the class
level — combined with the SpringExtension inherited from
BaseTest5 — gives every test method a per-method transaction that is
rolled back at end-of-test by default (Spring Test's standard
TransactionalTestExecutionListener behaviour). This reproduces the
JUnit 4 base class behaviour without inheriting from it.
The @ContextConfiguration location is intentionally NOT declared on
this base; subclasses provide their own inner @Configuration class
(extending BaseDatabaseTest5.BaseDatabaseTestContextConfiguration) the same way they
did under the JUnit 4 base.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static class -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal voidFlush and clear the session after each test.
-
Field Details
-
sessionFactory
-
-
Constructor Details
-
BaseDatabaseTest5
public BaseDatabaseTest5()
-
-
Method Details
-
flushAndClearSession
@AfterEach public final void flushAndClearSession()Flush and clear the session after each test.This ensures that any error in the test are caught and each test starts with a clean slate.
-