3 * Copyright (C) 2007 EDIT
4 * European Distributed Institute of Taxonomy
5 * http://www.e-taxonomy.eu
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.
11 package eu
.etaxonomy
.cdm
.model
.common
;
14 import static org
.junit
.Assert
.assertEquals
;
16 import java
.util
.UUID
;
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
;
26 import eu
.etaxonomy
.cdm
.model
.location
.NamedArea
;
27 import eu
.etaxonomy
.cdm
.model
.location
.TdwgArea
;
34 public class ExtensionTypeTest
{
35 @SuppressWarnings("unused")
36 private static final Logger logger
= Logger
.getLogger(ExtensionTypeTest
.class);
39 * @throws java.lang.Exception
42 public static void setUpBeforeClass() throws Exception
{
43 DefaultTermInitializer initializer
= new DefaultTermInitializer();
44 initializer
.initialize();
48 * @throws java.lang.Exception
51 public static void tearDownAfterClass() throws Exception
{
55 * @throws java.lang.Exception
58 public void setUp() throws Exception
{
62 * @throws java.lang.Exception
65 public void tearDown() throws Exception
{
68 //****************** TESTS *******************************************************/
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());
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());