Project

General

Profile

Download (2.02 KB) Statistics
| Branch: | Tag: | Revision:
1
/**
2
* Copyright (C) 2018 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.cdm.model.description;
10

    
11
import static org.junit.Assert.assertEquals;
12
import static org.junit.Assert.assertNotSame;
13

    
14
import org.junit.Before;
15
import org.junit.BeforeClass;
16
import org.junit.Test;
17

    
18
import eu.etaxonomy.cdm.model.common.DefaultTermInitializer;
19
import eu.etaxonomy.cdm.model.common.Language;
20
import eu.etaxonomy.cdm.model.common.LanguageString;
21
import eu.etaxonomy.cdm.model.occurrence.DerivedUnit;
22

    
23
/**
24
 * @author a.mueller
25
 * @since 23.04.2018
26
 */
27
public class IndividualsAssociationTest {
28

    
29
    private IndividualsAssociation indAssociation;
30
    /**
31
     * @throws java.lang.Exception
32
     */
33
    @Before
34
    public void setUp() throws Exception {
35
        indAssociation = IndividualsAssociation.NewInstance();
36

    
37
        DerivedUnit associatedSpecimen = DerivedUnit.NewPreservedSpecimenInstance();
38
        associatedSpecimen.setIndividualCount(2);
39
        indAssociation.setAssociatedSpecimenOrObservation(associatedSpecimen);
40

    
41
        LanguageString langString = LanguageString.NewInstance("Test", Language.ENGLISH());
42
        indAssociation.putDescription(langString);
43
    }
44

    
45
    @BeforeClass
46
    public static void setUpBeforeClass() {
47
        if (Language.DEFAULT() == null){
48
            DefaultTermInitializer vocabularyStore = new DefaultTermInitializer();
49
            vocabularyStore.initialize();
50
        }
51
    }
52

    
53
    /**
54
     * Test method for {@link eu.etaxonomy.cdm.model.description.IndividualsAssociation#clone()}.
55
     */
56
    @Test
57
    public void testClone() {
58
        IndividualsAssociation clone = (IndividualsAssociation) indAssociation.clone();
59
        assertEquals(clone.getFeature(), indAssociation.getFeature());
60
        assertNotSame(clone.getDescription().get(Language.ENGLISH()), indAssociation.getDescription().get(Language.ENGLISH()));
61
    }
62

    
63
}
(4-4/10)