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.Test;
|
16
|
|
17
|
import eu.etaxonomy.cdm.model.common.Language;
|
18
|
import eu.etaxonomy.cdm.model.common.LanguageString;
|
19
|
import eu.etaxonomy.cdm.model.occurrence.DerivedUnit;
|
20
|
import eu.etaxonomy.cdm.test.unit.EntityTestBase;
|
21
|
|
22
|
/**
|
23
|
* @author a.mueller
|
24
|
* @since 23.04.2018
|
25
|
*/
|
26
|
public class IndividualsAssociationTest extends EntityTestBase {
|
27
|
|
28
|
private IndividualsAssociation indAssociation;
|
29
|
|
30
|
@Before
|
31
|
public void setUp() throws Exception {
|
32
|
indAssociation = IndividualsAssociation.NewInstance();
|
33
|
|
34
|
DerivedUnit associatedSpecimen = DerivedUnit.NewPreservedSpecimenInstance();
|
35
|
associatedSpecimen.setIndividualCount("2");
|
36
|
indAssociation.setAssociatedSpecimenOrObservation(associatedSpecimen);
|
37
|
|
38
|
LanguageString langString = LanguageString.NewInstance("Test", Language.ENGLISH());
|
39
|
indAssociation.putDescription(langString);
|
40
|
}
|
41
|
|
42
|
@Test
|
43
|
public void testClone() {
|
44
|
IndividualsAssociation clone = indAssociation.clone();
|
45
|
assertEquals(clone.getFeature(), indAssociation.getFeature());
|
46
|
assertNotSame(clone.getDescription().get(Language.ENGLISH()), indAssociation.getDescription().get(Language.ENGLISH()));
|
47
|
}
|
48
|
}
|