Revision c561f681
Added by Andreas Müller about 8 years ago
cdmlib-model/src/test/java/eu/etaxonomy/cdm/strategy/parser/NonViralNameParserImplTest.java | ||
---|---|---|
430 | 430 |
*/ |
431 | 431 |
@Test |
432 | 432 |
public final void testHybrids() { |
433 |
try { |
|
434 |
Method parseMethod = parser.getClass().getDeclaredMethod("parseFullName", String.class, NomenclaturalCode.class, Rank.class); |
|
435 |
testName_StringNomcodeRank(parseMethod); |
|
436 |
} catch (Exception e) { |
|
437 |
e.printStackTrace(); |
|
438 |
assertTrue(false); |
|
439 |
} |
|
433 |
NonViralName<?> name1; |
|
434 |
|
|
435 |
|
|
436 |
//Infrageneric hybrid |
|
437 |
name1 = parser.parseFullName("Aegilops nothosubg. Insulae Scholz", botanicCode, null); |
|
438 |
assertTrue("Name must have binom hybrid bit set", name1.isBinomHybrid()); |
|
439 |
assertFalse("Name must not have monom hybrid bit set", name1.isMonomHybrid()); |
|
440 |
assertFalse("Name must not have trinom hybrid bit set", name1.isTrinomHybrid()); |
|
441 |
assertEquals("Infrageneric epithet must be 'Insulae'", "Insulae", name1.getInfraGenericEpithet()); |
|
440 | 442 |
|
441 | 443 |
//Species hybrid |
442 | 444 |
// NonViralName nameTeam1 = parser.parseFullName("Aegilops \u00D7insulae-cypri H. Scholz"); |
443 |
NonViralName<?> name1 = parser.parseFullName("Aegilops \u00D7insulae Scholz", botanicCode, null);
|
|
445 |
name1 = parser.parseFullName("Aegilops \u00D7insulae Scholz", botanicCode, null); |
|
444 | 446 |
assertTrue("Name must have binom hybrid bit set", name1.isBinomHybrid()); |
445 | 447 |
assertFalse("Name must not have monom hybrid bit set", name1.isMonomHybrid()); |
446 | 448 |
assertFalse("Name must not have trinom hybrid bit set", name1.isTrinomHybrid()); |
... | ... | |
453 | 455 |
assertFalse("Name must not have trinom hybrid bit set", name1.isTrinomHybrid()); |
454 | 456 |
assertEquals("Uninomial must be 'Aegilops'", "Aegilops", name1.getGenusOrUninomial()); |
455 | 457 |
|
456 |
//Species hybrid |
|
458 |
//Subspecies hybrid with hybrid sign |
|
459 |
//maybe false: see http://dev.e-taxonomy.eu/trac/ticket/3868 |
|
457 | 460 |
name1 = parser.parseFullName("Aegilops insulae subsp. X abies Scholz", botanicCode, null); |
458 | 461 |
assertFalse("Name must not have monom hybrid bit set", name1.isMonomHybrid()); |
459 | 462 |
assertFalse("Name must not have binom hybrid bit set", name1.isBinomHybrid()); |
460 | 463 |
assertTrue("Name must have trinom hybrid bit set", name1.isTrinomHybrid()); |
461 | 464 |
assertEquals("Infraspecific epithet must be 'abies'", "abies", name1.getInfraSpecificEpithet()); |
462 | 465 |
|
466 |
//Subspecies hybrid with notho / n |
|
467 |
name1 = parser.parseFullName("Aegilops insulae nothosubsp. abies Scholz", botanicCode, null); |
|
468 |
assertFalse("Name must not have monom hybrid bit set", name1.isMonomHybrid()); |
|
469 |
assertFalse("Name must not have binom hybrid bit set", name1.isBinomHybrid()); |
|
470 |
assertFalse("Name must not be protected", name1.isProtectedTitleCache()); |
|
471 |
assertTrue("Name must have trinom hybrid bit set", name1.isTrinomHybrid()); |
|
472 |
assertEquals("Infraspecific epithet must be 'abies'", "abies", name1.getInfraSpecificEpithet()); |
|
473 |
name1 = parser.parseFullName("Aegilops insulae nsubsp. abies Scholz", botanicCode, null); |
|
474 |
assertFalse("Name must not have monom hybrid bit set", name1.isMonomHybrid()); |
|
475 |
assertFalse("Name must not have binom hybrid bit set", name1.isBinomHybrid()); |
|
476 |
assertFalse("Name must not be protected", name1.isProtectedTitleCache()); |
|
477 |
assertTrue("Name must have trinom hybrid bit set", name1.isTrinomHybrid()); |
|
478 |
assertEquals("Infraspecific epithet must be 'abies'", "abies", name1.getInfraSpecificEpithet()); |
|
463 | 479 |
|
464 | 480 |
} |
465 | 481 |
|
Also available in: Unified diff
Implement notho rank recognition #3868