ExtensionType implemented
[cdmlib.git] / cdmlib-model / src / test / java / eu / etaxonomy / cdm / model / common / ExtensionTypeTest.java
1 // $Id$
2 /**
3 * Copyright (C) 2007 EDIT
4 * European Distributed Institute of Taxonomy
5 * http://www.e-taxonomy.eu
6 *
7 * The contents of this file are subject to the Mozilla Public License Version 1.1
8 * See LICENSE.TXT at the top of this package for the full license terms.
9 */
10
11 package eu.etaxonomy.cdm.model.common;
12
13
14 import static org.junit.Assert.assertEquals;
15
16 import java.util.UUID;
17
18 import org.apache.log4j.Logger;
19 import org.junit.After;
20 import org.junit.AfterClass;
21 import org.junit.Before;
22 import org.junit.BeforeClass;
23 import org.junit.Test;
24 import org.springframework.util.Assert;
25
26 import eu.etaxonomy.cdm.model.location.NamedArea;
27 import eu.etaxonomy.cdm.model.location.TdwgArea;
28
29 /**
30 * @author a.mueller
31 * @created 08.06.2009
32 * @version 1.0
33 */
34 public class ExtensionTypeTest {
35 @SuppressWarnings("unused")
36 private static final Logger logger = Logger.getLogger(ExtensionTypeTest.class);
37
38 /**
39 * @throws java.lang.Exception
40 */
41 @BeforeClass
42 public static void setUpBeforeClass() throws Exception {
43 DefaultTermInitializer initializer = new DefaultTermInitializer();
44 initializer.initialize();
45 }
46
47 /**
48 * @throws java.lang.Exception
49 */
50 @AfterClass
51 public static void tearDownAfterClass() throws Exception {
52 }
53
54 /**
55 * @throws java.lang.Exception
56 */
57 @Before
58 public void setUp() throws Exception {
59 }
60
61 /**
62 * @throws java.lang.Exception
63 */
64 @After
65 public void tearDown() throws Exception {
66 }
67
68 //****************** TESTS *******************************************************/
69
70 @Test
71 public void testRDF(){
72 UUID uuidRdf = UUID.fromString("f3684e25-dcad-4c1e-a5d8-16cddf1c4f5b");
73 ExtensionType rdfExtension = ExtensionType.getTermByUuid(uuidRdf);
74 Assert.notNull(rdfExtension, "RdfExtension must not be null");
75 assertEquals("Wrong label for extension type rdf", "RDF",rdfExtension.getRepresentation(Language.ENGLISH()).getAbbreviatedLabel());
76 }
77
78 @Test
79 public void testDOI(){
80 UUID uuidDoi = UUID.fromString("f079aacc-ab08-4cc4-90a0-6d3958fb0dbf");
81 ExtensionType doiExtension = ExtensionType.DOI();
82 Assert.notNull(doiExtension, "DoiExtension must not be null");
83 assertEquals("Wrong label for extension type rdf", "DOI",doiExtension.getLabel());
84 }
85
86 }