Class PreboardedExperimentMappingTest

java.lang.Object
org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests
org.springframework.test.context.junit4.AbstractTransactionalJUnit4SpringContextTests
ubic.gemma.core.util.test.BaseDatabaseTest
ubic.gemma.persistence.service.expression.experiment.PreboardedExperimentMappingTest
All Implemented Interfaces:
org.springframework.beans.factory.Aware, org.springframework.context.ApplicationContextAware

@ContextConfiguration public class PreboardedExperimentMappingTest extends BaseDatabaseTest
Regression guard for the PreboardedExperiment discriminator mapping added in commit 44bf890061.

The compat patch's only job is to let a hotfix-1.32.7 instance MAP an INVESTIGATION row whose class discriminator column is 'PreboardedExperiment' (written by a phase2 peer against a shared DB) without throwing WrongClassException or returning null from polymorphic loads. This test pins the round-trip end-to-end:

  1. Persist a PreboardedExperiment via the session.
  2. Evict from the first-level cache.
  3. Reload polymorphically via session.get(Investigation.class, id).
  4. Assert the reloaded instance is typed as PreboardedExperiment and that the three preboarded-specific fields round-trip.

If the HBM subclass entry is removed, the discriminator value is changed, or the column names drift, this test will fail with a concrete signal (ClassCastException on the assertion, or WrongClassException at load time).

  • Nested Class Summary

    Nested classes/interfaces inherited from class ubic.gemma.core.util.test.BaseDatabaseTest

    BaseDatabaseTest.BaseDatabaseTestContextConfiguration
  • Field Summary

    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
    void
     

    Methods inherited from class ubic.gemma.core.util.test.BaseDatabaseTest

    flushAndClearSession

    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
  • Constructor Details

    • PreboardedExperimentMappingTest

      public PreboardedExperimentMappingTest()
  • Method Details

    • preboardedRoundTripsThroughHibernate

      public void preboardedRoundTripsThroughHibernate()