Revision 4dbcb616
Added by Andreas Müller over 3 years ago
cdmlib-model/src/test/java/eu/etaxonomy/cdm/validation/NameValidCharactersTest.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 static org.junit.Assert.assertFalse; |
... | ... | |
27 | 26 |
import eu.etaxonomy.cdm.model.name.IBotanicalName; |
28 | 27 |
import eu.etaxonomy.cdm.model.name.Rank; |
29 | 28 |
import eu.etaxonomy.cdm.model.name.TaxonNameFactory; |
30 |
import eu.etaxonomy.cdm.model.term.DefaultTermInitializer; |
|
31 |
|
|
32 | 29 |
|
33 | 30 |
/** |
34 | 31 |
* NOTE: In this test, the words "valid" and "invalid", loaded though |
... | ... | |
37 | 34 |
* nomenclatural and taxonomic sense of these words. |
38 | 35 |
* |
39 | 36 |
* @author ben.clark |
40 |
* |
|
41 | 37 |
*/ |
42 | 38 |
@SuppressWarnings("unused") |
43 | 39 |
public class NameValidCharactersTest extends ValidationTestBase { |
... | ... | |
47 | 43 |
|
48 | 44 |
@Before |
49 | 45 |
public void setUp() { |
50 |
DefaultTermInitializer vocabularyStore = new DefaultTermInitializer(); |
|
51 |
vocabularyStore.initialize(); |
|
52 | 46 |
name = TaxonNameFactory.NewBotanicalInstance(Rank.SPECIES()); |
53 | 47 |
name.setGenusOrUninomial("Abies"); |
54 | 48 |
name.setSpecificEpithet("balsamea"); |
... | ... | |
58 | 52 |
name.setFullTitleCache("Abies balsamea L."); |
59 | 53 |
} |
60 | 54 |
|
61 |
|
|
62 | 55 |
/****************** TESTS *****************************/ |
63 | 56 |
|
64 | 57 |
/** |
... | ... | |
143 | 136 |
name.setAuthorshipCache("L\\u05EB", true); |
144 | 137 |
constraintViolations = validator.validate(name, Level2.class); |
145 | 138 |
assertHasConstraintOnValidator((Set)constraintViolations, PatternValidator.class); |
146 |
|
|
147 | 139 |
} |
148 |
} |
|
140 |
} |
Also available in: Unified diff
cleanup and use TermTestBase for model tests