Class SingleCellStreamingAddTest
java.lang.Object
ubic.gemma.core.util.test.BaseTest5
ubic.gemma.core.util.test.BaseDatabaseTest5
ubic.gemma.persistence.service.expression.experiment.SingleCellStreamingAddTest
Tests for the streaming overload of
SingleCellExpressionExperimentService.addSingleCellDataVectors(ExpressionExperiment, QuantitationType, SingleCellDimension, Stream, String, boolean, boolean).
Mirrors the in-memory-H2 harness of SingleCellExpressionExperimentServiceTest, including its
mock beans for the read/write service split. These exercise the single-pass path added to stop
single-cell imports from materialising every vector before writing any of them.
The audit event is not asserted here. This context wires the impl directly with no AOP proxy, so the
@Audited advice never fires; aspect coverage lives in AuditedAspectTest.
-
Nested Class Summary
Nested classes/interfaces inherited from class BaseDatabaseTest5
BaseDatabaseTest5.BaseDatabaseTestContextConfiguration -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidsetUp()voidCovers thescdJustCreatedbranch of the streaming validator: re-adding vectors against a dimension that is already wired to existing vectors must be allowed.voidvoidSingle-pass consumption is the whole point of the streaming overload: if the implementation ever materialises the source internally (atoList()slipped into the path, say), the memory saving evaporates silently and only this test notices.voidvoidvoidvoidvoidThe dimension must be findable through theSINGLE_CELL_DIMENSION_EXPERIMENTlink table, as it is after the collection variant.voidvoidvoidvoidvoidRecomputing the metrics from the stored vectors must give what the add computed.Methods inherited from class BaseDatabaseTest5
flushAndClearSession
-
Constructor Details
-
SingleCellStreamingAddTest
public SingleCellStreamingAddTest()
-
-
Method Details
-
setUp
@BeforeEach public void setUp() -
resetMocks
@AfterEach public void resetMocks() -
testStreamingAddPersistsAllVectors
@Test public void testStreamingAddPersistsAllVectors() -
testStreamingAddRecordsTheDimensionInTheLinkTable
@Test public void testStreamingAddRecordsTheDimensionInTheLinkTable()The dimension must be findable through theSINGLE_CELL_DIMENSION_EXPERIMENTlink table, as it is after the collection variant. HBCC_Cohort (93544), added through the streaming path, had no link row, sodeleteExperimentsnever found its dimension and failed onBIO_ASSAYS_SC_FKC. -
testStreamingAddMatchesCollectionVariant
@Test public void testStreamingAddMatchesCollectionVariant() -
testStreamingAddAppliesSparsityMetricsForPreferredQt
@Test public void testStreamingAddAppliesSparsityMetricsForPreferredQt() -
testUpdateSparsityMetricsCountsEverySample
@Test public void testUpdateSparsityMetricsCountsEverySample()Recomputing the metrics from the stored vectors must give what the add computed.The streaming
applyBioAssaySparsityMetricsbehindupdateSparsityMetricsincrementedsampleIndexa second time inside its loop, so samples 1 and 3 were never counted and got 0 cells, 0 design elements and 0 cells by design element. Master fixed it inee070b4f3c; it was never ported. -
testStreamingAddDoesNotApplySparsityForNonPreferredQt
@Test public void testStreamingAddDoesNotApplySparsityForNonPreferredQt() -
testStreamingAddCreatesCellTypeFactorWhenPreferred
@Test public void testStreamingAddCreatesCellTypeFactorWhenPreferred() -
testStreamingAddRejectsEmptyStream
@Test public void testStreamingAddRejectsEmptyStream() -
testStreamingAddRejectsWrongQuantitationType
@Test public void testStreamingAddRejectsWrongQuantitationType() -
testStreamingAddRejectsWrongSingleCellDimension
@Test public void testStreamingAddRejectsWrongSingleCellDimension() -
testStreamingAddRejectsDuplicateQuantitationTypeName
@Test public void testStreamingAddRejectsDuplicateQuantitationTypeName() -
testStreamingAddConsumesSourceExactlyOnce
@Test public void testStreamingAddConsumesSourceExactlyOnce()Single-pass consumption is the whole point of the streaming overload: if the implementation ever materialises the source internally (atoList()slipped into the path, say), the memory saving evaporates silently and only this test notices. The counting iterator records every pull. -
testStreamingAddAcceptsPersistentDimensionFromPriorAdd
@Test public void testStreamingAddAcceptsPersistentDimensionFromPriorAdd()Covers thescdJustCreatedbranch of the streaming validator: re-adding vectors against a dimension that is already wired to existing vectors must be allowed.
-