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
|
import eu.etaxonomy.cdm.model.term.DefaultTermInitializer;
|
26
|
|
27
|
|
28
|
/**
|
29
|
* @author a.mueller
|
30
|
* @since 08.06.2009
|
31
|
*/
|
32
|
public class ExtensionTypeTest {
|
33
|
@SuppressWarnings("unused")
|
34
|
private static final Logger logger = Logger.getLogger(ExtensionTypeTest.class);
|
35
|
|
36
|
/**
|
37
|
* @throws java.lang.Exception
|
38
|
*/
|
39
|
@BeforeClass
|
40
|
public static void setUpBeforeClass() throws Exception {
|
41
|
DefaultTermInitializer initializer = new DefaultTermInitializer();
|
42
|
initializer.initialize();
|
43
|
}
|
44
|
|
45
|
/**
|
46
|
* @throws java.lang.Exception
|
47
|
*/
|
48
|
@AfterClass
|
49
|
public static void tearDownAfterClass() throws Exception {
|
50
|
}
|
51
|
|
52
|
/**
|
53
|
* @throws java.lang.Exception
|
54
|
*/
|
55
|
@Before
|
56
|
public void setUp() throws Exception {
|
57
|
}
|
58
|
|
59
|
/**
|
60
|
* @throws java.lang.Exception
|
61
|
*/
|
62
|
@After
|
63
|
public void tearDown() throws Exception {
|
64
|
}
|
65
|
|
66
|
//****************** TESTS *******************************************************/
|
67
|
|
68
|
@Test
|
69
|
public void testRDF(){
|
70
|
UUID uuidRdf = UUID.fromString("f3684e25-dcad-4c1e-a5d8-16cddf1c4f5b");
|
71
|
ExtensionType rdfExtension = ExtensionType.getTermByUuid(uuidRdf);
|
72
|
Assert.notNull(rdfExtension, "RdfExtension must not be null");
|
73
|
assertEquals("Wrong label for extension type rdf", "RDF",rdfExtension.getRepresentation(Language.ENGLISH()).getAbbreviatedLabel());
|
74
|
}
|
75
|
|
76
|
@Test
|
77
|
public void testDOI(){
|
78
|
UUID uuidDoi = UUID.fromString("f079aacc-ab08-4cc4-90a0-6d3958fb0dbf");
|
79
|
ExtensionType doiExtension = ExtensionType.DOI();
|
80
|
Assert.notNull(doiExtension, "DoiExtension must not be null");
|
81
|
assertEquals("Wrong label for extension type rdf", "DOI",doiExtension.getLabel());
|
82
|
}
|
83
|
|
84
|
}
|