Revision 528e950d
Added by Cherian Mathew over 8 years ago
cdmlib-services/src/test/java/eu/etaxonomy/cdm/api/service/HandlingCdmEntitiesTest.java | ||
---|---|---|
26 | 26 |
import eu.etaxonomy.cdm.model.agent.Person; |
27 | 27 |
import eu.etaxonomy.cdm.model.agent.Team; |
28 | 28 |
import eu.etaxonomy.cdm.model.common.CdmBase; |
29 |
import eu.etaxonomy.cdm.model.common.OriginalSourceType; |
|
30 |
import eu.etaxonomy.cdm.model.description.DescriptionElementSource; |
|
31 |
import eu.etaxonomy.cdm.model.description.Feature; |
|
32 |
import eu.etaxonomy.cdm.model.description.TaxonDescription; |
|
33 |
import eu.etaxonomy.cdm.model.description.TextData; |
|
29 | 34 |
import eu.etaxonomy.cdm.model.name.BotanicalName; |
30 | 35 |
import eu.etaxonomy.cdm.model.name.NonViralName; |
31 | 36 |
import eu.etaxonomy.cdm.model.taxon.Taxon; |
... | ... | |
349 | 354 |
taxonService.merge(taxon); |
350 | 355 |
|
351 | 356 |
} |
357 |
|
|
358 |
|
|
359 |
@Test |
|
360 |
public final void testTaxonDescriptionMerge() { |
|
361 |
|
|
362 |
BotanicalName name = BotanicalName.NewInstance(null, "Abies alba", null, null, null, null, null, null, null); |
|
363 |
Taxon taxon = Taxon.NewInstance(name, null); |
|
364 |
TaxonDescription description = TaxonDescription.NewInstance(taxon); |
|
365 |
|
|
366 |
TextData textData = TextData.NewInstance(); |
|
367 |
|
|
368 |
textData.setFeature(Feature.ECOLOGY()); |
|
369 |
description.addElement(textData); |
|
370 |
|
|
371 |
DescriptionElementSource descriptionElementSource = DescriptionElementSource.NewInstance(OriginalSourceType.PrimaryTaxonomicSource); |
|
372 |
// Un-commenting the following line will reproduce the exception seen in #5256 |
|
373 |
//textData.addSource(descriptionElementSource); |
|
374 |
|
|
375 |
|
|
376 |
taxonService.merge(taxon); |
|
377 |
} |
|
352 | 378 |
} |
Also available in: Unified diff
#5256 Add test for description reference problem