1
|
/**
|
2
|
* Copyright (C) 2017 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.dataportal;
|
10
|
|
11
|
import org.junit.Assert;
|
12
|
import org.junit.Test;
|
13
|
|
14
|
import eu.etaxonomy.cdm.model.name.SpecimenTypeDesignation;
|
15
|
|
16
|
/**
|
17
|
* @author a.kohlbecker
|
18
|
* @since Oct 10, 2017
|
19
|
*
|
20
|
*/
|
21
|
public class CdmEntityClassAttributesTest extends Assert {
|
22
|
|
23
|
@Test
|
24
|
public void testTypeName() throws Exception {
|
25
|
CdmEntityClassAttributes a = new CdmEntityClassAttributes("cdm:SpecimenTypeDesignation");
|
26
|
assertEquals(SpecimenTypeDesignation.class, a.getCdmType());
|
27
|
assertNull(a.getEnitytyUuid());
|
28
|
}
|
29
|
|
30
|
@Test
|
31
|
public void testUuid() throws Exception {
|
32
|
CdmEntityClassAttributes a = new CdmEntityClassAttributes("uuid:a2f7451b-bd67-4265-8b21-94943503c93f");
|
33
|
assertEquals("a2f7451b-bd67-4265-8b21-94943503c93f", a.getEnitytyUuid().toString());
|
34
|
assertNull(a.getCdmType());
|
35
|
}
|
36
|
|
37
|
@Test
|
38
|
public void testUuidAndTypeName() throws Exception {
|
39
|
CdmEntityClassAttributes a = new CdmEntityClassAttributes("someAttribute cdm:SpecimenTypeDesignation anotherAttribute uuid:a2f7451b-bd67-4265-8b21-94943503c93f lastAttribute");
|
40
|
assertEquals(SpecimenTypeDesignation.class, a.getCdmType());
|
41
|
assertEquals("a2f7451b-bd67-4265-8b21-94943503c93f", a.getEnitytyUuid().toString());
|
42
|
}
|
43
|
|
44
|
@Test
|
45
|
public void testInterfaceName() throws Exception {
|
46
|
CdmEntityClassAttributes a = new CdmEntityClassAttributes("cdm:ITypeDesignation");
|
47
|
assertNull(a.getCdmType());
|
48
|
assertNull(a.getEnitytyUuid());
|
49
|
}
|
50
|
|
51
|
@Test
|
52
|
public void testEmpty() throws Exception {
|
53
|
CdmEntityClassAttributes a = new CdmEntityClassAttributes("someAttribute anotherAttribute lastAttribute");
|
54
|
assertNull(a.getCdmType());
|
55
|
assertNull(a.getEnitytyUuid());
|
56
|
}
|
57
|
|
58
|
}
|