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/ValidTaxonomicYearTest.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;
......
19 18
import eu.etaxonomy.cdm.model.name.TaxonNameFactory;
20 19
import eu.etaxonomy.cdm.model.reference.Reference;
21 20
import eu.etaxonomy.cdm.model.reference.ReferenceFactory;
22
import eu.etaxonomy.cdm.model.term.DefaultTermInitializer;
23 21
import eu.etaxonomy.cdm.strategy.parser.TimePeriodParser;
24 22
import eu.etaxonomy.cdm.validation.constraint.ValidTaxonomicYearValidator;
25 23

  
26

  
27

  
28 24
/**
29 25
 * NOTE: In this test, the words "valid" and "invalid", loaded though
30 26
 * these terms are when applied to taxonomic names, only mean "passes the
......
32 28
 * nomenclatural and taxonomic sense of these words.
33 29
 *
34 30
 * @author ben.clark
35
 *
36
 *
37 31
 */
38 32
public class ValidTaxonomicYearTest extends ValidationTestBase {
39 33
	@SuppressWarnings("unused")
......
42 36
    static Class<ValidTaxonomicYearValidator> validatorClass = ValidTaxonomicYearValidator.class;
43 37
    static Class<Level3> group = Level3.class;
44 38

  
45

  
46 39
	private IBotanicalName name;
47 40

  
48 41
	private Reference beforeLineeRef;
49 42
    private Reference afterLineeRef;
50 43

  
51

  
52 44
	@Before
53 45
	public void setUp() {
54
		DefaultTermInitializer vocabularyStore = new DefaultTermInitializer();
55
		vocabularyStore.initialize();
56 46

  
57 47
		name = TaxonNameFactory.NewBotanicalInstance(Rank.SPECIES());
58 48
		name.setNameCache("Aus aus");
......
65 55

  
66 56
	    afterLineeRef = ReferenceFactory.newBook();
67 57
	    afterLineeRef.setDatePublished(TimePeriodParser.parseStringVerbatim("1754"));
68

  
69 58
	}
70 59

  
71

  
72 60
/****************** TESTS *****************************/
73 61

  
74 62
	@Test
......
106 94
        zooName.setNomenclaturalReference(beforeLineeRef);
107 95
        validateHasConstraint(zooName, validatorClass, group);
108 96
    }
109
}

97
}

Also available in: Unified diff