Revision e109fb7a
Added by Andreas Müller almost 8 years ago
cdmlib-model/src/test/java/eu/etaxonomy/cdm/strategy/cache/taxon/TaxonBaseDefaultCacheStrategyTest.java | ||
---|---|---|
29 | 29 |
//import eu.etaxonomy.cdm.model.reference.Book; |
30 | 30 |
import eu.etaxonomy.cdm.model.reference.Reference; |
31 | 31 |
import eu.etaxonomy.cdm.model.reference.ReferenceFactory; |
32 |
import eu.etaxonomy.cdm.model.taxon.Synonym; |
|
32 | 33 |
import eu.etaxonomy.cdm.model.taxon.Taxon; |
33 | 34 |
import eu.etaxonomy.cdm.model.taxon.TaxonBase; |
34 | 35 |
import eu.etaxonomy.cdm.strategy.parser.NonViralNameParserImpl; |
... | ... | |
122 | 123 |
assertEquals("Taxon titlecache is wrong", expectedNameTitleCache + ", nom. illeg., sec. Sp.Pl.", taxonBase.getTitleCache()); |
123 | 124 |
} |
124 | 125 |
|
126 |
//same as for accepted taxa but with syn. sec. instead of sec. |
|
127 |
@Test |
|
128 |
public void testSynSec() { |
|
129 |
Synonym taxonBase = Synonym.NewInstance(name, sec); |
|
130 |
assertEquals("Taxon titlecache is wrong", expectedNameTitleCache + " syn. sec. Sp.Pl.", taxonBase.getTitleCache()); |
|
131 |
//without sec. |
|
132 |
taxonBase.setSec(null); |
|
133 |
assertEquals("Taxon titlecache is wrong", expectedNameTitleCache + " syn. sec. ???", taxonBase.getTitleCache()); |
|
134 |
//appended phrase without sec. |
|
135 |
String appendedPhrase = "aff. 'schippii'"; |
|
136 |
taxonBase.setAppendedPhrase(appendedPhrase); |
|
137 |
assertEquals("Taxon titlecache is wrong", expectedNameTitleCache + " aff. 'schippii'", taxonBase.getTitleCache()); |
|
138 |
//appended phrase with sec. |
|
139 |
taxonBase.setSec(sec); |
|
140 |
assertEquals("Taxon titlecache is wrong", expectedNameTitleCache + " aff. 'schippii' syn. sec. Sp.Pl.", taxonBase.getTitleCache()); |
|
141 |
//use name cache |
|
142 |
taxonBase.setUseNameCache(true); |
|
143 |
assertEquals("Taxon titlecache is wrong", expectedNameCache + " aff. 'schippii' syn. sec. Sp.Pl.", taxonBase.getTitleCache()); |
|
144 |
taxonBase.setDoubtful(true); |
|
145 |
assertEquals("Taxon titlecache is wrong", "?" + expectedNameCache + " aff. 'schippii' syn. sec. Sp.Pl.", taxonBase.getTitleCache()); |
|
146 |
//with nom status |
|
147 |
taxonBase.setAppendedPhrase(null); |
|
148 |
taxonBase.setUseNameCache(false); |
|
149 |
taxonBase.setDoubtful(false); |
|
150 |
name.addStatus(NomenclaturalStatusType.ILLEGITIMATE(), null, null); |
|
151 |
assertEquals("Taxon titlecache is wrong", expectedNameTitleCache + ", nom. illeg., syn. sec. Sp.Pl.", taxonBase.getTitleCache()); |
|
152 |
} |
|
153 |
|
|
125 | 154 |
@Test |
126 | 155 |
public void testGetTitleCacheWithoutName() { |
127 | 156 |
TaxonBase<?> taxonBase = Taxon.NewInstance(null, sec); |
Also available in: Unified diff
Use syn. sec. instead of sec. for synonym sec references #5902