Search in sources :

Example 36 with TaggedText

use of eu.etaxonomy.cdm.strategy.cache.TaggedText in project cdmlib by cybertaxonomy.

the class TaxonNameDefaultCacheStrategyTest method testGetTaggedNameSpeciesAggregate.

@Test
public void testGetTaggedNameSpeciesAggregate() {
    TaxonName speciesAggregate = TaxonNameFactory.NewBotanicalInstance(Rank.SPECIESAGGREGATE());
    speciesAggregate.setGenusOrUninomial("Mygenus");
    speciesAggregate.setSpecificEpithet("myspecies");
    List<TaggedText> taggedName = strategy.getTaggedName(speciesAggregate);
    Assert.assertEquals("1rd tag must be genus epithet", "Mygenus", taggedName.get(0).getText());
    Assert.assertEquals("2rd tag must be species epithet", "myspecies", taggedName.get(1).getText());
    Assert.assertEquals("3rd tag must be aggregate marker", "aggr.", taggedName.get(2).getText());
}
Also used : TaxonName(eu.etaxonomy.cdm.model.name.TaxonName) TaggedText(eu.etaxonomy.cdm.strategy.cache.TaggedText) Test(org.junit.Test)

Aggregations

TaggedText (eu.etaxonomy.cdm.strategy.cache.TaggedText)36 ArrayList (java.util.ArrayList)14 TaxonName (eu.etaxonomy.cdm.model.name.TaxonName)12 Test (org.junit.Test)10 Rank (eu.etaxonomy.cdm.model.name.Rank)4 TypeDesignationBase (eu.etaxonomy.cdm.model.name.TypeDesignationBase)4 Reference (eu.etaxonomy.cdm.model.reference.Reference)4 Taxon (eu.etaxonomy.cdm.model.taxon.Taxon)4 TaxonRelationshipType (eu.etaxonomy.cdm.model.taxon.TaxonRelationshipType)4 LanguageString (eu.etaxonomy.cdm.model.common.LanguageString)3 UnknownCdmTypeException (eu.etaxonomy.cdm.strategy.exceptions.UnknownCdmTypeException)3 List (java.util.List)3 TypeDesignationSetManager (eu.etaxonomy.cdm.api.service.name.TypeDesignationSetManager)2 Team (eu.etaxonomy.cdm.model.agent.Team)2 IdentifiableSource (eu.etaxonomy.cdm.model.common.IdentifiableSource)2 CommonTaxonName (eu.etaxonomy.cdm.model.description.CommonTaxonName)2 HybridRelationship (eu.etaxonomy.cdm.model.name.HybridRelationship)2 SpecimenTypeDesignation (eu.etaxonomy.cdm.model.name.SpecimenTypeDesignation)2 TextualTypeDesignation (eu.etaxonomy.cdm.model.name.TextualTypeDesignation)2 Synonym (eu.etaxonomy.cdm.model.taxon.Synonym)2