Project

General

Profile

« Previous | Next » 

Revision 4dbcb616

Added by Andreas Müller over 3 years ago

cleanup and use TermTestBase for model tests

View differences:

cdmlib-model/src/test/java/eu/etaxonomy/cdm/strategy/cache/name/ZoologicalNameCacheStrategyTest.java
6 6
* The contents of this file are subject to the Mozilla Public License Version 1.1
7 7
* See LICENSE.TXT at the top of this package for the full license terms.
8 8
*/
9

  
10 9
package eu.etaxonomy.cdm.strategy.cache.name;
11 10

  
12 11
import static org.junit.Assert.assertEquals;
......
18 17
import org.apache.log4j.Logger;
19 18
import org.junit.Assert;
20 19
import org.junit.Before;
21
import org.junit.BeforeClass;
22 20
import org.junit.Test;
23 21

  
24 22
import eu.etaxonomy.cdm.model.agent.Person;
......
28 26
import eu.etaxonomy.cdm.model.name.Rank;
29 27
import eu.etaxonomy.cdm.model.name.TaxonName;
30 28
import eu.etaxonomy.cdm.model.name.TaxonNameFactory;
31
import eu.etaxonomy.cdm.model.term.DefaultTermInitializer;
32 29

  
33 30
/**
34 31
 * @author a.mueller
35 32
 */
36 33
public class ZoologicalNameCacheStrategyTest extends NameCacheStrategyTestBase {
37
	@SuppressWarnings("unused")
34

  
35
    @SuppressWarnings("unused")
38 36
	private static final Logger logger = Logger.getLogger(ZoologicalNameCacheStrategyTest.class);
39 37

  
40 38
	private TaxonNameDefaultCacheStrategy strategy;
......
65 63
	private final Integer publicationYear = 1928;
66 64
	private final Integer originalPublicationYear = 1860;
67 65

  
68
	@BeforeClass
69
	public static void setUpBeforeClass() {
70
		DefaultTermInitializer vocabularyStore = new DefaultTermInitializer();
71
		vocabularyStore.initialize();
72
	}
73

  
74 66
	@Before
75 67
	public void setUp() throws Exception {
76 68
		strategy = TaxonNameDefaultCacheStrategy.NewInstance();
......
100 92
		exBasAuthor.setNomenclaturalTitle(exBasAuthorString);
101 93
	}
102 94

  
103

  
104 95
/********* TEST *******************************************/
105 96

  
106 97
	@Test
......
172 163
		assertEquals("TitleCache must be updated", "Abies alba subsp. beta " + "(ExBas. N. ex Basio, A., 1860) Exaut. ex L., 1928", subSpeciesName.getTitleCache());
173 164

  
174 165
		assertNull("Authorship cache for null must return null", strategy.getAuthorshipCache(null));
175

  
176 166
	}
177 167

  
178 168
	@Test
......
200 190
		assertEquals(varietyNameString, strategy.getNameCache(varName));
201 191
	}
202 192

  
203

  
204 193
	@Test
205 194
	public final void testAutonyms() {
206 195
		subSpeciesName.setInfraSpecificEpithet("alba");
......
213 202
		assertEquals("Abies alba subsp. alba", strategy.getNameCache(subSpeciesName));
214 203
		assertEquals("Abies alba subsp. alba L.", strategy.getTitleCache(subSpeciesName));
215 204
	}
216
}
205
}

Also available in: Unified diff