Project

General

Profile

« Previous | Next » 

Revision 4dbcb616

Added by Andreas Müller over 3 years ago

cleanup and use TermTestBase for model tests

View differences:

cdmlib-model/src/test/java/eu/etaxonomy/cdm/model/description/QuantitativeDataTest.java
14 14
import java.math.BigDecimal;
15 15

  
16 16
import org.junit.Before;
17
import org.junit.BeforeClass;
18 17
import org.junit.Test;
19 18

  
20
import eu.etaxonomy.cdm.model.common.Language;
21
import eu.etaxonomy.cdm.model.term.DefaultTermInitializer;
19
import eu.etaxonomy.cdm.test.unit.EntityTestBase;
22 20

  
23 21
/**
24 22
 * @author a.mueller
25 23
 * @since 23.04.2018
26
 *
27 24
 */
28
public class QuantitativeDataTest {
25
public class QuantitativeDataTest extends EntityTestBase {
29 26

  
30 27
    private QuantitativeData quantData;
31 28

  
32
    @BeforeClass
33
    public static void setUpBeforeClass() {
34
        if (Language.DEFAULT() == null){
35
            DefaultTermInitializer vocabularyStore = new DefaultTermInitializer();
36
            vocabularyStore.initialize();
37
        }
38
    }
39

  
40 29
    @Before
41 30
    public void setUp() throws Exception {
42 31
        quantData = QuantitativeData.NewInstance();
......
49 38

  
50 39
    @Test
51 40
    public void testClone(){
52
        QuantitativeData clone = (QuantitativeData) quantData.clone();
41
        QuantitativeData clone = quantData.clone();
53 42
        BigDecimal cloneValue = clone.getStatisticalValues().iterator().next().getValue();
54 43
        BigDecimal origValue = quantData.getStatisticalValues().iterator().next().getValue();
55 44
        assertTrue(origValue == cloneValue);
56 45
        assertNotSame(clone.getStatisticalValues().iterator().next(), quantData.getStatisticalValues().iterator().next());
57 46
    }
58

  
59
}
47
}

Also available in: Unified diff