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.strategy.parser;
|
11
|
|
12
|
import static org.junit.Assert.assertEquals;
|
13
|
import static org.junit.Assert.assertFalse;
|
14
|
import static org.junit.Assert.assertNotNull;
|
15
|
import static org.junit.Assert.assertNull;
|
16
|
import static org.junit.Assert.assertTrue;
|
17
|
|
18
|
import java.lang.reflect.InvocationTargetException;
|
19
|
import java.lang.reflect.Method;
|
20
|
import java.util.List;
|
21
|
|
22
|
import org.apache.log4j.Logger;
|
23
|
import org.junit.After;
|
24
|
import org.junit.AfterClass;
|
25
|
import org.junit.Before;
|
26
|
import org.junit.BeforeClass;
|
27
|
import org.junit.Test;
|
28
|
|
29
|
import eu.etaxonomy.cdm.model.agent.INomenclaturalAuthor;
|
30
|
import eu.etaxonomy.cdm.model.agent.Team;
|
31
|
import eu.etaxonomy.cdm.model.common.DefaultTermInitializer;
|
32
|
import eu.etaxonomy.cdm.model.name.BotanicalName;
|
33
|
import eu.etaxonomy.cdm.model.name.NomenclaturalCode;
|
34
|
import eu.etaxonomy.cdm.model.name.NonViralName;
|
35
|
import eu.etaxonomy.cdm.model.name.Rank;
|
36
|
import eu.etaxonomy.cdm.model.name.ZoologicalName;
|
37
|
import eu.etaxonomy.cdm.model.reference.Article;
|
38
|
import eu.etaxonomy.cdm.model.reference.Book;
|
39
|
import eu.etaxonomy.cdm.model.reference.BookSection;
|
40
|
import eu.etaxonomy.cdm.model.reference.INomenclaturalReference;
|
41
|
import eu.etaxonomy.cdm.model.reference.Journal;
|
42
|
import eu.etaxonomy.cdm.model.reference.StrictReferenceBase;
|
43
|
|
44
|
/**
|
45
|
* @author a.mueller
|
46
|
*
|
47
|
*/
|
48
|
public class NonViralNameParserImplTest {
|
49
|
private static final Logger logger = Logger.getLogger(NonViralNameParserImplTest.class);
|
50
|
|
51
|
final private String strNameFamily = "Asteraceae";
|
52
|
final private String strNameGenus = "Abies Mueller";
|
53
|
final private String strNameGenusUnicode = "Abies M\u00FCller";
|
54
|
final private String strNameAbies1 = "Abies alba";
|
55
|
final private String strNameAbiesSub1 = "Abies alba subsp. beta";
|
56
|
final private String strNameAbiesAuthor1 = "Abies alba Mueller";
|
57
|
final private String strNameAbiesAuthor1Unicode = "Abies alba M\u00FCller";
|
58
|
final private String strNameAbiesBasionymAuthor1 = "Abies alba (Ciardelli) D'Mueller";
|
59
|
final private String strNameAbiesBasionymAuthor1Unicode = "Abies alba (Ciardelli) D'M\u00FCller";
|
60
|
final private String strNameAbiesBasionymExAuthor1 ="Abies alba (Ciardelli ex Doering) D'Mueller ex. de Greuther";
|
61
|
final private String strNameAbiesBasionymExAuthor1Unicode ="Abies alba (Ciardelli ex D\u00F6ring) D'M\u00FCller ex. de Greuther";
|
62
|
final private String strNameTeam1 = "Abies alba Mueller & L.";
|
63
|
final private String strNameZoo1 = "Abies alba Mueller & L., 1822";
|
64
|
final private String strNameZoo2 = "Abies alba (Mueller, 1822) Ciardelli, 2002";
|
65
|
|
66
|
final private String strNameEmpty = "";
|
67
|
final private String strNameNull = null;
|
68
|
|
69
|
private NonViralNameParserImpl parser ;
|
70
|
private NomenclaturalCode botanicCode;
|
71
|
|
72
|
/**
|
73
|
* @throws java.lang.Exception
|
74
|
*/
|
75
|
@BeforeClass
|
76
|
public static void setUpBeforeClass() throws Exception {
|
77
|
DefaultTermInitializer termInitializer = new DefaultTermInitializer();
|
78
|
termInitializer.initialize();
|
79
|
}
|
80
|
|
81
|
/**
|
82
|
* @throws java.lang.Exception
|
83
|
*/
|
84
|
@AfterClass
|
85
|
public static void tearDownAfterClass() throws Exception {
|
86
|
}
|
87
|
|
88
|
/**
|
89
|
* @throws java.lang.Exception
|
90
|
*/
|
91
|
@Before
|
92
|
public void setUp() throws Exception {
|
93
|
parser = NonViralNameParserImpl.NewInstance();
|
94
|
botanicCode = NomenclaturalCode.ICBN;
|
95
|
}
|
96
|
|
97
|
/**
|
98
|
* @throws java.lang.Exception
|
99
|
*/
|
100
|
@After
|
101
|
public void tearDown() throws Exception {
|
102
|
}
|
103
|
|
104
|
/*************** TEST *********************************************/
|
105
|
|
106
|
/**
|
107
|
* Test method for {@link eu.etaxonomy.cdm.strategy.parser.NonViralNameParserImpl#NEW_INSTANCE()}.
|
108
|
*/
|
109
|
@Test
|
110
|
public final void testNewInstance() {
|
111
|
assertNotNull(parser);
|
112
|
}
|
113
|
|
114
|
/**
|
115
|
* Test method for {@link eu.etaxonomy.cdm.strategy.parser.NonViralNameParserImpl#TaxonNameParserBotanicalNameImpl()}.
|
116
|
*/
|
117
|
@Test
|
118
|
public final void testTaxonNameParserBotanicalNameImpl() {
|
119
|
logger.warn("Not yet implemented"); // TODO
|
120
|
}
|
121
|
|
122
|
/**
|
123
|
* Test method for {@link eu.etaxonomy.cdm.strategy.parser.NonViralNameParserImpl#parseSimpleName(java.lang.String, eu.etaxonomy.cdm.model.name.Rank)}.
|
124
|
*/
|
125
|
@Test
|
126
|
public final void testParseSimpleName() {
|
127
|
logger.warn("Not yet implemented"); // TODO
|
128
|
}
|
129
|
|
130
|
/**
|
131
|
* Test method for {@link eu.etaxonomy.cdm.strategy.parser.NonViralNameParserImpl#parseSubGenericFullName(java.lang.String)}.
|
132
|
*/
|
133
|
@Test
|
134
|
public final void testParseSubGenericFullName() {
|
135
|
logger.warn("Not yet implemented"); // TODO
|
136
|
}
|
137
|
|
138
|
/**
|
139
|
* Test method for {@link eu.etaxonomy.cdm.strategy.parser.NonViralNameParserImpl#parseSubGenericSimpleName(java.lang.String)}.
|
140
|
*/
|
141
|
@Test
|
142
|
public final void testParseSubGenericSimpleName() {
|
143
|
logger.warn("Not yet implemented"); // TODO
|
144
|
}
|
145
|
|
146
|
/**
|
147
|
* Test method for {@link eu.etaxonomy.cdm.strategy.parser.NonViralNameParserImpl#parseFullName(java.lang.String, eu.etaxonomy.cdm.model.name.Rank)}.
|
148
|
*/
|
149
|
@Test
|
150
|
public final void testParseFullNameUnicode() {
|
151
|
|
152
|
NonViralName nameAuthor = parser.parseFullName(strNameAbiesAuthor1Unicode, null, Rank.SPECIES());
|
153
|
assertEquals("Abies", nameAuthor.getGenusOrUninomial());
|
154
|
assertEquals("alba", nameAuthor.getSpecificEpithet());
|
155
|
assertEquals("M\u00FCller", nameAuthor.getCombinationAuthorTeam().getNomenclaturalTitle());
|
156
|
|
157
|
NonViralName nameBasionymAuthor = parser.parseFullName(strNameAbiesBasionymAuthor1Unicode, null, Rank.SPECIES());
|
158
|
assertEquals("Abies", nameBasionymAuthor.getGenusOrUninomial());
|
159
|
assertEquals("alba", nameBasionymAuthor.getSpecificEpithet());
|
160
|
assertEquals("D'M\u00FCller", nameBasionymAuthor.getCombinationAuthorTeam().getNomenclaturalTitle());
|
161
|
INomenclaturalAuthor basionymTeam = nameBasionymAuthor.getBasionymAuthorTeam();
|
162
|
assertEquals("Ciardelli", basionymTeam.getNomenclaturalTitle());
|
163
|
|
164
|
NonViralName nameBasionymExAuthor = parser.parseFullName(strNameAbiesBasionymExAuthor1Unicode, null, Rank.SPECIES());
|
165
|
assertEquals("Abies", nameBasionymExAuthor.getGenusOrUninomial());
|
166
|
assertEquals("alba", nameBasionymExAuthor.getSpecificEpithet());
|
167
|
assertEquals("D'M\u00FCller", nameBasionymExAuthor.getCombinationAuthorTeam().getNomenclaturalTitle());
|
168
|
assertEquals("de Greuther", nameBasionymExAuthor.getExCombinationAuthorTeam().getNomenclaturalTitle());
|
169
|
INomenclaturalAuthor basionymTeam2 = nameBasionymExAuthor.getBasionymAuthorTeam();
|
170
|
assertEquals("Ciardelli", basionymTeam2.getNomenclaturalTitle());
|
171
|
INomenclaturalAuthor exBasionymTeam2 = nameBasionymExAuthor.getExBasionymAuthorTeam();
|
172
|
assertEquals("D\u00F6ring", exBasionymTeam2.getNomenclaturalTitle());
|
173
|
}
|
174
|
|
175
|
|
176
|
/**
|
177
|
* Test method for {@link eu.etaxonomy.cdm.strategy.parser.NonViralNameParserImpl#parseFullName(java.lang.String, eu.etaxonomy.cdm.model.name.Rank)}.
|
178
|
*/
|
179
|
@Test
|
180
|
public final void testParseFullName() {
|
181
|
try {
|
182
|
Method parseMethod = parser.getClass().getDeclaredMethod("parseFullName", String.class, NomenclaturalCode.class, Rank.class);
|
183
|
testName_StringNomcodeRank(parseMethod);
|
184
|
} catch (Exception e) {
|
185
|
e.printStackTrace();
|
186
|
assertTrue(false);
|
187
|
}
|
188
|
|
189
|
//Team
|
190
|
NonViralName nameTeam1 = parser.parseFullName(strNameTeam1);
|
191
|
assertEquals( "Abies", nameTeam1.getGenusOrUninomial());
|
192
|
assertEquals( "alba", nameTeam1.getSpecificEpithet());
|
193
|
assertEquals("Mueller & L.", nameTeam1.getCombinationAuthorTeam().getNomenclaturalTitle());
|
194
|
assertTrue(nameTeam1.getCombinationAuthorTeam() instanceof Team);
|
195
|
Team team = (Team)nameTeam1.getCombinationAuthorTeam();
|
196
|
assertEquals("Mueller", team.getTeamMembers().get(0).getNomenclaturalTitle());
|
197
|
assertEquals("L.", team.getTeamMembers().get(1).getNomenclaturalTitle());
|
198
|
|
199
|
//ZooName
|
200
|
ZoologicalName nameZoo1 = (ZoologicalName)parser.parseFullName(strNameZoo1);
|
201
|
assertEquals( "Abies", nameZoo1.getGenusOrUninomial());
|
202
|
assertEquals( "alba", nameZoo1.getSpecificEpithet());
|
203
|
assertEquals("Mueller & L.", nameZoo1.getCombinationAuthorTeam().getNomenclaturalTitle());
|
204
|
assertEquals(NomenclaturalCode.ICZN, nameZoo1.getNomenclaturalCode() );
|
205
|
assertEquals(Integer.valueOf(1822), nameZoo1.getPublicationYear());
|
206
|
assertTrue(nameZoo1.getCombinationAuthorTeam() instanceof Team);
|
207
|
Team teamZoo = (Team)nameZoo1.getCombinationAuthorTeam();
|
208
|
assertEquals("Mueller", teamZoo.getTeamMembers().get(0).getNomenclaturalTitle());
|
209
|
assertEquals("L.", teamZoo.getTeamMembers().get(1).getNomenclaturalTitle());
|
210
|
|
211
|
ZoologicalName nameZoo2 = (ZoologicalName)parser.parseFullName(strNameZoo2);
|
212
|
assertEquals(Integer.valueOf(2002), nameZoo2.getPublicationYear());
|
213
|
assertEquals(Integer.valueOf(1822), nameZoo2.getOriginalPublicationYear());
|
214
|
assertEquals("Mueller", nameZoo2.getBasionymAuthorTeam().getNomenclaturalTitle());
|
215
|
assertEquals("Ciardelli", nameZoo2.getCombinationAuthorTeam().getNomenclaturalTitle());
|
216
|
|
217
|
//Autonym
|
218
|
BotanicalName autonymName = (BotanicalName)parser.parseFullName("Abies alba Mill. var. alba", NomenclaturalCode.ICBN, null);
|
219
|
assertFalse("Autonym should be parsable", autonymName.hasProblem());
|
220
|
|
221
|
|
222
|
//empty
|
223
|
NonViralName nameEmpty = parser.parseFullName(strNameEmpty);
|
224
|
assertNotNull(nameEmpty);
|
225
|
assertEquals("", nameEmpty.getTitleCache());
|
226
|
|
227
|
//null
|
228
|
NonViralName nameNull = parser.parseFullName(strNameNull);
|
229
|
assertNull(nameNull);
|
230
|
}
|
231
|
|
232
|
private void testName_StringNomcodeRank(Method parseMethod)
|
233
|
throws InvocationTargetException, IllegalAccessException {
|
234
|
NonViralName name1 = (NonViralName)parseMethod.invoke(parser, strNameAbies1, null, Rank.SPECIES());
|
235
|
//parser.parseFullName(strNameAbies1, null, Rank.SPECIES());
|
236
|
assertEquals("Abies", name1.getGenusOrUninomial());
|
237
|
assertEquals("alba", name1.getSpecificEpithet());
|
238
|
|
239
|
NonViralName nameAuthor = (NonViralName)parseMethod.invoke(parser, strNameAbiesAuthor1, null, Rank.SPECIES());
|
240
|
assertEquals("Abies", nameAuthor.getGenusOrUninomial());
|
241
|
assertEquals("alba", nameAuthor.getSpecificEpithet());
|
242
|
assertEquals("Mueller", nameAuthor.getCombinationAuthorTeam().getNomenclaturalTitle());
|
243
|
|
244
|
NonViralName nameBasionymAuthor = (NonViralName)parseMethod.invoke(parser, strNameAbiesBasionymAuthor1, null, Rank.SPECIES());
|
245
|
assertEquals("Abies", nameBasionymAuthor.getGenusOrUninomial());
|
246
|
assertEquals("alba", nameBasionymAuthor.getSpecificEpithet());
|
247
|
assertEquals("D'Mueller", nameBasionymAuthor.getCombinationAuthorTeam().getNomenclaturalTitle());
|
248
|
assertEquals("Ciardelli", nameBasionymAuthor.getBasionymAuthorTeam().getNomenclaturalTitle());
|
249
|
|
250
|
NonViralName nameBasionymExAuthor = (NonViralName)parseMethod.invoke(parser, strNameAbiesBasionymExAuthor1, null, Rank.SPECIES());
|
251
|
assertEquals("Abies", nameBasionymExAuthor.getGenusOrUninomial());
|
252
|
assertEquals("alba", nameBasionymExAuthor.getSpecificEpithet());
|
253
|
assertEquals("D'Mueller", nameBasionymExAuthor.getCombinationAuthorTeam().getNomenclaturalTitle());
|
254
|
assertEquals("de Greuther", nameBasionymExAuthor.getExCombinationAuthorTeam().getNomenclaturalTitle());
|
255
|
assertEquals("Ciardelli", nameBasionymExAuthor.getBasionymAuthorTeam().getNomenclaturalTitle());
|
256
|
assertEquals("Doering", nameBasionymExAuthor.getExBasionymAuthorTeam().getNomenclaturalTitle());
|
257
|
|
258
|
NonViralName name2 = (NonViralName)parseMethod.invoke(parser, strNameAbiesSub1, null, Rank.SPECIES());
|
259
|
assertEquals("Abies", name2.getGenusOrUninomial());
|
260
|
assertEquals("alba", name2.getSpecificEpithet());
|
261
|
assertEquals("beta", name2.getInfraSpecificEpithet());
|
262
|
assertEquals(Rank.SUBSPECIES(), name2.getRank());
|
263
|
|
264
|
|
265
|
// unparseable *********
|
266
|
String problemString = "sdfjlös wer eer wer";
|
267
|
NonViralName<?> nameProblem = (NonViralName<?>)parseMethod.invoke(parser, problemString, null, Rank.SPECIES());
|
268
|
List<ParserProblem> list = nameProblem.getParsingProblems();
|
269
|
assertTrue(nameProblem.getParsingProblem()!=0);
|
270
|
assertEquals(problemString, nameProblem.getTitleCache());
|
271
|
}
|
272
|
|
273
|
/**
|
274
|
* Test method for {@link eu.etaxonomy.cdm.strategy.parser.NonViralNameParserImpl#parseReferencedName(NonViralName, java.lang.String, eu.etaxonomy.cdm.model.name.Rank, boolean)(, )}.
|
275
|
*/
|
276
|
@Test
|
277
|
public final void testParseReferencedName() {
|
278
|
try {
|
279
|
Method parseMethod = parser.getClass().getDeclaredMethod("parseReferencedName", String.class, NomenclaturalCode.class, Rank.class);
|
280
|
testName_StringNomcodeRank(parseMethod);
|
281
|
} catch (Exception e) {
|
282
|
e.printStackTrace();
|
283
|
assertTrue(false);
|
284
|
}
|
285
|
|
286
|
|
287
|
//null
|
288
|
String strNull = null;
|
289
|
NonViralName<?> nameNull = parser.parseReferencedName(strNull, null, Rank.SPECIES());
|
290
|
assertNull(nameNull);
|
291
|
|
292
|
//Empty
|
293
|
String strEmpty = "";
|
294
|
NonViralName<?> nameEmpty = parser.parseReferencedName(strEmpty, null, Rank.SPECIES());
|
295
|
assertFalse(nameEmpty.hasProblem());
|
296
|
assertEquals(strEmpty, nameEmpty.getFullTitleCache());
|
297
|
assertNull(nameEmpty.getNomenclaturalMicroReference());
|
298
|
|
299
|
|
300
|
//Whitespaces
|
301
|
String strFullWhiteSpcaceAndDot = "Abies alba Mill., Sp. Pl. 4: 455 . 1987 .";
|
302
|
NonViralName<?> namefullWhiteSpcaceAndDot = parser.parseReferencedName(strFullWhiteSpcaceAndDot, null, Rank.SPECIES());
|
303
|
assertFullRefStandard(namefullWhiteSpcaceAndDot);
|
304
|
assertTrue(namefullWhiteSpcaceAndDot.getNomenclaturalReference() instanceof Book);
|
305
|
assertEquals( "Abies alba Mill., Sp. Pl. 4: 455. 1987", namefullWhiteSpcaceAndDot.getFullTitleCache());
|
306
|
|
307
|
//Book
|
308
|
String fullReference = "Abies alba Mill., Sp. Pl. 4: 455. 1987";
|
309
|
NonViralName<?> name1 = parser.parseReferencedName(fullReference, null, Rank.SPECIES());
|
310
|
assertFullRefStandard(name1);
|
311
|
assertTrue(name1.getNomenclaturalReference() instanceof Book);
|
312
|
assertEquals(fullReference, name1.getFullTitleCache());
|
313
|
assertTrue("Name author and reference author should be the same", name1.getCombinationAuthorTeam() == name1.getNomenclaturalReference().getAuthorTeam());
|
314
|
|
315
|
//Book Section
|
316
|
fullReference = "Abies alba Mill. in Otto, Sp. Pl. 4(6): 455. 1987";
|
317
|
NonViralName<?> name2 = parser.parseReferencedName(fullReference + ".", null, Rank.SPECIES());
|
318
|
assertFullRefNameStandard(name2);
|
319
|
assertEquals(fullReference, name2.getFullTitleCache());
|
320
|
assertFalse(name2.hasProblem());
|
321
|
INomenclaturalReference ref = (INomenclaturalReference)name2.getNomenclaturalReference();
|
322
|
assertEquals(BookSection.class, ref.getClass());
|
323
|
BookSection bookSection = (BookSection)ref;
|
324
|
Book inBook = bookSection.getInBook();
|
325
|
assertNotNull(inBook);
|
326
|
assertNotNull(inBook.getAuthorTeam());
|
327
|
assertEquals("Otto", inBook.getAuthorTeam().getTitleCache());
|
328
|
assertEquals("Otto, Sp. Pl. 4(6)", inBook.getTitleCache());
|
329
|
assertEquals("Sp. Pl.", inBook.getTitle());
|
330
|
assertEquals("4(6)", inBook.getVolume());
|
331
|
assertTrue("Name author and reference author should be the same", name2.getCombinationAuthorTeam() == name2.getNomenclaturalReference().getAuthorTeam());
|
332
|
|
333
|
//Article
|
334
|
fullReference = "Abies alba Mill. in Sp. Pl. 4(6): 455. 1987";
|
335
|
NonViralName<?> name3 = parser.parseReferencedName(fullReference, null, Rank.SPECIES());
|
336
|
assertFullRefNameStandard(name3);
|
337
|
assertEquals(fullReference, name3.getFullTitleCache());
|
338
|
assertFalse(name3.hasProblem());
|
339
|
ref = (INomenclaturalReference)name3.getNomenclaturalReference();
|
340
|
assertEquals(Article.class, ref.getClass());
|
341
|
Article article = (Article)ref;
|
342
|
Journal journal = article.getInJournal();
|
343
|
assertNotNull(journal);
|
344
|
//assertEquals("Sp. Pl. 4(6)", inBook.getTitleCache());
|
345
|
assertEquals("Sp. Pl.", journal.getTitleCache());
|
346
|
assertEquals("Sp. Pl.", journal.getTitle());
|
347
|
assertEquals("4(6)", article.getVolume());
|
348
|
assertTrue("Name author and reference author should be the same", name3.getCombinationAuthorTeam() == name3.getNomenclaturalReference().getAuthorTeam());
|
349
|
|
350
|
//SoftArticle - having "," on position > 4
|
351
|
String journalTitle = "Bull. Soc. Bot.France. Louis., Roi";
|
352
|
String yearPart = " 1987 - 1989";
|
353
|
String parsedYear = "1987-1989";
|
354
|
String fullReferenceWithoutYear = "Abies alba Mill. in " + journalTitle + " 4(6): 455.";
|
355
|
fullReference = fullReferenceWithoutYear + yearPart;
|
356
|
String fullReferenceWithEnd = fullReference + ".";
|
357
|
NonViralName<?> name4 = parser.parseReferencedName(fullReferenceWithEnd, null, Rank.SPECIES());
|
358
|
assertFalse(name4.hasProblem());
|
359
|
assertFullRefNameStandard(name4);
|
360
|
assertEquals(fullReferenceWithoutYear + " " + parsedYear, name4.getFullTitleCache());
|
361
|
ref = (INomenclaturalReference)name4.getNomenclaturalReference();
|
362
|
assertEquals(Article.class, ref.getClass());
|
363
|
article = (Article)ref;
|
364
|
assertEquals(parsedYear, ref.getYear());
|
365
|
journal = article.getInJournal();
|
366
|
assertNotNull(journal);
|
367
|
assertEquals(journalTitle, journal.getTitleCache());
|
368
|
assertEquals(journalTitle, journal.getTitle());
|
369
|
assertEquals("4(6)", article.getVolume());
|
370
|
|
371
|
//Zoo name
|
372
|
String strNotParsableZoo = "Abies alba M., 1923, Sp. P. xxwer4352, nom. inval.";
|
373
|
ZoologicalName nameZooRefNotParsabel = (ZoologicalName)parser.parseReferencedName(strNotParsableZoo, null, null);
|
374
|
assertTrue(nameZooRefNotParsabel.hasProblem());
|
375
|
List<ParserProblem> list = nameZooRefNotParsabel.getParsingProblems();
|
376
|
assertTrue("List must contain detail and year warning ", list.contains(ParserProblem.CheckDetailOrYear));
|
377
|
assertEquals(21, nameZooRefNotParsabel.getProblemStarts());
|
378
|
assertEquals(37, nameZooRefNotParsabel.getProblemEnds());
|
379
|
assertTrue(nameZooRefNotParsabel.getNomenclaturalReference().hasProblem());
|
380
|
list = nameZooRefNotParsabel.getNomenclaturalReference().getParsingProblems();
|
381
|
assertTrue("List must contain detail and year warning ", list.contains(ParserProblem.CheckDetailOrYear));
|
382
|
|
383
|
assertEquals(NomenclaturalCode.ICZN, nameZooRefNotParsabel.getNomenclaturalCode());
|
384
|
assertEquals(Integer.valueOf(1923), nameZooRefNotParsabel.getPublicationYear());
|
385
|
assertEquals(1, nameZooRefNotParsabel.getStatus().size());
|
386
|
|
387
|
//Special MicroRefs
|
388
|
String strSpecDetail1 = "Abies alba Mill. in Sp. Pl. 4(6): [455]. 1987";
|
389
|
NonViralName<?> nameSpecDet1 = parser.parseReferencedName(strSpecDetail1 + ".", null, Rank.SPECIES());
|
390
|
assertFalse(nameSpecDet1.hasProblem());
|
391
|
assertEquals(strSpecDetail1, nameSpecDet1.getFullTitleCache());
|
392
|
assertEquals("[455]", nameSpecDet1.getNomenclaturalMicroReference());
|
393
|
|
394
|
//Special MicroRefs
|
395
|
String strSpecDetail2 = "Abies alba Mill. in Sp. Pl. 4(6): couv. 2. 1987";
|
396
|
NonViralName<?> nameSpecDet2 = parser.parseReferencedName(strSpecDetail2 + ".", null, Rank.SPECIES());
|
397
|
assertFalse(nameSpecDet2.hasProblem());
|
398
|
assertEquals(strSpecDetail2, nameSpecDet2.getFullTitleCache());
|
399
|
assertEquals("couv. 2", nameSpecDet2.getNomenclaturalMicroReference());
|
400
|
|
401
|
//Special MicroRefs
|
402
|
String strSpecDetail3 = "Abies alba Mill. in Sp. Pl. 4(6): fig. 455. 1987";
|
403
|
NonViralName<?> nameSpecDet3 = parser.parseReferencedName(strSpecDetail3 + ".", null, Rank.SPECIES());
|
404
|
assertFalse(nameSpecDet3.hasProblem());
|
405
|
assertEquals(strSpecDetail3, nameSpecDet3.getFullTitleCache());
|
406
|
assertEquals("fig. 455", nameSpecDet3.getNomenclaturalMicroReference());
|
407
|
|
408
|
//Special MicroRefs
|
409
|
String strSpecDetail4 = "Abies alba Mill. in Sp. Pl. 4(6): fig. 455-567. 1987";
|
410
|
fullReference = strSpecDetail4 + ".";
|
411
|
NonViralName<?> nameSpecDet4 = parser.parseReferencedName(fullReference, null, Rank.SPECIES());
|
412
|
assertFalse(nameSpecDet4.hasProblem());
|
413
|
assertEquals(strSpecDetail4, nameSpecDet4.getFullTitleCache());
|
414
|
assertEquals("fig. 455-567", nameSpecDet4.getNomenclaturalMicroReference());
|
415
|
|
416
|
|
417
|
//Special MicroRefs
|
418
|
String strSpecDetail5 = "Abies alba Mill. in Sp. Pl. 4(6): Gard n\u00B0 4. 1987";
|
419
|
fullReference = strSpecDetail5 + ".";
|
420
|
NonViralName<?> nameSpecDet5 = parser.parseReferencedName(fullReference, null, Rank.SPECIES());
|
421
|
assertFalse(nameSpecDet5.hasProblem());
|
422
|
assertEquals(strSpecDetail5, nameSpecDet5.getFullTitleCache());
|
423
|
assertEquals("Gard n\u00B0 4", nameSpecDet5.getNomenclaturalMicroReference());
|
424
|
|
425
|
//Special MicroRefs
|
426
|
String strSpecDetail6 = "Abies alba Mill. in Sp. Pl. 4(6): 455a. 1987";
|
427
|
fullReference = strSpecDetail6 + ".";
|
428
|
NonViralName<?> nameSpecDet6 = parser.parseReferencedName(fullReference, null, Rank.SPECIES());
|
429
|
assertFalse(nameSpecDet6.hasProblem());
|
430
|
assertEquals(strSpecDetail6, nameSpecDet6.getFullTitleCache());
|
431
|
assertEquals("455a", nameSpecDet6.getNomenclaturalMicroReference());
|
432
|
|
433
|
//Special MicroRefs
|
434
|
String strSpecDetail7 = "Abies alba Mill. in Sp. Pl. 4(6): pp.455-457. 1987";
|
435
|
fullReference = strSpecDetail7 + ".";
|
436
|
NonViralName<?> nameSpecDet7 = parser.parseReferencedName(fullReference, null, Rank.SPECIES());
|
437
|
assertFalse(nameSpecDet7.hasProblem());
|
438
|
assertEquals(strSpecDetail7, nameSpecDet7.getFullTitleCache());
|
439
|
assertEquals("pp.455-457", nameSpecDet7.getNomenclaturalMicroReference());
|
440
|
|
441
|
//Special MicroRefs
|
442
|
String strSpecDetail8 = "Abies alba Mill. in Sp. Pl. 4(6): ppp.455-457. 1987";
|
443
|
NonViralName<?> nameSpecDet8 = parser.parseReferencedName(strSpecDetail8, null, Rank.SPECIES());
|
444
|
assertTrue(nameSpecDet8.hasProblem());
|
445
|
assertEquals(20, nameSpecDet8.getProblemStarts()); //TODO better start behind :
|
446
|
assertEquals(51, nameSpecDet8.getProblemEnds()); //TODO better stop after -457
|
447
|
|
448
|
|
449
|
//Special MicroRefs
|
450
|
String strSpecDetail9 = "Abies alba Mill. in Sp. Pl. 4(6): pp. 455 - 457. 1987";
|
451
|
NonViralName<?> nameSpecDet9 = parser.parseReferencedName(strSpecDetail9, null, Rank.SPECIES());
|
452
|
assertFalse(nameSpecDet9.hasProblem());
|
453
|
assertEquals(strSpecDetail9, nameSpecDet9.getFullTitleCache());
|
454
|
assertEquals("pp. 455 - 457", nameSpecDet9.getNomenclaturalMicroReference());
|
455
|
|
456
|
//Special MicroRefs
|
457
|
String strSpecDetail10 = "Abies alba Mill. in Sp. Pl. 4(6): p 455. 1987";
|
458
|
NonViralName<?> nameSpecDet10 = parser.parseReferencedName(strSpecDetail10, null, Rank.SPECIES());
|
459
|
assertFalse(nameSpecDet10.hasProblem());
|
460
|
assertEquals(strSpecDetail10, nameSpecDet10.getFullTitleCache());
|
461
|
assertEquals("p 455", nameSpecDet10.getNomenclaturalMicroReference());
|
462
|
|
463
|
//Special MicroRefs
|
464
|
String strSpecDetail11 = "Abies alba Mill. in Sp. Pl. 4(6): p. 455 - 457. 1987";
|
465
|
NonViralName<?> nameSpecDet11 = parser.parseReferencedName(strSpecDetail11, null, Rank.SPECIES());
|
466
|
assertTrue(nameSpecDet11.hasProblem());
|
467
|
list = nameSpecDet11.getParsingProblems();
|
468
|
assertTrue("Problem is Detail. Must be pp.", list.contains(ParserProblem.CheckDetailOrYear));
|
469
|
assertEquals(20, nameSpecDet8.getProblemStarts()); //TODO better start behind :
|
470
|
assertEquals(51, nameSpecDet8.getProblemEnds()); //TODO better stop after - 457
|
471
|
|
472
|
|
473
|
//no volume, no edition
|
474
|
String strNoVolume = "Abies alba Mill., Sp. Pl.: 455. 1987";
|
475
|
NonViralName<?> nameNoVolume = parser.parseReferencedName(strNoVolume, null, Rank.SPECIES());
|
476
|
assertFalse(nameNoVolume.hasProblem());
|
477
|
assertEquals(strNoVolume, nameNoVolume.getFullTitleCache());
|
478
|
assertEquals(null, ((Book)nameNoVolume.getNomenclaturalReference()).getVolume());
|
479
|
assertEquals(null, ((Book)nameNoVolume.getNomenclaturalReference()).getEdition());
|
480
|
|
481
|
//volume, no edition
|
482
|
strNoVolume = "Abies alba Mill., Sp. Pl. 2: 455. 1987";
|
483
|
nameNoVolume = parser.parseReferencedName(strNoVolume, null, Rank.SPECIES());
|
484
|
assertFalse(nameNoVolume.hasProblem());
|
485
|
assertEquals(strNoVolume, nameNoVolume.getFullTitleCache());
|
486
|
assertEquals("2", ((Book)nameNoVolume.getNomenclaturalReference()).getVolume());
|
487
|
assertEquals(null, ((Book)nameNoVolume.getNomenclaturalReference()).getEdition());
|
488
|
|
489
|
//no volume, edition
|
490
|
strNoVolume = "Abies alba Mill., Sp. Pl. ed. 3: 455. 1987";
|
491
|
nameNoVolume = parser.parseReferencedName(strNoVolume, null, Rank.SPECIES());
|
492
|
assertFalse(nameNoVolume.hasProblem());
|
493
|
assertEquals(strNoVolume, nameNoVolume.getFullTitleCache());
|
494
|
assertEquals(null, ((Book)nameNoVolume.getNomenclaturalReference()).getVolume());
|
495
|
assertEquals("3", ((Book)nameNoVolume.getNomenclaturalReference()).getEdition());
|
496
|
|
497
|
//volume, edition
|
498
|
strNoVolume = "Abies alba Mill., Sp. Pl. ed. 3, 4(5): 455. 1987";
|
499
|
nameNoVolume = parser.parseReferencedName(strNoVolume, null, Rank.SPECIES());
|
500
|
assertFalse(nameNoVolume.hasProblem());
|
501
|
assertEquals(strNoVolume, nameNoVolume.getFullTitleCache());
|
502
|
assertEquals("4(5)", ((Book)nameNoVolume.getNomenclaturalReference()).getVolume());
|
503
|
assertEquals("3", ((Book)nameNoVolume.getNomenclaturalReference()).getEdition());
|
504
|
|
505
|
String strUnparsableInRef = "Abies alba Mill. in -er46: 455. 1987";
|
506
|
NonViralName<?> nameUnparsableInRef = parser.parseReferencedName(strUnparsableInRef, null, Rank.SPECIES());
|
507
|
assertTrue(nameUnparsableInRef.hasProblem());
|
508
|
list = nameUnparsableInRef.getParsingProblems();
|
509
|
assertTrue("Unparsable title", list.contains(ParserProblem.UnparsableReferenceTitle));
|
510
|
assertEquals(strUnparsableInRef, nameUnparsableInRef.getFullTitleCache());
|
511
|
assertEquals(20, nameUnparsableInRef.getProblemStarts());
|
512
|
assertEquals(25, nameUnparsableInRef.getProblemEnds());
|
513
|
|
514
|
|
515
|
//volume, edition
|
516
|
String strNoSeparator = "Abies alba Mill. Sp. Pl. ed. 3, 4(5): 455. 1987";
|
517
|
NonViralName<?> nameNoSeparator = parser.parseReferencedName(strNoSeparator, NomenclaturalCode.ICBN, Rank.SPECIES());
|
518
|
assertTrue(nameNoSeparator.hasProblem());
|
519
|
list = nameNoSeparator.getParsingProblems();
|
520
|
assertTrue("Problem is missing name-reference separator", list.contains(ParserProblem.NameReferenceSeparation));
|
521
|
assertEquals(strNoSeparator, nameNoSeparator.getFullTitleCache());
|
522
|
assertEquals(10, nameNoSeparator.getProblemStarts()); //TODO better start behind Mill. (?)
|
523
|
assertEquals(47, nameNoSeparator.getProblemEnds()); //TODO better stop before :
|
524
|
|
525
|
String strUnparsableInRef2 = "Hieracium pepsicum L., My Bookkkk 1. 1903";
|
526
|
NonViralName<?> nameUnparsableInRef2 = parser.parseReferencedName(strUnparsableInRef2, null, Rank.SPECIES());
|
527
|
assertTrue(nameUnparsableInRef2.hasProblem());
|
528
|
list = nameUnparsableInRef2.getParsingProblems();
|
529
|
assertTrue("Problem detail", list.contains(ParserProblem.CheckDetailOrYear));
|
530
|
assertEquals(strUnparsableInRef2, nameUnparsableInRef2.getFullTitleCache());
|
531
|
assertEquals(23, nameUnparsableInRef2.getProblemStarts());
|
532
|
assertEquals(41, nameUnparsableInRef2.getProblemEnds());
|
533
|
|
534
|
|
535
|
String strUnparsableInRef3 = "Hieracium pespcim N., My Bookkkk 1. 1902";
|
536
|
NonViralName<?> nameUnparsableInRef3 = parser.parseReferencedName(strUnparsableInRef3, null, null);
|
537
|
assertTrue(nameUnparsableInRef3.hasProblem());
|
538
|
list = nameUnparsableInRef3.getParsingProblems();
|
539
|
assertTrue("Problem detail", list.contains(ParserProblem.CheckDetailOrYear));
|
540
|
assertEquals(strUnparsableInRef3, nameUnparsableInRef3.getFullTitleCache());
|
541
|
assertEquals(22, nameUnparsableInRef3.getProblemStarts());
|
542
|
assertEquals(40, nameUnparsableInRef3.getProblemEnds());
|
543
|
|
544
|
String strUnparsableInRef4 = "Hieracium pepsicum (Hsllreterto) L., My Bookkkk 1. 1903";
|
545
|
NonViralName<?> nameUnparsableInRef4 = parser.parseReferencedName(strUnparsableInRef4, null, null);
|
546
|
assertTrue(nameUnparsableInRef4.hasProblem());
|
547
|
list = nameUnparsableInRef4.getParsingProblems();
|
548
|
assertTrue("Problem detail", list.contains(ParserProblem.CheckDetailOrYear));
|
549
|
assertEquals(strUnparsableInRef4, nameUnparsableInRef4.getFullTitleCache());
|
550
|
assertEquals(37, nameUnparsableInRef4.getProblemStarts());
|
551
|
assertEquals(55, nameUnparsableInRef4.getProblemEnds());
|
552
|
|
553
|
String strSameName = "Hieracium pepcum (Hsllreterto) L., My Bokkk 1. 1903";
|
554
|
NonViralName<?> nameSameName = nameUnparsableInRef4;
|
555
|
parser.parseReferencedName(nameSameName, strSameName, null, true);
|
556
|
assertTrue(nameSameName.hasProblem());
|
557
|
list = nameSameName.getParsingProblems();
|
558
|
assertTrue("Problem detail", list.contains(ParserProblem.CheckDetailOrYear));
|
559
|
assertEquals(strSameName, nameSameName.getFullTitleCache());
|
560
|
assertEquals(35, nameSameName.getProblemStarts());
|
561
|
assertEquals(51, nameSameName.getProblemEnds());
|
562
|
|
563
|
String strGenusUnparse = "Hieracium L., jlklk";
|
564
|
NonViralName<?> nameGenusUnparse =
|
565
|
parser.parseReferencedName(strGenusUnparse, null, null);
|
566
|
assertTrue(nameGenusUnparse.hasProblem());
|
567
|
list = nameGenusUnparse.getParsingProblems();
|
568
|
assertTrue("Problem detail", list.contains(ParserProblem.CheckDetailOrYear));
|
569
|
assertTrue("Problem uninomial", list.contains(ParserProblem.CheckRank));
|
570
|
assertEquals(strGenusUnparse, nameGenusUnparse.getFullTitleCache());
|
571
|
assertEquals(0, nameGenusUnparse.getProblemStarts());
|
572
|
assertEquals(19, nameGenusUnparse.getProblemEnds());
|
573
|
|
574
|
String strGenusUnparse2 = "Hieracium L., Per Luigi: 44. 1987";
|
575
|
NonViralName<?> nameGenusUnparse2 =
|
576
|
parser.parseReferencedName(strGenusUnparse2, null, Rank.FAMILY());
|
577
|
assertFalse(nameGenusUnparse2.hasProblem());
|
578
|
assertEquals(strGenusUnparse2, nameGenusUnparse2.getFullTitleCache());
|
579
|
assertEquals(-1, nameGenusUnparse2.getProblemStarts());
|
580
|
assertEquals(-1, nameGenusUnparse2.getProblemEnds());
|
581
|
|
582
|
String strBookSection2 = "Hieracium vulgatum subsp. acuminatum (Jord.) Zahn in Schinz & Keller, Fl. Schweiz, ed. 2, 2: 288. 1905-1907";
|
583
|
String strBookSection2NoComma = "Hieracium vulgatum subsp. acuminatum (Jord.) Zahn in Schinz & Keller, Fl. Schweiz ed. 2, 2: 288. 1905-1907";
|
584
|
NonViralName<?> nameBookSection2 =
|
585
|
parser.parseReferencedName(strBookSection2, null, null);
|
586
|
assertFalse(nameBookSection2.hasProblem());
|
587
|
assertEquals(strBookSection2NoComma, nameBookSection2.getFullTitleCache());
|
588
|
assertEquals(-1, nameBookSection2.getProblemStarts());
|
589
|
assertEquals(-1, nameBookSection2.getProblemEnds());
|
590
|
assertNull(((BookSection)nameBookSection2.getNomenclaturalReference()).getDatePublished().getStart());
|
591
|
assertEquals("1905-1907", ((BookSection)nameBookSection2.getNomenclaturalReference()).getInBook().getDatePublished().getYear());
|
592
|
|
593
|
|
594
|
String strBookSection = "Hieracium vulgatum subsp. acuminatum (Jord.) Zahn in Schinz & Keller, Fl. Schweiz ed. 2, 2: 288. 1905";
|
595
|
NonViralName<?> nameBookSection =
|
596
|
parser.parseReferencedName(strBookSection, null, null);
|
597
|
assertFalse(nameBookSection.hasProblem());
|
598
|
assertEquals(strBookSection, nameBookSection.getFullTitleCache());
|
599
|
assertEquals(-1, nameBookSection.getProblemStarts());
|
600
|
assertEquals(-1, nameBookSection.getProblemEnds());
|
601
|
assertNull(((BookSection)nameBookSection.getNomenclaturalReference()).getInBook().getDatePublished().getStart());
|
602
|
assertEquals("1905", ((BookSection)nameBookSection.getNomenclaturalReference()).getDatePublished().getYear());
|
603
|
|
604
|
String strXXXs = "Abies alba, Soer der 1987";
|
605
|
NonViralName<?> problemName = parser.parseReferencedName(strXXXs, null, null);
|
606
|
assertTrue(problemName.hasProblem());
|
607
|
list = problemName.getParsingProblems();
|
608
|
assertTrue("Problem must be name-reference separation", list.contains(ParserProblem.NameReferenceSeparation));
|
609
|
parser.parseReferencedName(problemName, strBookSection, null, true);
|
610
|
assertFalse(problemName.hasProblem());
|
611
|
|
612
|
problemName = parser.parseFullName(strXXXs, null, null);
|
613
|
assertTrue(problemName.hasProblem());
|
614
|
list = problemName.getParsingProblems();
|
615
|
assertTrue("Name part must be unparsable", list.contains(ParserProblem.UnparsableNamePart));
|
616
|
|
617
|
|
618
|
String testParsable = "Pithecellobium macrostachyum Benth.";
|
619
|
assertTrue(isParsable(testParsable, NomenclaturalCode.ICBN));
|
620
|
|
621
|
testParsable = "Pithecellobium macrostachyum (Benth.)";
|
622
|
assertTrue(isParsable(testParsable, NomenclaturalCode.ICBN));
|
623
|
|
624
|
testParsable = "Pithecellobium macrostachyum (Benth., 1845)";
|
625
|
assertTrue(isParsable(testParsable, NomenclaturalCode.ICZN));
|
626
|
|
627
|
testParsable = "Pithecellobium macrostachyum L., Sp. Pl. 3: n\u00B0 123. 1753."; //00B0 is degree character
|
628
|
assertTrue(isParsable(testParsable, NomenclaturalCode.ICBN));
|
629
|
|
630
|
testParsable = "Hieracium lachenalii subsp. acuminatum (Jord.) Zahn in Hegi, Ill. Fl. Mitt.-Eur. 6: 1285. 1929";
|
631
|
assertTrue("Reference title should support special characters as separators like - and &", isParsable(testParsable, NomenclaturalCode.ICBN));
|
632
|
|
633
|
testParsable = "Hieracium lachenalii subsp. acuminatum (Jord.) Zahn in Hegi, Ill. Fl. Mitt.&Eur. 6: 1285. 1929";
|
634
|
assertTrue("Reference title should support special characters as separators like - and &", isParsable(testParsable, NomenclaturalCode.ICBN));
|
635
|
|
636
|
testParsable = "Hieracium lachenalii subsp. acuminatum (Jord.) Zahn in Hegi, Ill. Fl. Mitt.-Eur.& 6: 1285. 1929";
|
637
|
assertFalse("Reference title should not support special characters like - and & at the end of the title", isParsable(testParsable, NomenclaturalCode.ICBN));
|
638
|
assertTrue("Problem must be reference title", getProblems(testParsable, NomenclaturalCode.ICBN).
|
639
|
contains(ParserProblem.UnparsableReferenceTitle));
|
640
|
|
641
|
testParsable = "Hieracium lachenalii subsp. acuminatum (Jord.) Zahn in Hegi, Ill. Fl. Mitt.:Eur. 6: 1285. 1929";
|
642
|
assertFalse("Reference title should not support detail separator", isParsable(testParsable, NomenclaturalCode.ICBN));
|
643
|
assertTrue("Problem must be reference title", getProblems(testParsable, NomenclaturalCode.ICBN).
|
644
|
contains(ParserProblem.UnparsableReferenceTitle));
|
645
|
|
646
|
testParsable = "Hieracium lachenalii subsp. acuminatum (Jord.) Zahn in Hegi, Ill. Fl. (Mitt.) 6: 1285. 1929";
|
647
|
assertTrue("Reference title should support brackets", isParsable(testParsable, NomenclaturalCode.ICBN));
|
648
|
|
649
|
testParsable = "Hieracium lachenalii subsp. acuminatum (Jord.) Zahn in Hegi, Ill. Fl. (Mitt.) 6: 1285. 1929";
|
650
|
assertTrue("Reference title should support brackets", isParsable(testParsable, NomenclaturalCode.ICBN));
|
651
|
|
652
|
testParsable = "Hieracium lachenalii Zahn, nom. illeg.";
|
653
|
assertTrue("Reference should not be obligatory if a nom status exist", isParsable(testParsable, NomenclaturalCode.ICBN));
|
654
|
|
655
|
testParsable = "Hieracium lachenalii, nom. illeg.";
|
656
|
assertTrue("Authorship should not be obligatory if followed by nom status", isParsable(testParsable, NomenclaturalCode.ICBN));
|
657
|
|
658
|
testParsable = "Hieracium lachenalii, Ill. Fl. (Mitt.) 6: 1285. 1929";
|
659
|
assertFalse("Author is obligatory if followed by reference", isParsable(testParsable, NomenclaturalCode.ICBN));
|
660
|
assertTrue("Problem must be name-reference separation", getProblems(testParsable, NomenclaturalCode.ICBN).
|
661
|
contains(ParserProblem.NameReferenceSeparation));
|
662
|
|
663
|
testParsable = "Hieracium lachenalii in Hegi, Ill. Fl. (Mitt.) 6: 1285. 1929";
|
664
|
assertFalse("Author is obligatory if followed by reference", isParsable(testParsable, NomenclaturalCode.ICBN));
|
665
|
assertTrue("Problem must be name-reference separation", getProblems(testParsable, NomenclaturalCode.ICBN).
|
666
|
contains(ParserProblem.NameReferenceSeparation));
|
667
|
|
668
|
testParsable = "Abies alba Mill. var. alba";
|
669
|
assertTrue("Autonym problem", isParsable(testParsable, NomenclaturalCode.ICBN));
|
670
|
|
671
|
}
|
672
|
|
673
|
/**
|
674
|
* @param testParsable
|
675
|
* @param icbn
|
676
|
* @return
|
677
|
*/
|
678
|
private List<ParserProblem> getProblems(String string, NomenclaturalCode code) {
|
679
|
List<ParserProblem> result;
|
680
|
result = parser.parseReferencedName(string, code, null).getParsingProblems();
|
681
|
return result;
|
682
|
}
|
683
|
|
684
|
private boolean isParsable(String string, NomenclaturalCode code){
|
685
|
NonViralName<?> name = parser.parseReferencedName(string, code, null);
|
686
|
return ! name.hasProblem();
|
687
|
}
|
688
|
|
689
|
private void assertFullRefNameStandard(NonViralName<?> name){
|
690
|
assertEquals("Abies", name.getGenusOrUninomial());
|
691
|
assertEquals("alba", name.getSpecificEpithet());
|
692
|
assertEquals("Mill.", name.getAuthorshipCache());
|
693
|
assertEquals("455", name.getNomenclaturalMicroReference());
|
694
|
assertNotNull(name.getNomenclaturalReference());
|
695
|
}
|
696
|
|
697
|
private void assertFullRefStandard(NonViralName<?> name){
|
698
|
assertEquals("Abies", name.getGenusOrUninomial());
|
699
|
assertEquals("alba", name.getSpecificEpithet());
|
700
|
assertEquals("Mill.", name.getAuthorshipCache());
|
701
|
assertEquals("455", name.getNomenclaturalMicroReference());
|
702
|
assertNotNull(name.getNomenclaturalReference());
|
703
|
INomenclaturalReference ref = (INomenclaturalReference)name.getNomenclaturalReference();
|
704
|
assertEquals("1987", ref.getYear());
|
705
|
StrictReferenceBase refBase = (StrictReferenceBase)ref;
|
706
|
assertEquals("Sp. Pl.", refBase.getTitle());
|
707
|
}
|
708
|
|
709
|
/**
|
710
|
* Test method for {@link eu.etaxonomy.cdm.strategy.parser.NonViralNameParserImpl#fullTeams(java.lang.String)}.
|
711
|
*/
|
712
|
@Test
|
713
|
public final void testFullTeams() {
|
714
|
logger.warn("Not yet implemented"); // TODO
|
715
|
}
|
716
|
|
717
|
/**
|
718
|
* Test method for {@link eu.etaxonomy.cdm.strategy.parser.NonViralNameParserImpl#authorTeamAndEx(java.lang.String)}.
|
719
|
*/
|
720
|
@Test
|
721
|
public final void testAuthorTeamAndEx() {
|
722
|
logger.warn("Not yet implemented"); // TODO
|
723
|
}
|
724
|
|
725
|
/**
|
726
|
* Test method for {@link eu.etaxonomy.cdm.strategy.parser.NonViralNameParserImpl#authorTeam(java.lang.String)}.
|
727
|
*/
|
728
|
@Test
|
729
|
public final void testAuthorTeam() {
|
730
|
logger.warn("Not yet implemented"); // TODO
|
731
|
}
|
732
|
|
733
|
/**
|
734
|
* Test method for {@link eu.etaxonomy.cdm.strategy.parser.NonViralNameParserImpl#parseCultivar(java.lang.String)}.
|
735
|
*/
|
736
|
@Test
|
737
|
public final void testParseCultivar() {
|
738
|
logger.warn("Not yet implemented"); // TODO
|
739
|
}
|
740
|
|
741
|
}
|