Project

General

Profile

Download (4.69 KB) Statistics
| Branch: | Tag: | Revision:
1
/**
2
* Copyright (C) 2009 EDIT
3
* European Distributed Institute of Taxonomy 
4
* http://www.e-taxonomy.eu
5
* 
6
* The contents of this file are subject to the Mozilla Public License Version 1.1
7
* See LICENSE.TXT at the top of this package for the full license terms.
8
*/
9
package eu.etaxonomy.cdm.api.service;
10

    
11
import static org.junit.Assert.assertEquals;
12
import static org.junit.Assert.assertNotNull;
13
import static org.junit.Assert.assertSame;
14

    
15
import org.apache.log4j.Logger;
16
import org.junit.Test;
17
import org.unitils.spring.annotation.SpringBeanByType;
18

    
19
import eu.etaxonomy.cdm.model.common.OrderedTermVocabulary;
20
import eu.etaxonomy.cdm.model.name.Rank;
21
import eu.etaxonomy.cdm.model.name.SpecimenTypeDesignationStatus;
22
import eu.etaxonomy.cdm.test.integration.CdmIntegrationTest;
23

    
24
/**
25
 * @author a.mueller
26
 *
27
 */
28
public class NameServiceImplTest2 extends CdmIntegrationTest {
29
	private static final Logger logger = Logger.getLogger(NameServiceImplTest2.class);
30

    
31
	@SpringBeanByType
32
	private INameService service;
33
	
34
/* ******************** TESTS ********************************************/
35
	
36
	/**
37
	 * Test method for {@link eu.etaxonomy.cdm.api.service.NameServiceImpl#setDao(eu.etaxonomy.cdm.persistence.dao.name.ITaxonNameDao)}.
38
	 */
39
	@Test
40
	public void testSetDao() {
41
		logger.warn("Not yet implemented");
42
	}
43

    
44
	/**
45
	 * Test method for {@link eu.etaxonomy.cdm.api.service.NameServiceImpl#setVocabularyDao(eu.etaxonomy.cdm.persistence.dao.common.ITermVocabularyDao)}.
46
	 */
47
	@Test
48
	public void testSetVocabularyDao() {
49
		logger.warn("Not yet implemented");
50
	}
51

    
52
	/**
53
	 * Test method for {@link eu.etaxonomy.cdm.api.service.NameServiceImpl#NameServiceImpl()}.
54
	 */
55
	@Test
56
	public void testNameServiceImpl() {
57
		logger.warn("Not yet implemented");
58
	}
59

    
60
	/**
61
	 * Test method for {@link eu.etaxonomy.cdm.api.service.NameServiceImpl#getNamesByName(java.lang.String)}.
62
	 */
63
	@Test
64
	public void testGetNamesByName() {
65
		logger.warn("Not yet implemented");
66
	}
67

    
68
	/**
69
	 * Test method for {@link eu.etaxonomy.cdm.api.service.NameServiceImpl#getTaxonNameByUuid(java.util.UUID)}.
70
	 */
71
	@Test
72
	public void testGetTaxonNameByUuid() {
73
		logger.warn("Not yet implemented");
74
	}
75

    
76
	/**
77
	 * Test method for {@link eu.etaxonomy.cdm.api.service.NameServiceImpl#saveTaxonName(eu.etaxonomy.cdm.model.name.TaxonNameBase)}.
78
	 */
79
	@Test
80
	public void testSaveTaxonName() {
81
		logger.warn("Not yet implemented");
82
	}
83

    
84
	/**
85
	 * Test method for {@link eu.etaxonomy.cdm.api.service.NameServiceImpl#saveTaxonNameAll(java.util.Collection)}.
86
	 */
87
	@Test
88
	public void testSaveTaxonNameAll() {
89
		logger.warn("Not yet implemented");
90
	}
91

    
92
	/**
93
	 * Test method for {@link eu.etaxonomy.cdm.api.service.NameServiceImpl#removeTaxon(eu.etaxonomy.cdm.model.name.TaxonNameBase)}.
94
	 */
95
	@Test
96
	public void testRemoveTaxon() {
97
		logger.warn("Not yet implemented");
98
	}
99

    
100
	/**
101
	 * Test method for {@link eu.etaxonomy.cdm.api.service.NameServiceImpl#getAllNames(int, int)}.
102
	 */
103
	@Test
104
	public void testGetAllNames() {
105
		logger.warn("Not yet implemented");
106
	}
107

    
108
	/**
109
	 * Test method for {@link eu.etaxonomy.cdm.api.service.NameServiceImpl#getRankVocabulary()}.
110
	 */
111
	@Test
112
	public void testGetRankVocabulary() {
113
		OrderedTermVocabulary<Rank> rankVocabulary = service.getRankVocabulary();
114
		assertNotNull(rankVocabulary);
115
		assertEquals(62, rankVocabulary.size());
116
		Rank highestRank = rankVocabulary.getHighestTerm();
117
		assertEquals(Rank.EMPIRE(), highestRank);
118
		assertEquals(Rank.DOMAIN(), rankVocabulary.getNextLowerTerm(highestRank));
119
		assertSame(Rank.EMPIRE(), highestRank);
120
		assertSame(Rank.DOMAIN(), rankVocabulary.getNextLowerTerm(highestRank));
121
	}
122

    
123
	/**
124
	 * Test method for {@link eu.etaxonomy.cdm.api.service.NameServiceImpl#getTypeDesignationVocabulary()}.
125
	 */
126
	@Test
127
	public void testGetTypeDesignationVocabulary() {
128
		OrderedTermVocabulary<SpecimenTypeDesignationStatus> typeDesignationVocabulary = 
129
			service.getSpecimenTypeDesignationVocabulary();
130
		assertNotNull(typeDesignationVocabulary);
131
		assertEquals(62, typeDesignationVocabulary.size());
132
		SpecimenTypeDesignationStatus highestType = typeDesignationVocabulary.getHighestTerm();
133
		assertEquals(SpecimenTypeDesignationStatus.EPITYPE(), highestType);
134
		assertEquals(SpecimenTypeDesignationStatus.HOLOTYPE(), typeDesignationVocabulary.getNextLowerTerm(highestType));
135
		assertSame(SpecimenTypeDesignationStatus.EPITYPE(), highestType);
136
		assertSame(SpecimenTypeDesignationStatus.HOLOTYPE(), typeDesignationVocabulary.getNextLowerTerm(highestType));
137
	}
138

    
139
	/**
140
	 * Test method for {@link eu.etaxonomy.cdm.api.service.NameServiceImpl#generateTitleCache()}.
141
	 */
142
	@Test
143
	public void testGenerateTitleCache() {
144
		logger.warn("Not yet implemented");
145
	}
146

    
147
}
(6-6/13)