Project

General

Profile

Download (1.69 KB) Statistics
| Branch: | Tag: | Revision:
1
/**
2
 * 
3
 */
4
package eu.etaxonomy.cdm.strategy.cache.description;
5

    
6

    
7
import org.junit.Assert;
8
import org.junit.Before;
9
import org.junit.Test;
10

    
11
import eu.etaxonomy.cdm.model.description.TaxonDescription;
12
import eu.etaxonomy.cdm.model.name.BotanicalName;
13
import eu.etaxonomy.cdm.model.name.Rank;
14
import eu.etaxonomy.cdm.model.reference.Generic;
15
import eu.etaxonomy.cdm.model.taxon.Taxon;
16

    
17
/**
18
 * @author a.mueller
19
 *
20
 */
21
public class TaxonDescriptionDefaultCacheStrategyTest {
22

    
23
	/**
24
	 * @throws java.lang.Exception
25
	 */
26
	@Before
27
	public void setUp() throws Exception {
28
	}
29

    
30
	
31
//*********************** TESTS ****************************************************/
32
	
33
	@Test
34
	public void testGetTitleCache(){
35
		BotanicalName botName = BotanicalName.NewInstance(Rank.SPECIES());
36
		botName.setGenusOrUninomial("Genus");
37
		botName.setSpecificEpithet("species");
38
		Generic sec = Generic.NewInstance();
39
		sec.setTitleCache("My sec");
40
		Taxon taxon = Taxon.NewInstance(botName, sec);
41
		TaxonDescription taxonDescription = TaxonDescription.NewInstance(taxon);
42
		Assert.assertEquals("Wrong title cache for description", "Taxon description for Genus species", taxonDescription.getTitleCache());
43
		taxonDescription.setImageGallery(true);
44
		Assert.assertEquals("Wrong title cache for description", "Image galery for Genus species", taxonDescription.getTitleCache());
45
		taxonDescription = TaxonDescription.NewInstance();
46
		Assert.assertEquals("Wrong title cache for description", "Taxon description", taxonDescription.getTitleCache());
47
		taxonDescription.setImageGallery(true);
48
		Assert.assertEquals("Wrong title cache for description", "Image galery", taxonDescription.getTitleCache());
49

    
50
	}
51
	
52
}
    (1-1/1)