Revision 8e73bb3d
Added by Andreas Müller almost 2 years ago
cdmlib-services/src/test/java/eu/etaxonomy/cdm/api/service/name/TypeDesignationSetFormatterTest.java | ||
---|---|---|
60 | 60 |
private SpecimenTypeDesignation std_LT; |
61 | 61 |
private SpecimenTypeDesignation std_IT_2; |
62 | 62 |
private SpecimenTypeDesignation std_IT_3; |
63 |
private SpecimenTypeDesignation mtd_HT_published; |
|
63 |
private SpecimenTypeDesignation mstd_HT_published;
|
|
64 | 64 |
private SpecimenTypeDesignation mtd_IT_unpublished; |
65 | 65 |
private Reference book; |
66 | 66 |
private Team team; |
... | ... | |
143 | 143 |
std_IT_3.setTypeSpecimen(specimen_IT_3); |
144 | 144 |
std_IT_3.setTypeStatus(SpecimenTypeDesignationStatus.ISOTYPE()); |
145 | 145 |
|
146 |
mtd_HT_published = SpecimenTypeDesignation.NewInstance(); |
|
147 |
mtd_HT_published.setId(5); |
|
146 |
mstd_HT_published = SpecimenTypeDesignation.NewInstance();
|
|
147 |
mstd_HT_published.setId(5);
|
|
148 | 148 |
MediaSpecimen mediaSpecimen_published = (MediaSpecimen)DerivedUnit.NewInstance(SpecimenOrObservationType.Media); |
149 | 149 |
Media media = Media.NewInstance(); |
150 | 150 |
Reference ref = ReferenceFactory.newGeneric(); |
... | ... | |
152 | 152 |
media.addSource(IdentifiableSource.NewPrimaryMediaSourceInstance(ref, "p.33")); |
153 | 153 |
mediaSpecimen_published.setMediaSpecimen(media); |
154 | 154 |
createDerivationEvent(fu_1, mediaSpecimen_published); |
155 |
mtd_HT_published.setTypeSpecimen(mediaSpecimen_published); |
|
156 |
mtd_HT_published.setTypeStatus(SpecimenTypeDesignationStatus.HOLOTYPE()); |
|
155 |
mstd_HT_published.setTypeSpecimen(mediaSpecimen_published);
|
|
156 |
mstd_HT_published.setTypeStatus(SpecimenTypeDesignationStatus.HOLOTYPE());
|
|
157 | 157 |
|
158 | 158 |
mtd_IT_unpublished = SpecimenTypeDesignation.NewInstance(); |
159 | 159 |
mtd_IT_unpublished.setId(6); |
... | ... | |
223 | 223 |
statusSource.setTitle("Status test"); |
224 | 224 |
std_HT.getTypeSpecimen().addStatus(OccurrenceStatus.NewInstance(DefinedTerm.getTermByUuid(DefinedTerm.uuidDestroyed), statusSource, "335")); |
225 | 225 |
|
226 |
TypeDesignationSetContainer manager = new TypeDesignationSetContainer(tds);
|
|
226 |
TypeDesignationSetContainer container = new TypeDesignationSetContainer(tds);
|
|
227 | 227 |
TypeDesignationSetFormatter formatter = new TypeDesignationSetFormatter(true, true, true); |
228 | 228 |
|
229 |
String text = formatter.format(manager);
|
|
229 |
String text = formatter.format(container);
|
|
230 | 230 |
Assert.assertEquals("Prionus coriatius L.\u202F\u2013\u202FType: Testland, near Bughausen, A.Kohlbecker 81989, 2017 (holotype: OHA 1234, destroyed)", text); |
231 | 231 |
|
232 |
List<TaggedText> taggedText = formatter.toTaggedText(manager);
|
|
232 |
List<TaggedText> taggedText = formatter.toTaggedText(container);
|
|
233 | 233 |
Assert.assertEquals("first entry should be the typified name", |
234 | 234 |
new TaggedText(TagEnum.name, "Prionus coriatius L.",TypedEntityReference.fromEntity(typifiedName, false)), taggedText.get(0)); |
235 | 235 |
// Assert.assertEquals("fourth entry should be the name type nameCache", |
Also available in: Unified diff
cleanup