1
|
/**
|
2
|
* Copyright (C) 2007 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
|
|
10
|
package eu.etaxonomy.cdm.model.name;
|
11
|
|
12
|
import static org.junit.Assert.*;
|
13
|
|
14
|
import java.lang.reflect.Method;
|
15
|
import java.util.UUID;
|
16
|
|
17
|
import org.apache.log4j.Logger;
|
18
|
import org.junit.BeforeClass;
|
19
|
import org.junit.Ignore;
|
20
|
import org.junit.Test;
|
21
|
|
22
|
import eu.etaxonomy.cdm.model.common.DefaultTermInitializer;
|
23
|
import eu.etaxonomy.cdm.strategy.exceptions.UnknownCdmTypeException;
|
24
|
import eu.etaxonomy.cdm.test.unit.EntityTestBase;
|
25
|
|
26
|
public class RankTest extends EntityTestBase {
|
27
|
static Logger logger = Logger.getLogger(RankTest.class);
|
28
|
|
29
|
private static final UUID uuidEmpire = UUID.fromString("ac470211-1586-4b24-95ca-1038050b618d");
|
30
|
private static final UUID uuidDomain = UUID.fromString("ffca6ec8-8b88-417b-a6a0-f7c992aac19b");
|
31
|
private static final UUID uuidSuperkingdom = UUID.fromString("64223610-7625-4cfd-83ad-b797bf7f0edd");
|
32
|
private static final UUID uuidKingdom = UUID.fromString("fbe7109d-66b3-498c-a697-c6c49c686162");
|
33
|
private static final UUID uuidSubkingdom = UUID.fromString("a71bd9d8-f3ab-4083-afb5-d89315d71655");
|
34
|
private static final UUID uuidInfrakingdom = UUID.fromString("1e37930c-86cf-44f6-90fd-7822928df260");
|
35
|
private static final UUID uuidSuperphylum = UUID.fromString("0d0cecb1-e254-4607-b210-6801e7ecbb04");
|
36
|
private static final UUID uuidPhylum = UUID.fromString("773430d2-76b4-438c-b817-97a543a33287");
|
37
|
private static final UUID uuidSubphylum = UUID.fromString("23a9b6ff-9408-49c9-bd9e-7a2ca5ab4725");
|
38
|
private static final UUID uuidInfraphylum = UUID.fromString("1701de3a-7693-42a5-a2d3-42697f944190");
|
39
|
private static final UUID uuidSuperdivision = UUID.fromString("a735a48f-4fc8-49a7-ae0c-6a984f658131");
|
40
|
private static final UUID uuidDivision = UUID.fromString("7e56f5cc-123a-4fd1-8cbb-6fd80358b581");
|
41
|
private static final UUID uuidSubdivision = UUID.fromString("931c840f-7a6b-4d76-ad38-bfdd77d7b2e8");
|
42
|
private static final UUID uuidInfradivision = UUID.fromString("c0ede273-be52-4dee-b411-66ee08d30c94");
|
43
|
private static final UUID uuidSuperclass = UUID.fromString("e65b4e1a-21ec-428d-9b9f-e87721ab967c");
|
44
|
private static final UUID uuidClass = UUID.fromString("f23d14c4-1d34-4ee6-8b4e-eee2eb9a3daf");
|
45
|
private static final UUID uuidSubclass = UUID.fromString("8cb26733-e2f5-46cb-ab5c-f99254f877aa");
|
46
|
private static final UUID uuidInfraclass = UUID.fromString("ad23cfda-879a-4021-8629-c54d27caf717");
|
47
|
private static final UUID uuidSuperorder = UUID.fromString("c8c67a22-301a-4219-b882-4a49121232ff");
|
48
|
private static final UUID uuidOrder = UUID.fromString("b0785a65-c1c1-4eb4-88c7-dbd3df5aaad1");
|
49
|
private static final UUID uuidSuborder = UUID.fromString("768ad378-fa85-42ab-b668-763225832f57");
|
50
|
private static final UUID uuidInfraorder = UUID.fromString("84099182-a6f5-47d7-8586-33c9e9955a10");
|
51
|
private static final UUID uuidSectionZoology = UUID.fromString("691d371e-10d7-43f0-93db-3d7fa1a62c54");
|
52
|
private static final UUID uuidSubsectionZoology = UUID.fromString("0ed32d28-adc4-4303-a9ca-68e2acd67e33");
|
53
|
private static final UUID uuidSuperfamily = UUID.fromString("2cfa510a-dcea-4a03-b66a-b1528f9b0796");
|
54
|
private static final UUID uuidFamily = UUID.fromString("af5f2481-3192-403f-ae65-7c957a0f02b6");
|
55
|
private static final UUID uuidSubfamily = UUID.fromString("862526ee-7592-4760-a23a-4ff3641541c5");
|
56
|
private static final UUID uuidInfrafamily = UUID.fromString("c3f2e3bb-6eef-4a26-9fb7-b14f4c8c5e4f");
|
57
|
private static final UUID uuidSupertribe = UUID.fromString("11e94828-8c61-499b-87d6-1de35ce2c51c");
|
58
|
private static final UUID uuidTribe = UUID.fromString("4aa6890b-0363-4899-8d7c-ee0cb78e6166");
|
59
|
private static final UUID uuidSubtribe = UUID.fromString("ae41ecc5-5165-4126-9d24-79939ae5d822");
|
60
|
private static final UUID uuidInfratribe = UUID.fromString("1ec02e8f-f2b7-4c65-af9f-b436b34c79a3");
|
61
|
private static final UUID uuidSupragenericTaxon = UUID.fromString("1fdc0b93-c354-441a-8406-091e0303ff5c");
|
62
|
private static final UUID uuidGenus = UUID.fromString("1b11c34c-48a8-4efa-98d5-84f7f66ef43a");
|
63
|
private static final UUID uuidSubgenus = UUID.fromString("78786e16-2a70-48af-a608-494023b91904");
|
64
|
private static final UUID uuidInfragenus = UUID.fromString("a9972969-82cd-4d54-b693-a096422f13fa");
|
65
|
private static final UUID uuidSectionBotany = UUID.fromString("3edff68f-8527-49b5-bf91-7e4398bb975c");
|
66
|
private static final UUID uuidSubsectionBotany = UUID.fromString("d20f5b61-d463-4448-8f8a-c1ff1f262f59");
|
67
|
private static final UUID uuidSeries = UUID.fromString("d7381ecf-48f8-429b-9c54-f461656978cd");
|
68
|
private static final UUID uuidSubseries = UUID.fromString("80c9a263-f4db-4a13-b6c2-b7fec1aa1200");
|
69
|
private static final UUID uuidSpeciesAggregate = UUID.fromString("1ecae058-4217-4f75-9c27-6d8ba099ac7a");
|
70
|
private static final UUID uuidInfragenericTaxon = UUID.fromString("41bcc6ac-37d3-4fd4-bb80-3cc5b04298b9");
|
71
|
private static final UUID uuidSpecies = UUID.fromString("b301f787-f319-4ccc-a10f-b4ed3b99a86d");
|
72
|
private static final UUID uuidSubspecificAggregate = UUID.fromString("72c248b9-027d-4402-b375-dd4f0850c9ad");
|
73
|
private static final UUID uuidSubspecies = UUID.fromString("462a7819-8b00-4190-8313-88b5be81fad5");
|
74
|
private static final UUID uuidInfraspecies = UUID.fromString("f28ebc9e-bd50-4194-9af1-42f5cb971a2c");
|
75
|
private static final UUID uuidVariety = UUID.fromString("d5feb6a5-af5c-45ef-9878-bb4f36aaf490");
|
76
|
private static final UUID uuidBioVariety = UUID.fromString("a3a364cb-1a92-43fc-a717-3c44980a0991");
|
77
|
private static final UUID uuidPathoVariety = UUID.fromString("2f4f4303-a099-47e3-9048-d749d735423b");
|
78
|
private static final UUID uuidSubvariety = UUID.fromString("9a83862a-7aee-480c-a98d-4bceaf8712ca");
|
79
|
private static final UUID uuidSubsubvariety = UUID.fromString("bff22f84-553a-4429-a4e7-c4b3796c3a18");
|
80
|
private static final UUID uuidConvar = UUID.fromString("2cc740c9-cebb-43c8-9b06-1bef79e6a56a");
|
81
|
private static final UUID uuidForm = UUID.fromString("0461281e-458a-47b9-8d41-19a3d39356d5");
|
82
|
private static final UUID uuidSpecialForm = UUID.fromString("bed20aee-2f5a-4635-9c02-eff06246d067");
|
83
|
private static final UUID uuidSubform = UUID.fromString("47cfc5b0-0fb7-4ceb-b61d-e1dd8de8b569");
|
84
|
private static final UUID uuidSubsubform = UUID.fromString("1c8ac389-4349-4ae0-87be-7239f6635068");
|
85
|
private static final UUID uuidInfraspecificTaxon = UUID.fromString("eb75c27d-e154-4570-9d96-227b2df60474");
|
86
|
private static final UUID uuidCandidate = UUID.fromString("ead9a1f5-dfd4-4de2-9121-70a47accb10b");
|
87
|
private static final UUID uuidDenominationClass = UUID.fromString("49bdf74a-2170-40ed-8be2-887a0db517bf");
|
88
|
private static final UUID uuidGrex = UUID.fromString("08dcb4ff-ac58-48a3-93af-efb3d836ac84");
|
89
|
private static final UUID uuidGraftChimaera = UUID.fromString("6b4063bc-f934-4796-9bf3-0ef3aea5c1cb");
|
90
|
private static final UUID uuidCultivarGroup = UUID.fromString("d763e7d3-e7de-4bb1-9d75-225ca6948659");
|
91
|
private static final UUID uuidCultivar = UUID.fromString("5e98415b-dc6e-440b-95d6-ea33dbb39ad0");
|
92
|
|
93
|
@BeforeClass
|
94
|
public static void setUp() {
|
95
|
DefaultTermInitializer vocabularyStore = new DefaultTermInitializer();
|
96
|
vocabularyStore.initialize();
|
97
|
}
|
98
|
|
99
|
@Test
|
100
|
public void testRank() {
|
101
|
Rank rank = new Rank();
|
102
|
assertNotNull(rank);
|
103
|
}
|
104
|
|
105
|
@Test
|
106
|
public void testRankStringString() {
|
107
|
Rank rank = new Rank("term", "label", null);
|
108
|
assertEquals("label", rank.getLabel());
|
109
|
}
|
110
|
|
111
|
@Test
|
112
|
public void testEMPIRE() {
|
113
|
assertEquals(uuidEmpire, Rank.EMPIRE().getUuid());
|
114
|
}
|
115
|
|
116
|
@Test
|
117
|
public void testDOMAIN() {
|
118
|
assertEquals(uuidDomain, Rank.DOMAIN().getUuid());
|
119
|
}
|
120
|
|
121
|
@Test
|
122
|
public void testSUPERKINGDOM() {
|
123
|
assertEquals(uuidSuperkingdom, Rank.SUPERKINGDOM().getUuid());
|
124
|
}
|
125
|
|
126
|
@Test
|
127
|
public void testKINGDOM() {
|
128
|
assertEquals(uuidKingdom, Rank.KINGDOM().getUuid());
|
129
|
}
|
130
|
|
131
|
@Test
|
132
|
public void testSUBKINGDOM() {
|
133
|
assertEquals(uuidSubkingdom, Rank.SUBKINGDOM().getUuid());
|
134
|
}
|
135
|
|
136
|
@Test
|
137
|
public void testINFRAKINGDOM() {
|
138
|
assertEquals(uuidInfrakingdom, Rank.INFRAKINGDOM().getUuid());
|
139
|
}
|
140
|
|
141
|
@Test
|
142
|
public void testSUPERPHYLUM() {
|
143
|
assertEquals(uuidSuperphylum, Rank.SUPERPHYLUM().getUuid());
|
144
|
}
|
145
|
|
146
|
@Test
|
147
|
public void testPHYLUM() {
|
148
|
assertEquals(uuidPhylum, Rank.PHYLUM().getUuid());
|
149
|
}
|
150
|
|
151
|
@Test
|
152
|
public void testSUBPHYLUM() {
|
153
|
assertEquals(uuidSubphylum, Rank.SUBPHYLUM().getUuid());
|
154
|
}
|
155
|
|
156
|
@Test
|
157
|
public void testINFRAPHYLUM() {
|
158
|
assertEquals(uuidInfraphylum, Rank.INFRAPHYLUM().getUuid());
|
159
|
}
|
160
|
|
161
|
@Test
|
162
|
public void testSUPERDIVISION() {
|
163
|
assertEquals(uuidSuperdivision, Rank.SUPERDIVISION().getUuid());
|
164
|
}
|
165
|
|
166
|
@Test
|
167
|
public void testDIVISION() {
|
168
|
assertEquals(uuidDivision, Rank.DIVISION().getUuid());
|
169
|
}
|
170
|
|
171
|
@Test
|
172
|
public void testSUBDIVISION() {
|
173
|
assertEquals(uuidSubdivision, Rank.SUBDIVISION().getUuid());
|
174
|
}
|
175
|
|
176
|
@Test
|
177
|
public void testINFRADIVISION() {
|
178
|
assertEquals(uuidInfradivision, Rank.INFRADIVISION().getUuid());
|
179
|
}
|
180
|
|
181
|
@Test
|
182
|
public void testSUPERCLASS() {
|
183
|
assertEquals(uuidSuperclass, Rank.SUPERCLASS().getUuid());
|
184
|
}
|
185
|
|
186
|
@Test
|
187
|
public void testCLASS() {
|
188
|
assertEquals(uuidClass, Rank.CLASS().getUuid());
|
189
|
}
|
190
|
|
191
|
@Test
|
192
|
public void testSUBCLASS() {
|
193
|
assertEquals(uuidSubclass, Rank.SUBCLASS().getUuid());
|
194
|
}
|
195
|
|
196
|
@Test
|
197
|
public void testINFRACLASS() {
|
198
|
assertEquals(uuidInfraclass, Rank.INFRACLASS().getUuid());
|
199
|
}
|
200
|
|
201
|
@Test
|
202
|
public void testSUPERORDER() {
|
203
|
assertEquals(uuidSuperorder, Rank.SUPERORDER().getUuid());
|
204
|
}
|
205
|
|
206
|
@Test
|
207
|
public void testORDER() {
|
208
|
assertEquals(uuidOrder, Rank.ORDER().getUuid());
|
209
|
}
|
210
|
|
211
|
@Test
|
212
|
public void testSUBORDER() {
|
213
|
assertEquals(uuidSuborder, Rank.SUBORDER().getUuid());
|
214
|
}
|
215
|
|
216
|
@Test
|
217
|
public void testINFRAORDER() {
|
218
|
assertEquals(uuidInfraorder, Rank.INFRAORDER().getUuid());
|
219
|
}
|
220
|
|
221
|
@Test
|
222
|
public void testSUPERFAMILY() {
|
223
|
assertEquals(uuidSuperfamily, Rank.SUPERFAMILY().getUuid());
|
224
|
}
|
225
|
|
226
|
@Test
|
227
|
public void testFAMILY() {
|
228
|
assertEquals(uuidFamily, Rank.FAMILY().getUuid());
|
229
|
}
|
230
|
|
231
|
@Test
|
232
|
public void testSUBFAMILY() {
|
233
|
assertEquals(uuidSubfamily, Rank.SUBFAMILY().getUuid());
|
234
|
}
|
235
|
|
236
|
@Test
|
237
|
public void testINFRAFAMILY() {
|
238
|
assertEquals(uuidInfrafamily, Rank.INFRAFAMILY().getUuid());
|
239
|
}
|
240
|
|
241
|
@Test
|
242
|
public void testSUPERTRIBE() {
|
243
|
assertEquals(uuidSupertribe, Rank.SUPERTRIBE().getUuid());
|
244
|
}
|
245
|
|
246
|
@Test
|
247
|
public void testTRIBE() {
|
248
|
assertEquals(uuidTribe, Rank.TRIBE().getUuid());
|
249
|
}
|
250
|
|
251
|
@Test
|
252
|
public void testSUBTRIBE() {
|
253
|
assertEquals(uuidSubtribe, Rank.SUBTRIBE().getUuid());
|
254
|
}
|
255
|
|
256
|
@Test
|
257
|
public void testINFRATRIBE() {
|
258
|
assertEquals(uuidInfratribe, Rank.INFRATRIBE().getUuid());
|
259
|
}
|
260
|
|
261
|
@Test
|
262
|
public void testSUPRAGENERICTAXON() {
|
263
|
assertEquals(uuidSupragenericTaxon, Rank.SUPRAGENERICTAXON().getUuid());
|
264
|
}
|
265
|
|
266
|
@Test
|
267
|
public void testGENUS() {
|
268
|
assertEquals(uuidGenus, Rank.GENUS().getUuid()); }
|
269
|
|
270
|
@Test
|
271
|
public void testSUBGENUS() {
|
272
|
assertEquals(uuidSubgenus, Rank.SUBGENUS().getUuid());
|
273
|
}
|
274
|
|
275
|
@Test
|
276
|
public void testINFRAGENUS() {
|
277
|
assertEquals(uuidInfragenus, Rank.INFRAGENUS().getUuid());
|
278
|
}
|
279
|
|
280
|
@Test
|
281
|
public void testSECTION_BOTANY() {
|
282
|
assertEquals(uuidSectionBotany, Rank.SECTION_BOTANY().getUuid());
|
283
|
}
|
284
|
|
285
|
@Test
|
286
|
public void testSUBSECTION() {
|
287
|
assertEquals(uuidSubsectionBotany, Rank.SUBSECTION_BOTANY().getUuid());
|
288
|
}
|
289
|
|
290
|
@Test
|
291
|
public void testSECTION_ZOOLOGY() {
|
292
|
assertEquals(uuidSectionZoology, Rank.SECTION_ZOOLOGY().getUuid());
|
293
|
}
|
294
|
|
295
|
@Test
|
296
|
public void testSUBSECTION_ZOOLOGY() {
|
297
|
assertEquals(uuidSubsectionZoology, Rank.SUBSECTION_ZOOLOGY().getUuid());
|
298
|
}
|
299
|
|
300
|
@Test
|
301
|
public void testSERIES() {
|
302
|
assertEquals(uuidSeries, Rank.SERIES().getUuid());
|
303
|
}
|
304
|
|
305
|
@Test
|
306
|
public void testSUBSERIES() {
|
307
|
assertEquals(uuidSubseries, Rank.SUBSERIES().getUuid());
|
308
|
}
|
309
|
|
310
|
@Test
|
311
|
public void testSPECIESAGGREGATE() {
|
312
|
assertEquals(uuidSpeciesAggregate, Rank.SPECIESAGGREGATE().getUuid());
|
313
|
}
|
314
|
|
315
|
@Test
|
316
|
public void testINFRAGENERICTAXON() {
|
317
|
assertEquals(uuidInfragenericTaxon, Rank.INFRAGENERICTAXON().getUuid());
|
318
|
}
|
319
|
|
320
|
@Test
|
321
|
public void testSPECIES() {
|
322
|
assertEquals(uuidSpecies, Rank.SPECIES().getUuid());
|
323
|
}
|
324
|
|
325
|
@Test
|
326
|
public void testSUBSPECIFICAGGREGATE() {
|
327
|
assertEquals(uuidSubspecificAggregate, Rank.SUBSPECIFICAGGREGATE().getUuid());
|
328
|
}
|
329
|
|
330
|
@Test
|
331
|
public void testSUBSPECIES() {
|
332
|
assertEquals(uuidSubspecies, Rank.SUBSPECIES().getUuid());
|
333
|
}
|
334
|
|
335
|
@Test
|
336
|
public void testINFRASPECIES() {
|
337
|
assertEquals(uuidInfraspecies, Rank.INFRASPECIES().getUuid());
|
338
|
}
|
339
|
|
340
|
@Test
|
341
|
public void testVARIETY() {
|
342
|
assertEquals(uuidVariety, Rank.VARIETY().getUuid());
|
343
|
}
|
344
|
|
345
|
@Test
|
346
|
public void testBIOVARIETY() {
|
347
|
assertEquals(uuidBioVariety, Rank.BIOVARIETY().getUuid());
|
348
|
}
|
349
|
|
350
|
@Test
|
351
|
public void testPATHOVARIETY() {
|
352
|
assertEquals(uuidPathoVariety, Rank.PATHOVARIETY().getUuid());
|
353
|
}
|
354
|
|
355
|
@Test
|
356
|
public void testSUBVARIETY() {
|
357
|
assertEquals(uuidSubvariety, Rank.SUBVARIETY().getUuid());
|
358
|
}
|
359
|
|
360
|
@Test
|
361
|
public void testSUBSUBVARIETY() {
|
362
|
assertEquals(uuidSubsubvariety, Rank.SUBSUBVARIETY().getUuid());
|
363
|
}
|
364
|
|
365
|
@Test
|
366
|
public void testCONVAR() {
|
367
|
assertEquals(uuidConvar, Rank.CONVAR().getUuid()); }
|
368
|
|
369
|
@Test
|
370
|
public void testFORM() {
|
371
|
assertEquals(uuidForm, Rank.FORM().getUuid());
|
372
|
}
|
373
|
|
374
|
@Test
|
375
|
public void testSPECIALFORM() {
|
376
|
assertEquals(uuidSpecialForm, Rank.SPECIALFORM().getUuid());
|
377
|
}
|
378
|
|
379
|
@Test
|
380
|
public void testSUBFORM() {
|
381
|
assertEquals(uuidSubform, Rank.SUBFORM().getUuid());
|
382
|
}
|
383
|
|
384
|
@Test
|
385
|
public void testSUBSUBFORM() {
|
386
|
assertEquals(uuidSubsubform, Rank.SUBSUBFORM().getUuid());
|
387
|
}
|
388
|
|
389
|
@Test
|
390
|
public void testINFRASPECIFICTAXON() {
|
391
|
assertEquals(uuidInfraspecificTaxon, Rank.INFRASPECIFICTAXON().getUuid());
|
392
|
}
|
393
|
|
394
|
@Test
|
395
|
public void testCANDIDATE() {
|
396
|
assertEquals(uuidCandidate, Rank.CANDIDATE().getUuid());
|
397
|
}
|
398
|
|
399
|
@Test
|
400
|
public void testDENOMINATIONCLASS() {
|
401
|
assertEquals(uuidDenominationClass, Rank.DENOMINATIONCLASS().getUuid());
|
402
|
}
|
403
|
|
404
|
@Test
|
405
|
public void testGREX() {
|
406
|
assertEquals(uuidGrex, Rank.GREX().getUuid());
|
407
|
}
|
408
|
|
409
|
@Test
|
410
|
public void testGRAFTCHIMAERA() {
|
411
|
assertEquals(uuidGraftChimaera, Rank.GRAFTCHIMAERA().getUuid());
|
412
|
}
|
413
|
|
414
|
@Test
|
415
|
public void testCULTIVARGROUP() {
|
416
|
assertEquals(uuidCultivarGroup, Rank.CULTIVARGROUP().getUuid()); }
|
417
|
|
418
|
@Test
|
419
|
public void testCULTIVAR() {
|
420
|
assertEquals(uuidCultivar, Rank.CULTIVAR().getUuid()); }
|
421
|
|
422
|
|
423
|
@Test
|
424
|
public void testIsSupraGeneric() {
|
425
|
assertTrue(Rank.KINGDOM().isSupraGeneric());
|
426
|
assertTrue(Rank.FAMILY().isSupraGeneric());
|
427
|
assertTrue(Rank.ORDER().isSupraGeneric());
|
428
|
assertTrue(Rank.TRIBE().isSupraGeneric());
|
429
|
assertTrue(Rank.SUPRAGENERICTAXON().isSupraGeneric());
|
430
|
assertFalse(Rank.GENUS().isSupraGeneric());
|
431
|
assertFalse(Rank.SPECIES().isSupraGeneric());
|
432
|
assertFalse(Rank.CULTIVAR().isSupraGeneric());
|
433
|
}
|
434
|
|
435
|
@Test
|
436
|
public void testIsGenus() {
|
437
|
assertFalse(Rank.KINGDOM().isGenus());
|
438
|
assertFalse(Rank.FAMILY().isGenus());
|
439
|
assertFalse(Rank.ORDER().isGenus());
|
440
|
assertFalse(Rank.TRIBE().isGenus());
|
441
|
assertFalse(Rank.SUPRAGENERICTAXON().isGenus());
|
442
|
assertTrue(Rank.GENUS().isGenus());
|
443
|
assertFalse(Rank.SPECIES().isGenus());
|
444
|
assertFalse(Rank.CULTIVAR().isGenus());
|
445
|
}
|
446
|
|
447
|
@Test
|
448
|
public void testIsInfraGeneric() {
|
449
|
assertFalse(Rank.KINGDOM().isInfraGeneric());
|
450
|
assertFalse(Rank.FAMILY().isInfraGeneric());
|
451
|
assertFalse(Rank.ORDER().isInfraGeneric());
|
452
|
assertFalse(Rank.TRIBE().isInfraGeneric());
|
453
|
assertFalse(Rank.SUPRAGENERICTAXON().isInfraGeneric());
|
454
|
assertFalse(Rank.GENUS().isInfraGeneric());
|
455
|
assertTrue(Rank.SUBGENUS().isInfraGeneric());
|
456
|
assertTrue(Rank.INFRAGENUS().isInfraGeneric());
|
457
|
assertTrue(Rank.INFRAGENERICTAXON().isInfraGeneric());
|
458
|
assertTrue(Rank.SPECIESAGGREGATE().isInfraGeneric());
|
459
|
assertFalse(Rank.SPECIES().isInfraGeneric());
|
460
|
assertFalse(Rank.SUBSPECIES().isInfraGeneric());
|
461
|
assertFalse(Rank.CULTIVAR().isInfraGeneric());
|
462
|
}
|
463
|
|
464
|
@Test
|
465
|
public void testIsSpecies() {
|
466
|
assertFalse(Rank.KINGDOM().isSpecies());
|
467
|
assertFalse(Rank.FAMILY().isSpecies());
|
468
|
assertFalse(Rank.ORDER().isSpecies());
|
469
|
assertFalse(Rank.TRIBE().isSpecies());
|
470
|
assertFalse(Rank.SUPRAGENERICTAXON().isSpecies());
|
471
|
assertFalse(Rank.GENUS().isSpecies());
|
472
|
assertFalse(Rank.SUBGENUS().isSpecies());
|
473
|
assertFalse(Rank.INFRAGENUS().isSpecies());
|
474
|
assertFalse(Rank.INFRAGENERICTAXON().isSpecies());
|
475
|
assertFalse(Rank.SPECIESAGGREGATE().isSpecies());
|
476
|
assertTrue(Rank.SPECIES().isSpecies());
|
477
|
assertFalse(Rank.SUBSPECIES().isSpecies());
|
478
|
assertFalse(Rank.CULTIVAR().isSpecies());
|
479
|
}
|
480
|
|
481
|
@Test
|
482
|
public void testIsInfraSpecific() {
|
483
|
assertFalse(Rank.KINGDOM().isInfraSpecific());
|
484
|
assertFalse(Rank.FAMILY().isInfraSpecific());
|
485
|
assertFalse(Rank.ORDER().isInfraSpecific());
|
486
|
assertFalse(Rank.TRIBE().isInfraSpecific());
|
487
|
assertFalse(Rank.SUPRAGENERICTAXON().isInfraSpecific());
|
488
|
assertFalse(Rank.GENUS().isInfraSpecific());
|
489
|
assertFalse(Rank.SUBGENUS().isInfraSpecific());
|
490
|
assertFalse(Rank.INFRAGENUS().isInfraSpecific());
|
491
|
assertFalse(Rank.INFRAGENERICTAXON().isInfraSpecific());
|
492
|
assertFalse(Rank.SPECIESAGGREGATE().isInfraSpecific());
|
493
|
assertFalse(Rank.SPECIES().isInfraSpecific());
|
494
|
assertTrue(Rank.SUBSPECIFICAGGREGATE().isInfraSpecific());
|
495
|
assertTrue(Rank.SUBSPECIES().isInfraSpecific());
|
496
|
assertTrue(Rank.SUBSPECIES().isInfraSpecific());
|
497
|
assertTrue(Rank.SUBSPECIES().isInfraSpecific());
|
498
|
assertTrue(Rank.SUBSPECIES().isInfraSpecific());
|
499
|
assertTrue(Rank.CULTIVAR().isInfraSpecific());
|
500
|
}
|
501
|
|
502
|
@Test
|
503
|
public void testGetRankByNameOrAbbreviation() {
|
504
|
NomenclaturalCode bot = NomenclaturalCode.ICBN;
|
505
|
NomenclaturalCode zoo = NomenclaturalCode.ICZN;
|
506
|
try {
|
507
|
assertEquals(Rank.VARIETY(), Rank.getRankByAbbreviation("var."));
|
508
|
assertEquals(Rank.GENUS(), Rank.getRankByName("genus"));
|
509
|
|
510
|
assertEquals(Rank.SECTION_BOTANY(), Rank.getRankByAbbreviation("sect."));
|
511
|
assertEquals(Rank.SECTION_BOTANY(), Rank.getRankByAbbreviation("sect.", false));
|
512
|
assertEquals(Rank.SECTION_BOTANY(), Rank.getRankByAbbreviation("sect.", bot));
|
513
|
assertEquals(Rank.SECTION_ZOOLOGY(), Rank.getRankByAbbreviation("sect.", zoo));
|
514
|
assertEquals(Rank.SECTION_BOTANY(), Rank.getRankByAbbreviation("sect.", bot, false));
|
515
|
assertEquals(Rank.SECTION_ZOOLOGY(), Rank.getRankByAbbreviation("sect.", zoo, false));
|
516
|
|
517
|
assertEquals(Rank.SECTION_BOTANY(), Rank.getRankByName("Sectio"));
|
518
|
assertEquals(Rank.SECTION_BOTANY(), Rank.getRankByName("Sectio", false));
|
519
|
assertEquals(Rank.SECTION_BOTANY(), Rank.getRankByName("Sectio", bot));
|
520
|
assertEquals(Rank.SECTION_ZOOLOGY(), Rank.getRankByName("Sectio", zoo));
|
521
|
assertEquals(Rank.SECTION_BOTANY(), Rank.getRankByName("Sectio", bot, false));
|
522
|
assertEquals(Rank.SECTION_ZOOLOGY(), Rank.getRankByName("Sectio", zoo, false));
|
523
|
|
524
|
assertEquals(Rank.SUBSECTION_BOTANY(), Rank.getRankByNameOrAbbreviation("Subsectio"));
|
525
|
assertEquals(Rank.SUBSECTION_BOTANY(), Rank.getRankByNameOrAbbreviation("subsect."));
|
526
|
assertEquals(Rank.SUBSECTION_BOTANY(), Rank.getRankByNameOrAbbreviation("Subsectio", false));
|
527
|
assertEquals(Rank.SUBSECTION_BOTANY(), Rank.getRankByNameOrAbbreviation("subsect.", false));
|
528
|
assertEquals(Rank.SUBSECTION_BOTANY(), Rank.getRankByNameOrAbbreviation("Subsectio", bot));
|
529
|
assertEquals(Rank.SUBSECTION_ZOOLOGY(), Rank.getRankByNameOrAbbreviation("subsect.", zoo));
|
530
|
assertEquals(Rank.SUBSECTION_BOTANY(), Rank.getRankByNameOrAbbreviation("Subsectio", bot, false));
|
531
|
assertEquals(Rank.SUBSECTION_ZOOLOGY(), Rank.getRankByNameOrAbbreviation("subsect.", zoo, false));
|
532
|
|
533
|
} catch (UnknownCdmTypeException e) {
|
534
|
fail();
|
535
|
}
|
536
|
logger.warn("Not yet fully implemented");
|
537
|
}
|
538
|
|
539
|
@Test
|
540
|
public void testGetRankByAbbreviation() {
|
541
|
try {
|
542
|
assertEquals(Rank.SPECIES(), Rank.getRankByAbbreviation("sp."));
|
543
|
} catch (UnknownCdmTypeException e) {
|
544
|
fail();
|
545
|
}
|
546
|
logger.warn("Not yet fully implemented");
|
547
|
}
|
548
|
|
549
|
@Test
|
550
|
public void testGetRankByName() {
|
551
|
try {
|
552
|
assertEquals(Rank.SPECIES(), Rank.getRankByName("species"));
|
553
|
// TODO: Cleanup Rank label names and rank to name mapping
|
554
|
//assertEquals(Rank.SUBFAMILY(), Rank.getRankByName("subfamily"));
|
555
|
} catch (UnknownCdmTypeException e) {
|
556
|
fail();
|
557
|
}
|
558
|
logger.warn("Not yet fully implemented");
|
559
|
}
|
560
|
|
561
|
@Test
|
562
|
public void testGetAbbreviation() {
|
563
|
assertEquals("sp.", Rank.SPECIES().getAbbreviation());
|
564
|
logger.warn("Not yet fully implemented");
|
565
|
}
|
566
|
|
567
|
}
|