Project

General

Profile

Download (1.85 KB) Statistics
| Branch: | Tag: | Revision:
1
/**
2
* Copyright (C) 2007 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.model.term.init;
10

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

    
14
import java.util.UUID;
15

    
16
import org.apache.log4j.Logger;
17
import org.junit.Before;
18
import org.junit.Test;
19

    
20
import eu.etaxonomy.cdm.model.common.Language;
21
import eu.etaxonomy.cdm.model.term.DefaultTermInitializer;
22

    
23
/**
24
 * @author AM
25
 */
26
public class DefaultTermInitializerTest {
27

    
28
    static Logger logger = Logger.getLogger(DefaultTermInitializerTest.class);
29

    
30
	private DefaultTermInitializer defaultVocabularyStore;
31
	private UUID uuidEnglish;
32
	private UUID uuidGerman;
33

    
34
	@Before
35
	public void setUp() {
36
		defaultVocabularyStore = new DefaultTermInitializer();
37
		uuidEnglish = UUID.fromString("e9f8cdb7-6819-44e8-95d3-e2d0690c3523");
38
		uuidGerman = UUID.fromString("d1131746-e58b-4e80-a865-f5182c9c3073");
39
	}
40

    
41
/*********************** TEST *************************************************/
42

    
43
	@Test
44
	public void testInitialize() {
45
		defaultVocabularyStore.initialize();
46

    
47
		assertNotNull("ENGLISH should not be null",Language.ENGLISH());
48
		assertEquals("The uuid of ENGLISH should equal e9f8cdb7-6819-44e8-95d3-e2d0690c3523",uuidEnglish,Language.ENGLISH().getUuid());
49
		assertNotNull("ENGLISH should have an ENGLISH representation",Language.ENGLISH().getRepresentation(Language.ENGLISH()));
50
		assertNotNull("GERMAN should not be null",Language.GERMAN());
51
		assertEquals("The uuid of GERMAN should equal d1131746-e58b-4e80-a865-f5182c9c3073",uuidGerman,Language.GERMAN().getUuid());
52
		assertNotNull("GERMAN should have an ENGLISH representation",Language.GERMAN().getRepresentation(Language.ENGLISH()));
53
	}
54
}
(1-1/2)