1
|
/**
|
2
|
* Copyright (C) 2018 EDIT
|
3
|
* European Distributed Institute of Taxonomy
|
4
|
* http://www.e-taxonomy.eu
|
5
|
*
|
6
|
* The contents of this file are subject to the Mozilla Public License Version 1.1
|
7
|
* See LICENSE.TXT at the top of this package for the full license terms.
|
8
|
*/
|
9
|
package eu.etaxonomy.cdm.api.service.name;
|
10
|
|
11
|
import static org.junit.Assert.assertEquals;
|
12
|
import static org.junit.Assert.assertNotNull;
|
13
|
|
14
|
import java.util.ArrayList;
|
15
|
import java.util.Iterator;
|
16
|
import java.util.List;
|
17
|
import java.util.Map;
|
18
|
|
19
|
import org.junit.Assert;
|
20
|
import org.junit.Before;
|
21
|
import org.junit.Test;
|
22
|
|
23
|
import eu.etaxonomy.cdm.api.service.exception.TypeDesignationSetException;
|
24
|
import eu.etaxonomy.cdm.model.agent.Person;
|
25
|
import eu.etaxonomy.cdm.model.agent.Team;
|
26
|
import eu.etaxonomy.cdm.model.common.IdentifiableSource;
|
27
|
import eu.etaxonomy.cdm.model.common.VerbatimTimePeriod;
|
28
|
import eu.etaxonomy.cdm.model.common.VersionableEntity;
|
29
|
import eu.etaxonomy.cdm.model.media.Media;
|
30
|
import eu.etaxonomy.cdm.model.name.NameTypeDesignation;
|
31
|
import eu.etaxonomy.cdm.model.name.NameTypeDesignationStatus;
|
32
|
import eu.etaxonomy.cdm.model.name.Rank;
|
33
|
import eu.etaxonomy.cdm.model.name.SpecimenTypeDesignation;
|
34
|
import eu.etaxonomy.cdm.model.name.SpecimenTypeDesignationStatus;
|
35
|
import eu.etaxonomy.cdm.model.name.TaxonName;
|
36
|
import eu.etaxonomy.cdm.model.name.TaxonNameFactory;
|
37
|
import eu.etaxonomy.cdm.model.name.TypeDesignationBase;
|
38
|
import eu.etaxonomy.cdm.model.name.TypeDesignationStatusBase;
|
39
|
import eu.etaxonomy.cdm.model.occurrence.Collection;
|
40
|
import eu.etaxonomy.cdm.model.occurrence.DerivationEvent;
|
41
|
import eu.etaxonomy.cdm.model.occurrence.DerivationEventType;
|
42
|
import eu.etaxonomy.cdm.model.occurrence.DerivedUnit;
|
43
|
import eu.etaxonomy.cdm.model.occurrence.FieldUnit;
|
44
|
import eu.etaxonomy.cdm.model.occurrence.MediaSpecimen;
|
45
|
import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationType;
|
46
|
import eu.etaxonomy.cdm.model.reference.Reference;
|
47
|
import eu.etaxonomy.cdm.model.reference.ReferenceFactory;
|
48
|
import eu.etaxonomy.cdm.strategy.parser.TimePeriodParser;
|
49
|
import eu.etaxonomy.cdm.test.TermTestBase;
|
50
|
|
51
|
/**
|
52
|
* @author a.kohlbecker, k.luther, a.mueller
|
53
|
* @since 03.09.2018
|
54
|
*/
|
55
|
public class TypeDesignationSetContainerTest extends TermTestBase{
|
56
|
|
57
|
private static final boolean WITH_CITATION = true;
|
58
|
private static final boolean WITH_NAME = true;
|
59
|
private static final boolean WITH_TYPE_LABEL = true;
|
60
|
|
61
|
private NameTypeDesignation ntd;
|
62
|
private NameTypeDesignation ntd_LT;
|
63
|
private SpecimenTypeDesignation std_IT;
|
64
|
private SpecimenTypeDesignation std_HT;
|
65
|
private SpecimenTypeDesignation std_LT;
|
66
|
private SpecimenTypeDesignation std_IT_2;
|
67
|
private SpecimenTypeDesignation std_IT_3;
|
68
|
private SpecimenTypeDesignation mtd_HT_published;
|
69
|
private SpecimenTypeDesignation mtd_IT_unpublished;
|
70
|
private Reference book;
|
71
|
private Team team;
|
72
|
|
73
|
@Before
|
74
|
public void init(){
|
75
|
|
76
|
Person person1 = Person.NewInstance("DC", "Decandolle", "A.", null);
|
77
|
Person person2 = Person.NewInstance("Hab.", "Haber", "M.", null);
|
78
|
Person person3 = Person.NewInstance("Moler", "Moler", "A.P.", null);
|
79
|
team = Team.NewInstance(person1, person2, person3);
|
80
|
|
81
|
book = ReferenceFactory.newBook();
|
82
|
book.setAuthorship(team);
|
83
|
book.setDatePublished(TimePeriodParser.parseStringVerbatim("11 Apr 1962"));
|
84
|
|
85
|
ntd = NameTypeDesignation.NewInstance();
|
86
|
ntd.setId(1);
|
87
|
TaxonName typeName = TaxonNameFactory.NewBacterialInstance(Rank.SPECIES());
|
88
|
typeName.setTitleCache("Prionus coriatius L.", true);
|
89
|
ntd.setTypeName(typeName);
|
90
|
// Reference citation = ReferenceFactory.newGeneric();
|
91
|
// citation.setTitleCache("Species Plantarum", true);
|
92
|
// ntd.setCitation(citation);
|
93
|
// ntd.addPrimaryTaxonomicSource(citation, null);
|
94
|
|
95
|
ntd_LT = NameTypeDesignation.NewInstance();
|
96
|
ntd_LT.setTypeStatus(NameTypeDesignationStatus.LECTOTYPE());
|
97
|
TaxonName typeName2 = TaxonNameFactory.NewBacterialInstance(Rank.SPECIES());
|
98
|
typeName2.setTitleCache("Prionus arealus L.", true);
|
99
|
ntd_LT.setTypeName(typeName2);
|
100
|
ntd_LT.setCitation(book);
|
101
|
|
102
|
FieldUnit fu_1 = FieldUnit.NewInstance();
|
103
|
fu_1.setId(1);
|
104
|
fu_1.setTitleCache("Testland, near Bughausen, A.Kohlbecker 81989, 2017", true);
|
105
|
|
106
|
FieldUnit fu_2 = FieldUnit.NewInstance();
|
107
|
fu_2.setId(2);
|
108
|
fu_2.setTitleCache("Dreamland, near Kissingen, A.Kohlbecker 66211, 2017", true);
|
109
|
|
110
|
std_HT = SpecimenTypeDesignation.NewInstance();
|
111
|
std_HT.setId(1);
|
112
|
DerivedUnit specimen_HT = DerivedUnit.NewInstance(SpecimenOrObservationType.PreservedSpecimen);
|
113
|
specimen_HT.setTitleCache("OHA", true);
|
114
|
createDerivationEvent(fu_1, specimen_HT);
|
115
|
specimen_HT.getOriginals().add(fu_1);
|
116
|
std_HT.setTypeSpecimen(specimen_HT);
|
117
|
std_HT.setTypeStatus(SpecimenTypeDesignationStatus.HOLOTYPE());
|
118
|
|
119
|
std_IT = SpecimenTypeDesignation.NewInstance();
|
120
|
std_IT.setId(2);
|
121
|
DerivedUnit specimen_IT = DerivedUnit.NewInstance(SpecimenOrObservationType.PreservedSpecimen);
|
122
|
specimen_IT.setTitleCache("BER", true);
|
123
|
createDerivationEvent(fu_1, specimen_IT);
|
124
|
std_IT.setTypeSpecimen(specimen_IT);
|
125
|
std_IT.setTypeStatus(SpecimenTypeDesignationStatus.ISOTYPE());
|
126
|
|
127
|
std_LT = SpecimenTypeDesignation.NewInstance();
|
128
|
DerivedUnit specimen_LT = DerivedUnit.NewInstance(SpecimenOrObservationType.PreservedSpecimen);
|
129
|
specimen_LT.setTitleCache("LEC", true);
|
130
|
createDerivationEvent(fu_1, specimen_LT);
|
131
|
std_LT.setTypeSpecimen(specimen_LT);
|
132
|
std_LT.setTypeStatus(SpecimenTypeDesignationStatus.LECTOTYPE());
|
133
|
std_LT.setCitation(book);
|
134
|
|
135
|
std_IT_2 = SpecimenTypeDesignation.NewInstance();
|
136
|
std_IT_2.setId(3);
|
137
|
DerivedUnit specimen_IT_2 = DerivedUnit.NewInstance(SpecimenOrObservationType.PreservedSpecimen);
|
138
|
specimen_IT_2.setTitleCache("KEW", true);
|
139
|
createDerivationEvent(fu_1, specimen_IT_2);
|
140
|
std_IT_2.setTypeSpecimen(specimen_IT_2);
|
141
|
std_IT_2.setTypeStatus(SpecimenTypeDesignationStatus.ISOTYPE());
|
142
|
|
143
|
std_IT_3 = SpecimenTypeDesignation.NewInstance();
|
144
|
std_IT_3.setId(4);
|
145
|
DerivedUnit specimen_IT_3 = DerivedUnit.NewInstance(SpecimenOrObservationType.PreservedSpecimen);
|
146
|
specimen_IT_3.setTitleCache("M", true);
|
147
|
createDerivationEvent(fu_2, specimen_IT_3);
|
148
|
std_IT_3.setTypeSpecimen(specimen_IT_3);
|
149
|
std_IT_3.setTypeStatus(SpecimenTypeDesignationStatus.ISOTYPE());
|
150
|
|
151
|
mtd_HT_published = SpecimenTypeDesignation.NewInstance();
|
152
|
mtd_HT_published.setId(5);
|
153
|
MediaSpecimen mediaSpecimen_published = (MediaSpecimen)DerivedUnit.NewInstance(SpecimenOrObservationType.Media);
|
154
|
Media media = Media.NewInstance();
|
155
|
Reference ref = ReferenceFactory.newBook();
|
156
|
ref.setTitle("Algae of the BGBM");
|
157
|
ref.setDatePublished(VerbatimTimePeriod.NewVerbatimInstance(2008));
|
158
|
ref.setAuthorship(Team.NewInstance(Person.NewInstance(null, "Kohlbecker", "A.", null), Person.NewInstance(null, "Kusber", "W.-H.", null)));
|
159
|
media.addSource(IdentifiableSource.NewPrimaryMediaSourceInstance(ref, "33"));
|
160
|
mediaSpecimen_published.setMediaSpecimen(media);
|
161
|
createDerivationEvent(fu_1, mediaSpecimen_published);
|
162
|
mtd_HT_published.setTypeSpecimen(mediaSpecimen_published);
|
163
|
mtd_HT_published.setTypeStatus(SpecimenTypeDesignationStatus.HOLOTYPE());
|
164
|
|
165
|
mtd_IT_unpublished = SpecimenTypeDesignation.NewInstance();
|
166
|
mtd_IT_unpublished.setId(6);
|
167
|
MediaSpecimen mediaSpecimen_unpublished = (MediaSpecimen)DerivedUnit.NewInstance(SpecimenOrObservationType.Media);
|
168
|
eu.etaxonomy.cdm.model.occurrence.Collection collection = eu.etaxonomy.cdm.model.occurrence.Collection.NewInstance();
|
169
|
collection.setCode("B");
|
170
|
mediaSpecimen_unpublished.setCollection(collection);
|
171
|
mediaSpecimen_unpublished.setAccessionNumber("Slide A565656");
|
172
|
createDerivationEvent(fu_1, mediaSpecimen_unpublished);
|
173
|
mtd_IT_unpublished.setTypeSpecimen(mediaSpecimen_unpublished);
|
174
|
mtd_IT_unpublished.setTypeStatus(SpecimenTypeDesignationStatus.ISOTYPE());
|
175
|
}
|
176
|
|
177
|
protected void createDerivationEvent(FieldUnit fu_1, DerivedUnit specimen_IT_2) {
|
178
|
DerivationEvent derivationEvent_3 = DerivationEvent.NewInstance(DerivationEventType.ACCESSIONING());
|
179
|
derivationEvent_3.addOriginal(fu_1);
|
180
|
derivationEvent_3.addDerivative(specimen_IT_2);
|
181
|
}
|
182
|
|
183
|
@Test
|
184
|
public void test1() throws TypeDesignationSetException{
|
185
|
|
186
|
@SuppressWarnings("rawtypes")
|
187
|
List<TypeDesignationBase> tds = new ArrayList<>();
|
188
|
tds.add(ntd);
|
189
|
tds.add(std_IT);
|
190
|
tds.add(std_HT);
|
191
|
tds.add(std_IT_2);
|
192
|
tds.add(std_IT_3);
|
193
|
|
194
|
TaxonName typifiedName = TaxonNameFactory.NewBacterialInstance(Rank.GENUS());
|
195
|
typifiedName.setTitleCache("Prionus L.", true);
|
196
|
|
197
|
typifiedName.addTypeDesignation(ntd, false);
|
198
|
typifiedName.addTypeDesignation(std_HT, false);
|
199
|
typifiedName.addTypeDesignation(std_IT, false);
|
200
|
typifiedName.addTypeDesignation(std_IT_2, false);
|
201
|
typifiedName.addTypeDesignation(std_IT_3, false);
|
202
|
|
203
|
TypeDesignationSetContainer typeDesignationManager = TypeDesignationSetContainer.NewDefaultInstance(tds);
|
204
|
String result = typeDesignationManager.print(WITH_CITATION, WITH_TYPE_LABEL, WITH_NAME);
|
205
|
|
206
|
assertNotNull(result);
|
207
|
assertEquals(
|
208
|
"Prionus L.\u202F\u2013\u202FTypes: Dreamland, near Kissingen, A.Kohlbecker 66211, 2017 (isotype: M);"
|
209
|
+ " Testland, near Bughausen, A.Kohlbecker 81989, 2017 (holotype: OHA; isotypes: BER, KEW);"
|
210
|
+ " nametype: Prionus coriatius L."
|
211
|
, result
|
212
|
);
|
213
|
|
214
|
Map<VersionableEntity,TypeDesignationSet> orderedTypeDesignations =
|
215
|
typeDesignationManager.getOrderedTypeDesignationSets();
|
216
|
Iterator<TypeDesignationSet> byStatusMapIterator = orderedTypeDesignations.values().iterator();
|
217
|
Iterator<TypeDesignationStatusBase<?>> keyIt_1 = byStatusMapIterator.next().keySet().iterator();
|
218
|
Iterator<TypeDesignationStatusBase<?>> keyIt_2 = byStatusMapIterator.next().keySet().iterator();
|
219
|
assertEquals("isotype", keyIt_1.next().getLabel());
|
220
|
assertEquals("holotype", keyIt_2.next().getLabel());
|
221
|
assertEquals("isotype", keyIt_2.next().getLabel());
|
222
|
}
|
223
|
|
224
|
@Test
|
225
|
public void test2() {
|
226
|
|
227
|
TaxonName typifiedName = TaxonNameFactory.NewBacterialInstance(Rank.GENUS());
|
228
|
typifiedName.setTitleCache("Prionus L.", true);
|
229
|
|
230
|
TypeDesignationSetContainer typeDesignationManager = new TypeDesignationSetContainer(typifiedName);
|
231
|
String result = typeDesignationManager.print(WITH_CITATION, WITH_TYPE_LABEL, WITH_NAME);
|
232
|
assertEquals(
|
233
|
"Prionus L."
|
234
|
, result
|
235
|
);
|
236
|
|
237
|
typifiedName.addTypeDesignation(ntd, false);
|
238
|
typeDesignationManager.addTypeDesigations(ntd);
|
239
|
|
240
|
assertEquals(
|
241
|
"Prionus L.\u202F\u2013\u202FNametype: Prionus coriatius L."
|
242
|
, typeDesignationManager.print(WITH_CITATION, WITH_TYPE_LABEL, WITH_NAME)
|
243
|
);
|
244
|
|
245
|
typifiedName.addTypeDesignation(std_HT, false);
|
246
|
typeDesignationManager.addTypeDesigations(std_HT);
|
247
|
|
248
|
assertEquals(
|
249
|
"Prionus L.\u202F\u2013\u202FTypes: Testland, near Bughausen, A.Kohlbecker 81989, 2017 (holotype: OHA); nametype: Prionus coriatius L."
|
250
|
, typeDesignationManager.print(WITH_CITATION, WITH_TYPE_LABEL, WITH_NAME)
|
251
|
);
|
252
|
|
253
|
DerivedUnit specimen = std_HT.getTypeSpecimen();
|
254
|
specimen.setProtectedTitleCache(false);
|
255
|
Collection collection = Collection.NewInstance();
|
256
|
collection.setName("My collection");
|
257
|
specimen.setCollection(collection);
|
258
|
|
259
|
assertEquals(
|
260
|
"Prionus L.\u202F\u2013\u202FTypes: Testland, near Bughausen, A.Kohlbecker 81989, 2017 (holotype: My collection); nametype: Prionus coriatius L."
|
261
|
, typeDesignationManager.print(WITH_CITATION, WITH_TYPE_LABEL, WITH_NAME)
|
262
|
);
|
263
|
}
|
264
|
|
265
|
//see #9262
|
266
|
@Test
|
267
|
public void test_desigby_fide(){
|
268
|
//specimen types
|
269
|
TaxonName typifiedName = TaxonNameFactory.NewBacterialInstance(Rank.SPECIES());
|
270
|
typifiedName.setTitleCache("Prionus coriatius L.", true);
|
271
|
TypeDesignationSetContainer typeDesignationManager = new TypeDesignationSetContainer(typifiedName);
|
272
|
typeDesignationManager.addTypeDesigations(std_LT);
|
273
|
Reference citation = ReferenceFactory.newBook();
|
274
|
Reference inRef = ReferenceFactory.newBookSection();
|
275
|
inRef.setInBook(citation);
|
276
|
citation.setDatePublished(TimePeriodParser.parseStringVerbatim("1989"));
|
277
|
inRef.setAuthorship(Team.NewTitledInstance("Miller", "Mill."));
|
278
|
std_LT.addPrimaryTaxonomicSource(inRef, "55");
|
279
|
assertEquals("Prionus coriatius L.\u202F\u2013\u202FTestland, near Bughausen, A.Kohlbecker 81989, 2017 (lectotype: LEC designated by Decandolle & al. 1962 [fide Miller 1989: 55])",
|
280
|
typeDesignationManager.print(WITH_CITATION, !WITH_TYPE_LABEL, WITH_NAME));
|
281
|
assertEquals("Prionus coriatius L.\u202F\u2013\u202FTestland, near Bughausen, A.Kohlbecker 81989, 2017 (lectotype: LEC)",
|
282
|
typeDesignationManager.print(!WITH_CITATION,!WITH_TYPE_LABEL, WITH_NAME));
|
283
|
assertEquals("Testland, near Bughausen, A.Kohlbecker 81989, 2017 (lectotype: LEC)",
|
284
|
typeDesignationManager.print(!WITH_CITATION, !WITH_TYPE_LABEL, !WITH_NAME));
|
285
|
|
286
|
//name types
|
287
|
typifiedName = TaxonNameFactory.NewBacterialInstance(Rank.GENUS());
|
288
|
typifiedName.setTitleCache("Prionus L.", true);
|
289
|
typeDesignationManager = new TypeDesignationSetContainer(typifiedName);
|
290
|
typeDesignationManager.addTypeDesigations(ntd_LT);
|
291
|
ntd_LT.addPrimaryTaxonomicSource(inRef, "66");
|
292
|
assertEquals("Prionus L.\u202F\u2013\u202FLectotype: Prionus arealus L. designated by Decandolle & al. 1962 [fide Miller 1989: 66]",
|
293
|
typeDesignationManager.print(WITH_CITATION, !WITH_TYPE_LABEL, WITH_NAME));
|
294
|
assertEquals("Prionus L.\u202F\u2013\u202FLectotype: Prionus arealus L.",
|
295
|
typeDesignationManager.print(!WITH_CITATION, !WITH_TYPE_LABEL, WITH_NAME));
|
296
|
}
|
297
|
|
298
|
@Test
|
299
|
public void test_mediaType(){
|
300
|
|
301
|
for(int i = 0; i < 10; i++ ){
|
302
|
init();
|
303
|
// repeat 10 times to assure the order of typedesignations is fix in the representations
|
304
|
TaxonName typifiedName = TaxonNameFactory.NewBacterialInstance(Rank.SPECIES());
|
305
|
typifiedName.setTitleCache("Prionus coriatius L.", true);
|
306
|
typifiedName.addTypeDesignation(mtd_HT_published, false);
|
307
|
typifiedName.addTypeDesignation(mtd_IT_unpublished, false);
|
308
|
|
309
|
TypeDesignationSetContainer typeDesignationManager = new TypeDesignationSetContainer(typifiedName);
|
310
|
typeDesignationManager.addTypeDesigations(mtd_HT_published);
|
311
|
typeDesignationManager.addTypeDesigations(mtd_IT_unpublished);
|
312
|
|
313
|
assertEquals("failed after repeating " + i + " times",
|
314
|
"Prionus coriatius L.\u202F\u2013\u202FTypes: Testland, near Bughausen, A.Kohlbecker 81989, 2017 (holotype: [icon] in Kohlbecker & Kusber 2008: 33; isotype: [icon] B Slide A565656)"
|
315
|
, typeDesignationManager.print(WITH_CITATION, WITH_TYPE_LABEL, WITH_NAME)
|
316
|
);
|
317
|
|
318
|
Media media = ((MediaSpecimen)mtd_HT_published.getTypeSpecimen()).getMediaSpecimen();
|
319
|
Reference ref2 = ReferenceFactory.newBook();
|
320
|
ref2.setDatePublished(VerbatimTimePeriod.NewVerbatimInstance(2009));
|
321
|
ref2.setAuthorship(Person.NewInstance(null, "Mueller", "A.", null));
|
322
|
IdentifiableSource newSource = IdentifiableSource.NewPrimaryMediaSourceInstance(ref2, "tab. 4");
|
323
|
media.addSource(newSource);
|
324
|
String with2Sources = typeDesignationManager.print(WITH_CITATION, WITH_TYPE_LABEL, WITH_NAME);
|
325
|
Assert.assertTrue("failed after repeating " + i + " times",
|
326
|
//the order of the sources is currently not yet defined (rare case), therefore 2 possibilities
|
327
|
with2Sources.equals("Prionus coriatius L.\u202F\u2013\u202FTypes: Testland, near Bughausen, A.Kohlbecker 81989, 2017 (holotype: [icon] in Mueller 2009: tab. 4, Kohlbecker & Kusber 2008: 33; isotype: [icon] B Slide A565656)")
|
328
|
|| with2Sources.equals("Prionus coriatius L.\u202F\u2013\u202FTypes: Testland, near Bughausen, A.Kohlbecker 81989, 2017 (holotype: [icon] in Kohlbecker & Kusber 2008: 33, Mueller 2009: tab. 4; isotype: [icon] B Slide A565656)"))
|
329
|
;
|
330
|
}
|
331
|
}
|
332
|
|
333
|
@Test
|
334
|
public void test_withoutFieldUnit(){
|
335
|
TaxonName typifiedName = TaxonNameFactory.NewBotanicalInstance(Rank.SPECIES());
|
336
|
typifiedName.setTitleCache("Prionus coriatius L.", true);
|
337
|
DerivedUnit protectedSpecimen = DerivedUnit.NewPreservedSpecimenInstance();
|
338
|
protectedSpecimen.setTitleCache("Mexico. Oaxaca: Coixtlahuaca, Tepelmeme Villa de Morelos, aproximadamente 1 km S del Río Santa Lucía, 1285 m, 27 March 1994, U. Guzmán Cruz 1065 (MEXU 280206)", true);
|
339
|
Reference citation = ReferenceFactory.newBook();
|
340
|
citation.setTitle("The book of types");
|
341
|
SpecimenTypeDesignation protectedDesignation = typifiedName.addSpecimenTypeDesignation(protectedSpecimen, SpecimenTypeDesignationStatus.NEOTYPE(), citation, "55", null, false, false);
|
342
|
|
343
|
TypeDesignationSetContainer typeDesignationManager = new TypeDesignationSetContainer(typifiedName);
|
344
|
typeDesignationManager.addTypeDesigations(protectedDesignation);
|
345
|
|
346
|
assertEquals("Prionus coriatius L.\u202F\u2013\u202FNeotype: Mexico. Oaxaca: Coixtlahuaca, Tepelmeme Villa de Morelos, aproximadamente 1 km S del Río Santa Lucía, 1285 m, 27 March 1994, U. Guzmán Cruz 1065 (MEXU 280206) designated by The book of types: 55"
|
347
|
, typeDesignationManager.print(WITH_CITATION, !WITH_TYPE_LABEL, WITH_NAME)
|
348
|
);
|
349
|
protectedDesignation.setTypeStatus(null);
|
350
|
typeDesignationManager.addTypeDesigations(protectedDesignation);
|
351
|
assertEquals("Prionus coriatius L.\u202F\u2013\u202FMexico. Oaxaca: Coixtlahuaca, Tepelmeme Villa de Morelos, aproximadamente 1 km S del Río Santa Lucía, 1285 m, 27 March 1994, U. Guzmán Cruz 1065 (MEXU 280206) designated by The book of types: 55"
|
352
|
, typeDesignationManager.print(WITH_CITATION, !WITH_TYPE_LABEL, WITH_NAME)
|
353
|
);
|
354
|
|
355
|
DerivedUnit withoutFieldUnit = DerivedUnit.NewPreservedSpecimenInstance();
|
356
|
withoutFieldUnit.setAccessionNumber("280207");
|
357
|
withoutFieldUnit.setCollection(Collection.NewInstance("B", "Herbarium Berolinense"));
|
358
|
SpecimenTypeDesignation withoutFieldUnitDesignation = typifiedName.addSpecimenTypeDesignation(withoutFieldUnit, SpecimenTypeDesignationStatus.HOLOTYPE(), null, null, null, false, false);
|
359
|
typeDesignationManager.addTypeDesigations(withoutFieldUnitDesignation);
|
360
|
assertEquals("Prionus coriatius L.\u202F\u2013\u202FMexico. Oaxaca: Coixtlahuaca, Tepelmeme Villa de Morelos, aproximadamente 1 km S del Río Santa Lucía, 1285 m, 27 March 1994, U. Guzmán Cruz 1065 (MEXU 280206) designated by The book of types: 55; holotype: B 280207"
|
361
|
, typeDesignationManager.print(WITH_CITATION, !WITH_TYPE_LABEL, WITH_NAME)
|
362
|
);
|
363
|
}
|
364
|
|
365
|
@Test
|
366
|
public void test_withoutStatus(){
|
367
|
//for another important test without status see also test_withoutFieldUnit()
|
368
|
|
369
|
TaxonName typifiedName = TaxonNameFactory.NewBotanicalInstance(Rank.SPECIES());
|
370
|
typifiedName.setTitleCache("Prionus coriatius L.", true);
|
371
|
TypeDesignationSetContainer typeDesignationManager = new TypeDesignationSetContainer(typifiedName);
|
372
|
std_LT.setTypeStatus(null);
|
373
|
typeDesignationManager.addTypeDesigations(std_LT);
|
374
|
assertEquals("Prionus coriatius L.\u202F\u2013\u202FType: Testland, near Bughausen, A.Kohlbecker 81989, 2017 (LEC designated by Decandolle & al. 1962)",
|
375
|
typeDesignationManager.print(WITH_CITATION, WITH_TYPE_LABEL, WITH_NAME));
|
376
|
assertEquals("Prionus coriatius L.\u202F\u2013\u202FTestland, near Bughausen, A.Kohlbecker 81989, 2017 (LEC)",
|
377
|
typeDesignationManager.print(!WITH_CITATION, !WITH_TYPE_LABEL, WITH_NAME));
|
378
|
assertEquals("Testland, near Bughausen, A.Kohlbecker 81989, 2017 (LEC)",
|
379
|
typeDesignationManager.print(!WITH_CITATION, !WITH_TYPE_LABEL, !WITH_NAME));
|
380
|
|
381
|
//name types
|
382
|
typifiedName = TaxonNameFactory.NewBacterialInstance(Rank.GENUS());
|
383
|
typifiedName.setTitleCache("Prionus L.", true);
|
384
|
typeDesignationManager = new TypeDesignationSetContainer(typifiedName);
|
385
|
typeDesignationManager.addTypeDesigations(ntd_LT);
|
386
|
// ntd_LT.addPrimaryTaxonomicSource(inRef, "66");
|
387
|
assertEquals("Prionus L.\u202F\u2013\u202FLectotype: Prionus arealus L. designated by Decandolle & al. 1962",
|
388
|
typeDesignationManager.print(WITH_CITATION, !WITH_TYPE_LABEL, WITH_NAME));
|
389
|
assertEquals("Prionus L.\u202F\u2013\u202FLectotype: Prionus arealus L.",
|
390
|
typeDesignationManager.print(!WITH_CITATION, !WITH_TYPE_LABEL, WITH_NAME));
|
391
|
}
|
392
|
}
|