Class CharacteristicTest
java.lang.Object
ubic.gemma.model.common.description.CharacteristicTest
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidThe no-break spaces are the ones a normalizer quietly misses.voidNull must survive as null: "no value" stays distinct from "blank".voidFree-text term fields carry the submitter's spacing.voidvoidThe statement URI slots carry the same rule; prod held 7 blank PREDICATE_URI and 3 blank OBJECT_URI rows.void🛑 An empty-string URI is a second dialect for ungrounded and no layer reads it that way:CharacteristicUtils.equals(String, String, String, String)treats any non-null URI as grounded, so''beside a NULL compares as "ontology term vs free text" and the duplicate guard indoAddAnnotationpasses a pair it should refuse.voidvoidvoid
-
Constructor Details
-
CharacteristicTest
public CharacteristicTest()
-
-
Method Details
-
testEquals
@Test public void testEquals() -
testComparator
@Test public void testComparator() -
termTextIsNormalizedOnWrite
@Test public void termTextIsNormalizedOnWrite()Free-text term fields carry the submitter's spacing. In production 13,179 characteristic values held an internal double space and 12,861 of those had the run in the submitter's own originalValue, so the input reproduces them on every import; a further 4,406 carried edge whitespace. MySQL's PAD SPACE collation hides a TRAILING space from `=` but gives internal runs no cover, so two spellings of one value split under GROUP BY, joins and every exact-label comparison. Normalize where every writer passes. -
noBreakSpacesAreNormalizedToo
@Test public void noBreakSpacesAreNormalizedToo()The no-break spaces are the ones a normalizer quietly misses. Java does not classify U+202F or U+2007 as whitespace, so StringUtils.normalizeSpace leaves them alone; and although it maps U+00A0 to a plain space it does not re-collapse afterwards, so a run of them comes back as a run of ORDINARY double spaces -- the normalizer emitting the exact defect it exists to remove. Production carries 2,392 values with U+00A0 and 5 with U+202F. -
nullTermTextStaysNull
@Test public void nullTermTextStaysNull()Null must survive as null: "no value" stays distinct from "blank". -
testACharacteristicSurvivesBeingReTermedInsideASet
@Test public void testACharacteristicSurvivesBeingReTermedInsideASet() -
testEqualsAndHashCodeAgreeForTwoInstancesOfOneRow
@Test public void testEqualsAndHashCodeAgreeForTwoInstancesOfOneRow() -
testBlankUriIsStoredAsNull
@Test public void testBlankUriIsStoredAsNull()🛑 An empty-string URI is a second dialect for ungrounded and no layer reads it that way:CharacteristicUtils.equals(String, String, String, String)treats any non-null URI as grounded, so''beside a NULL compares as "ontology term vs free text" and the duplicate guard indoAddAnnotationpasses a pair it should refuse. Production carried 80 such rows on curation surfaces; normalising them to NULL collapsed two pairs onto one coordinate and manufactured duplicate tags (frinkbro, 2026-09-11). Blank now cannot be stored from any write path, including the 72 callsites that set a URI directly. -
testBlankStatementUrisAreStoredAsNull
@Test public void testBlankStatementUrisAreStoredAsNull()The statement URI slots carry the same rule; prod held 7 blank PREDICATE_URI and 3 blank OBJECT_URI rows.
-