Project

General

Profile

Revision a1ad5a71

IDa1ad5a71473bdea3f19115cf046a89e8b159231d
Parent d442b508
Child 639ed505

Added by Andreas Müller over 8 years ago

improve term title cache generation -> test

View differences:

cdmlib-model/src/test/java/eu/etaxonomy/cdm/strategy/cache/common/TermDefaultCacheStrategyTest.java
9 9
*/
10 10
package eu.etaxonomy.cdm.strategy.cache.common;
11 11

  
12
import static org.junit.Assert.*;
12
import java.util.UUID;
13

  
13 14
import junit.framework.Assert;
14 15

  
15 16
import org.apache.log4j.Logger;
16
import org.junit.After;
17
import org.junit.AfterClass;
18 17
import org.junit.Before;
19 18
import org.junit.BeforeClass;
20 19
import org.junit.Test;
21 20

  
22 21
import eu.etaxonomy.cdm.model.common.DefaultTermInitializer;
22
import eu.etaxonomy.cdm.model.location.NamedArea;
23 23
import eu.etaxonomy.cdm.model.name.NomenclaturalStatusType;
24 24
import eu.etaxonomy.cdm.model.name.Rank;
25 25

  
......
75 75
		Assert.assertEquals("Genus title cache should be 'Genus'", "Genus", Rank.GENUS().getTitleCache());
76 76
		Assert.assertEquals("Nom. Illeg. title cache should be 'Illegitimate'", "Illegitimate", NomenclaturalStatusType.ILLEGITIMATE().getTitleCache());
77 77
	}
78
	
79
	/**
80
	 * Test method for {@link eu.etaxonomy.cdm.strategy.cache.common.TermDefaultCacheStrategy#getTitleCache(eu.etaxonomy.cdm.model.common.TermBase)}.
81
	 */
82
	@Test
83
	public void testGetTitleCacheNoRepresentations() {
84
		final String newTermUuid = "e3a6e29d-314a-4e06-be70-cbfe093842ec";
85
		NamedArea newTerm = NamedArea.NewInstance();
86
		newTerm.setUuid(UUID.fromString(newTermUuid));
87
		
88
		Assert.assertEquals("Term with no representation must return a title that makes some sense", "NamedArea<e3a6e29d-314a-4e06-be70-cbfe093842ec>", newTerm.getTitleCache());
89
	}
78 90

  
79 91
}

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)