Revision 892efc69
Added by Andreas Kohlbecker almost 14 years ago
cdmlib-model/src/test/java/eu/etaxonomy/cdm/strategy/cache/name/NonViralNameDefaultCacheStrategyTest.java | ||
---|---|---|
11 | 11 |
|
12 | 12 |
import static org.junit.Assert.assertEquals; |
13 | 13 |
import static org.junit.Assert.assertNull; |
14 |
|
|
15 |
import java.util.List; |
|
16 |
|
|
14 | 17 |
import junit.framework.Assert; |
15 | 18 |
|
16 | 19 |
import org.apache.log4j.Logger; |
... | ... | |
25 | 28 |
import eu.etaxonomy.cdm.model.name.NonViralName; |
26 | 29 |
import eu.etaxonomy.cdm.model.name.Rank; |
27 | 30 |
import eu.etaxonomy.cdm.model.name.ZoologicalName; |
28 |
import eu.etaxonomy.cdm.model.reference.IBook; |
|
29 |
import eu.etaxonomy.cdm.model.reference.IGeneric; |
|
30 | 31 |
import eu.etaxonomy.cdm.model.reference.ReferenceBase; |
31 | 32 |
import eu.etaxonomy.cdm.model.reference.ReferenceFactory; |
32 | 33 |
|
... | ... | |
166 | 167 |
@Test |
167 | 168 |
public void testCacheListener() { |
168 | 169 |
ReferenceBase ref = refFactory.newGeneric(); |
169 |
ref.setTitleCache("GenericRef"); |
|
170 |
ref.setTitleCache("GenericRef",true);
|
|
170 | 171 |
this.subSpeciesName.setNomenclaturalReference(ref); |
171 | 172 |
Assert.assertEquals("Expected full title cache has error", "Abies alba subsp. beta, GenericRef", subSpeciesName.getFullTitleCache()); |
172 | 173 |
subSpeciesName.setCombinationAuthorTeam(author); |
... | ... | |
206 | 207 |
Assert.assertEquals("Expected full title cache has error", "Abies alba (Basio, A.) M., GenericRef", subSpeciesName.getFullTitleCache()); |
207 | 208 |
Assert.assertEquals("Expected full title cache has error", "Abies alba (Basio, A.) M.", subSpeciesName.getTitleCache()); |
208 | 209 |
|
209 |
subSpeciesName.setTitleCache("Pinus beta C."); |
|
210 |
subSpeciesName.setTitleCache("Pinus beta C.", true);
|
|
210 | 211 |
Assert.assertEquals("Expected full title cache has error", "Pinus beta C., GenericRef", subSpeciesName.getFullTitleCache()); |
211 | 212 |
subSpeciesName.setProtectedTitleCache(false); |
212 | 213 |
|
... | ... | |
396 | 397 |
assertEquals("Species group name should be 'Genus species group'.", "Genus species group", groupNameTitle); |
397 | 398 |
|
398 | 399 |
} |
400 |
|
|
401 |
@Test |
|
402 |
public void getTaggedName(){ |
|
403 |
// BotanicalName botName = BotanicalName.NewInstance(Rank.SUBSPECIES()); |
|
404 |
// botName.setGenusOrUninomial("Genus"); |
|
405 |
// botName.setSpecificEpithet("species"); |
|
406 |
// botName.setInfraSpecificEpithet("subspecies"); |
|
407 |
List taggedName = strategy.getTaggedName(subSpeciesName); |
|
408 |
Assert.assertEquals("First tag should be 'Abies'", "Abies", taggedName.get(0)); |
|
409 |
Assert.assertEquals("Second tag should be 'alba'", "alba", taggedName.get(1)); |
|
410 |
Assert.assertEquals("Third tag should be subspecies rank", Rank.SUBSPECIES(), taggedName.get(2)); |
|
411 |
Assert.assertEquals("Third tag should be subspecies rank, and rank abbreviatioin should be subsp.", "subsp.", ((Rank)taggedName.get(2)).getAbbreviation() ); |
|
412 |
Assert.assertEquals("Fourth tag should be 'beta'", "beta", taggedName.get(3)); |
|
413 |
//to be continued |
|
414 |
|
|
415 |
} |
|
399 | 416 |
|
400 | 417 |
} |
Also available in: Unified diff
merging /branches/cdmlib/SPRINT-Chichorieae1/ to trunk