Project

General

Profile

Download (2.11 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

    
10
package eu.etaxonomy.cdm.model.common;
11

    
12

    
13
import static org.junit.Assert.assertEquals;
14

    
15
import java.util.UUID;
16

    
17
import org.apache.log4j.Logger;
18
import org.junit.After;
19
import org.junit.AfterClass;
20
import org.junit.Before;
21
import org.junit.BeforeClass;
22
import org.junit.Test;
23
import org.springframework.util.Assert;
24

    
25

    
26
/**
27
 * @author a.mueller
28
 * @created 08.06.2009
29
 */
30
public class ExtensionTypeTest {
31
	@SuppressWarnings("unused")
32
	private static final Logger logger = Logger.getLogger(ExtensionTypeTest.class);
33

    
34
	/**
35
	 * @throws java.lang.Exception
36
	 */
37
	@BeforeClass
38
	public static void setUpBeforeClass() throws Exception {
39
		DefaultTermInitializer initializer = new DefaultTermInitializer();
40
		initializer.initialize();
41
	}
42

    
43
	/**
44
	 * @throws java.lang.Exception
45
	 */
46
	@AfterClass
47
	public static void tearDownAfterClass() throws Exception {
48
	}
49

    
50
	/**
51
	 * @throws java.lang.Exception
52
	 */
53
	@Before
54
	public void setUp() throws Exception {
55
	}
56

    
57
	/**
58
	 * @throws java.lang.Exception
59
	 */
60
	@After
61
	public void tearDown() throws Exception {
62
	}
63
	
64
//****************** TESTS *******************************************************/	
65
	
66
	@Test
67
	public void testRDF(){
68
		UUID uuidRdf = UUID.fromString("f3684e25-dcad-4c1e-a5d8-16cddf1c4f5b");
69
		ExtensionType rdfExtension = ExtensionType.getTermByUuid(uuidRdf);
70
		Assert.notNull(rdfExtension, "RdfExtension must not be null");
71
		assertEquals("Wrong label for extension type rdf", "RDF",rdfExtension.getRepresentation(Language.ENGLISH()).getAbbreviatedLabel());
72
	}
73
	
74
	@Test
75
	public void testDOI(){
76
		UUID uuidDoi = UUID.fromString("f079aacc-ab08-4cc4-90a0-6d3958fb0dbf");
77
		ExtensionType doiExtension = ExtensionType.DOI();
78
		Assert.notNull(doiExtension, "DoiExtension must not be null");
79
		assertEquals("Wrong label for extension type rdf", "DOI",doiExtension.getLabel());
80
	}
81
	
82
}
(5-5/17)