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/validation/ValidTypeDesignationTest.java
6 6
* The contents of this file are subject to the Mozilla Public License Version 1.1
7 7
* See LICENSE.TXT at the top of this package for the full license terms.
8 8
*/
9

  
10 9
package eu.etaxonomy.cdm.validation;
11 10

  
12 11
import org.apache.log4j.Logger;
......
21 20
import eu.etaxonomy.cdm.model.name.TaxonNameFactory;
22 21
import eu.etaxonomy.cdm.model.occurrence.DerivedUnit;
23 22
import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationType;
24
import eu.etaxonomy.cdm.model.term.DefaultTermInitializer;
25 23
import eu.etaxonomy.cdm.validation.constraint.TypeDesignationValidator;
26 24

  
27

  
28

  
29 25
/**
30 26
 * NOTE: In this test, the words "valid" and "invalid", loaded though
31 27
 * these terms are when applied to taxonomic names, only mean "passes the
......
35 31
 * @author a.mueller
36 32
 */
37 33
public class ValidTypeDesignationTest extends ValidationTestBase {
38
	@SuppressWarnings("unused")
34

  
35
    @SuppressWarnings("unused")
39 36
    private static final Logger logger = Logger.getLogger(ValidTypeDesignationTest.class);
40 37

  
41 38
    static Class<?> validatorClass = TypeDesignationValidator.class;
......
47 44
    private TaxonName name2;
48 45
    private DerivedUnit specimen;
49 46

  
50

  
51 47
	@Before
52 48
	public void setUp() {
53
		DefaultTermInitializer vocabularyStore = new DefaultTermInitializer();
54
		vocabularyStore.initialize();
55

  
56 49
		name1 = TaxonNameFactory.NewBotanicalInstance(Rank.SPECIES());
57 50
		name1.setNameCache("Aus aus");
58 51

  
......
62 55
	    specimen = DerivedUnit.NewInstance(SpecimenOrObservationType.PreservedSpecimen);
63 56
	}
64 57

  
65

  
66 58
/****************** TESTS *****************************/
67 59

  
68 60
    @Test
......
79 71

  
80 72
        nameDesignation.setNotDesignated(true);
81 73
        validateHasNoConstraint(nameDesignation, validatorClass, group);
82

  
83 74
    }
84 75

  
85 76
    @Test
......
96 87

  
97 88
        specimenDesignation.setNotDesignated(true);
98 89
        validateHasNoConstraint(specimenDesignation, validatorClass, group);
99

  
100 90
    }
101

  
102
}
91
}

Also available in: Unified diff