Revision fe34a9eb
Added by Andreas Müller about 7 years ago
cdmlib-model/src/test/java/eu/etaxonomy/cdm/strategy/cache/name/NonViralNameDefaultCacheStrategyTest.java | ||
---|---|---|
88 | 88 |
familyName = TaxonNameBase.PARSED_BOTANICAL(familyNameString, Rank.FAMILY()); |
89 | 89 |
genusName = TaxonNameBase.PARSED_BOTANICAL(genusNameString, Rank.GENUS()); |
90 | 90 |
|
91 |
subGenusName = TaxonNameBase.NewBotanicalInstance(Rank.SUBGENUS());
|
|
91 |
subGenusName = TaxonNameFactory.NewBotanicalInstance(Rank.SUBGENUS());
|
|
92 | 92 |
subGenusName.setGenusOrUninomial("Genus"); |
93 | 93 |
subGenusName.setInfraGenericEpithet("InfraGenericPart"); |
94 | 94 |
|
... | ... | |
132 | 132 |
|
133 | 133 |
@Test |
134 | 134 |
public void testGattungsAutonyme() { |
135 |
BotanicalName botName = TaxonNameBase.NewBotanicalInstance(Rank.SECTION_BOTANY());
|
|
135 |
BotanicalName botName = TaxonNameFactory.NewBotanicalInstance(Rank.SECTION_BOTANY());
|
|
136 | 136 |
String strTaraxacum = "Traxacum"; |
137 | 137 |
botName.setGenusOrUninomial(strTaraxacum); |
138 | 138 |
botName.setInfraGenericEpithet(strTaraxacum); |
... | ... | |
154 | 154 |
assertEquals("Species Name should be Any species", "Any species", speciesName.getNameCache()); |
155 | 155 |
assertEquals("Species Name should be Any species", "Any species", speciesName.getTitleCache()); |
156 | 156 |
assertEquals("subSpeciesNameString should be correct", subSpeciesNameString, subSpeciesName.getNameCache()); |
157 |
BotanicalName botName = TaxonNameBase.NewBotanicalInstance(Rank.VARIETY());
|
|
157 |
BotanicalName botName = TaxonNameFactory.NewBotanicalInstance(Rank.VARIETY());
|
|
158 | 158 |
botName.setGenusOrUninomial("Lepidocaryum"); |
159 | 159 |
botName.setSpecificEpithet("tenue"); |
160 | 160 |
botName.setInfraSpecificEpithet("tenue"); |
161 | 161 |
assertEquals("", "Lepidocaryum tenue var. tenue", botName.getNameCache()); |
162 |
BotanicalName specName = TaxonNameBase.NewBotanicalInstance(Rank.SPECIES());
|
|
162 |
BotanicalName specName = TaxonNameFactory.NewBotanicalInstance(Rank.SPECIES());
|
|
163 | 163 |
specName.setGenusOrUninomial("Genus"); |
164 | 164 |
specName.setSpecificEpithet(""); |
165 | 165 |
assertEquals("Empty species string must not result in trailing whitespace", "Genus", specName.getNameCache()); |
166 | 166 |
|
167 | 167 |
//unranked taxa |
168 | 168 |
String unrankedCache; |
169 |
BotanicalName unrankedName = TaxonNameBase.NewBotanicalInstance(Rank.INFRASPECIFICTAXON());
|
|
169 |
BotanicalName unrankedName = TaxonNameFactory.NewBotanicalInstance(Rank.INFRASPECIFICTAXON());
|
|
170 | 170 |
unrankedName.setGenusOrUninomial("Genus"); |
171 | 171 |
NonViralNameDefaultCacheStrategy<BotanicalName> strategy = NonViralNameDefaultCacheStrategy.NewInstance(); |
172 | 172 |
//infraspecific |
... | ... | |
185 | 185 |
Assert.assertEquals("Correct unranked cache expected", "Genus [unranked] Infrageneric", unrankedCache); |
186 | 186 |
|
187 | 187 |
//bot. specific ranks |
188 |
botName = TaxonNameBase.NewBotanicalInstance(Rank.SECTION_BOTANY());
|
|
188 |
botName = TaxonNameFactory.NewBotanicalInstance(Rank.SECTION_BOTANY());
|
|
189 | 189 |
botName.setGenusOrUninomial("Genus"); |
190 | 190 |
botName.setInfraGenericEpithet("Infragenus"); |
191 | 191 |
Assert.assertEquals("", "Genus sect. Infragenus", botName.getNameCache()); |
... | ... | |
210 | 210 |
speciesName.setInfraGenericEpithet("Infraabies"); |
211 | 211 |
assertEquals("Species Name should be Abies (Infraabies) alba", "Abies (Infraabies) alba", speciesName.getNameCache()); |
212 | 212 |
|
213 |
BotanicalName botName = TaxonNameBase.NewBotanicalInstance(Rank.VARIETY());
|
|
213 |
BotanicalName botName = TaxonNameFactory.NewBotanicalInstance(Rank.VARIETY());
|
|
214 | 214 |
botName.setGenusOrUninomial("Lepidocaryum"); |
215 | 215 |
botName.setInfraGenericEpithet("Infralepi"); |
216 | 216 |
botName.setSpecificEpithet("tenue"); |
... | ... | |
584 | 584 |
*/ |
585 | 585 |
@Test |
586 | 586 |
public void testGetTaggedNameSpeciesAggregate() { |
587 |
BotanicalName speciesAggregate = TaxonNameBase.NewBotanicalInstance(Rank.SPECIESAGGREGATE());
|
|
587 |
BotanicalName speciesAggregate = TaxonNameFactory.NewBotanicalInstance(Rank.SPECIESAGGREGATE());
|
|
588 | 588 |
speciesAggregate.setGenusOrUninomial("Mygenus"); |
589 | 589 |
speciesAggregate.setSpecificEpithet("myspecies"); |
590 | 590 |
List<TaggedText> taggedName = strategy.getTaggedName(speciesAggregate); |
... | ... | |
622 | 622 |
|
623 | 623 |
@Test //#2888 |
624 | 624 |
public void testAutonymWithExAuthor(){ |
625 |
BotanicalName name = TaxonNameBase.NewBotanicalInstance(Rank.FORM());
|
|
625 |
BotanicalName name = TaxonNameFactory.NewBotanicalInstance(Rank.FORM());
|
|
626 | 626 |
name.setGenusOrUninomial("Euphorbia"); |
627 | 627 |
name.setSpecificEpithet("atropurpurea"); |
628 | 628 |
name.setInfraSpecificEpithet("atropurpurea"); |
Also available in: Unified diff
ref #6365 use TaxonNameFactory for botanical names