Class BaseDatabaseTest

java.lang.Object
org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests
org.springframework.test.context.junit4.AbstractTransactionalJUnit4SpringContextTests
ubic.gemma.core.util.test.BaseDatabaseTest
All Implemented Interfaces:
org.springframework.beans.factory.Aware, org.springframework.context.ApplicationContextAware
Direct Known Subclasses:
AbstractServiceTest, AclLinterServiceTest, ArrayDesignDaoTest, AuditEventDaoTest, BioMaterialDaoTest, BlacklistedEntityDaoImplTest, CachedProcessedExpressionDataVectorServiceTest, CharacteristicDaoTest, CoexpressionDaoTest, CompositeSequenceDaoTest, CuratableDaoTest, DifferentialExpressionAnalysisDaoTest, DifferentialExpressionResultDaoTest, ExperimentalFactorServiceTest, ExpressionAnalysisResultSetDaoTest, ExpressionExperimentDaoTest, ExpressionExperimentSetDaoTest, ExpressionExperimentSubSetDaoTest, FactorValueDaoTest, FactorValueServiceTest, GeneDaoTest, HibernateConfigTest, HibernateSearchSourceTest, HibernateUtilsTest, MexSingleCellDataLoaderPersistenceTest, PreboardedExperimentMappingTest, PrincipalComponentAnalysisDaoImplTest, ProcessedExpressionDataVectorDaoTest, QuantitationTypeDaoTest, RawAndProcessedExpressionDataVectorDaoTest, RawExpressionDataVectorDaoTest, RawExpressionDataVectorTest, SingleCellExpressionExperimentServiceTest, SingleCellStreamingAddTest, UserDaoTest, UserManagerTest

@ActiveProfiles("test") public abstract class BaseDatabaseTest extends org.springframework.test.context.junit4.AbstractTransactionalJUnit4SpringContextTests
Minimalist test setup with an in-memory database and transactional test cases.
Author:
poirigui
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    protected static class 
     
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected SessionFactory
     

    Fields inherited from class org.springframework.test.context.junit4.AbstractTransactionalJUnit4SpringContextTests

    jdbcTemplate, simpleJdbcTemplate

    Fields inherited from class org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests

    applicationContext, logger
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    final void
    Flush and clear the session after each test.

    Methods inherited from class org.springframework.test.context.junit4.AbstractTransactionalJUnit4SpringContextTests

    countRowsInTable, countRowsInTableWhere, deleteFromTables, dropTables, executeSqlScript, setDataSource, setSqlScriptEncoding

    Methods inherited from class org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests

    setApplicationContext

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • BaseDatabaseTest

      public BaseDatabaseTest()
  • Method Details

    • flushAndClearSession

      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.