Class SingleCellStreamingAddTest

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.SingleCellStreamingAddTest
All Implemented Interfaces:
org.springframework.beans.factory.Aware, org.springframework.context.ApplicationContextAware

@ContextConfiguration public class SingleCellStreamingAddTest extends BaseDatabaseTest
Tests for the streaming overload of SingleCellExpressionExperimentService.addSingleCellDataVectors(ExpressionExperiment, QuantitationType, SingleCellDimension, Stream, String, boolean, boolean). Mirrors the in-memory-H2 setup used by SingleCellExpressionExperimentServiceTest. These tests exercise the single-pass streaming path introduced to address out-of-memory failures in addCELLxGENEData.
  • Constructor Details

    • SingleCellStreamingAddTest

      public SingleCellStreamingAddTest()
  • Method Details

    • setUp

      public void setUp()
    • resetMocks

      public void resetMocks()
    • testStreamingAddPersistsAllVectors

      public void testStreamingAddPersistsAllVectors()
    • testStreamingAddMatchesCollectionVariant

      public void testStreamingAddMatchesCollectionVariant()
    • testStreamingAddAppliesSparsityMetricsForPreferredQt

      public void testStreamingAddAppliesSparsityMetricsForPreferredQt()
    • testStreamingAddDoesNotApplySparsityForNonPreferredQt

      public void testStreamingAddDoesNotApplySparsityForNonPreferredQt()
    • testStreamingAddCreatesCellTypeFactorWhenPreferred

      public void testStreamingAddCreatesCellTypeFactorWhenPreferred()
    • testStreamingAddEmitsAuditEvent

      public void testStreamingAddEmitsAuditEvent()
    • testStreamingAddRejectsEmptyStream

      public void testStreamingAddRejectsEmptyStream()
    • testStreamingAddRejectsWrongQuantitationType

      public void testStreamingAddRejectsWrongQuantitationType()
    • testStreamingAddRejectsWrongSingleCellDimension

      public void testStreamingAddRejectsWrongSingleCellDimension()
    • testStreamingAddRejectsDuplicateQuantitationTypeName

      public void testStreamingAddRejectsDuplicateQuantitationTypeName()
    • testStreamingAddConsumesSourceExactlyOnce

      public void testStreamingAddConsumesSourceExactlyOnce()
      The streaming overload is the OOM fix's load-bearing contract: it must consume the source stream exactly once. If it materialises the stream (e.g. via toList()) somewhere internally, this test will fail because the underlying iterator records each next() call.
    • testStreamingAddAcceptsPersistentDimensionFromPriorAdd

      public void testStreamingAddAcceptsPersistentDimensionFromPriorAdd()
      Uses a persistent SCD (already attached to the experiment via a prior add) to verify the "scdJustCreated" branch in the streaming validator: re-adding vectors against an SCD that is already wired up to existing vectors must be allowed.