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/PolytomousKeyTest.java
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
*/
1 9
package eu.etaxonomy.cdm.model.description;
2 10

  
3 11
import static org.junit.Assert.assertNotNull;
......
9 17
import org.apache.log4j.Logger;
10 18
import org.junit.Assert;
11 19
import org.junit.Before;
12
import org.junit.BeforeClass;
13 20
import org.junit.Test;
14 21

  
15 22
import eu.etaxonomy.cdm.model.taxon.Taxon;
16
import eu.etaxonomy.cdm.model.term.DefaultTermInitializer;
23
import eu.etaxonomy.cdm.test.unit.EntityTestBase;
24

  
25
public class PolytomousKeyTest extends EntityTestBase {
17 26

  
18
public class PolytomousKeyTest {
19 27
	private static Logger logger = Logger.getLogger(PolytomousKeyTest.class);
20 28

  
21 29
	private PolytomousKey key1;
22 30
	private Taxon taxon1;
23 31

  
24
	@BeforeClass
25
	public static void setUpBeforeClass() {
26
		DefaultTermInitializer vocabularyStore = new DefaultTermInitializer();
27
		vocabularyStore.initialize();
28
	}
29

  
30 32
	@Before
31 33
	public void setUp() throws Exception {
32 34
		key1 = PolytomousKey.NewInstance();
......
110 112

  
111 113
	@Test
112 114
	public void testClone() {
113
		PolytomousKey clone = (PolytomousKey) key1.clone();
115
		PolytomousKey clone = key1.clone();
114 116
		assertNotNull(clone.getRoot());
115 117
		assertNotSame(clone.getRoot(), key1.getRoot());
116 118
		assertTrue(clone.getRoot().getChildren().size() == 0);

Also available in: Unified diff