Revision a784f00f
Added by Katja Luther about 14 years ago
cdmlib-services/src/test/java/eu/etaxonomy/cdm/validation/TaxonNameCannotBeAcceptedAndSynonymTest.java | ||
---|---|---|
83 | 83 |
@Test |
84 | 84 |
public void testValidTaxon() { |
85 | 85 |
assert taxon1.getName().getTaxonBases().size() == 1; |
86 |
Set<ConstraintViolation<Taxon>> constraintViolations = validator.validate(taxon1, Level2.class);
|
|
86 |
Set<ConstraintViolation<Taxon>> constraintViolations = validator.validate(taxon1, Level3.class);
|
|
87 | 87 |
assertTrue("There should be no constraint violations as this taxon does not have the same name as any other taxa",constraintViolations.isEmpty()); |
88 | 88 |
} |
89 | 89 |
|
... | ... | |
91 | 91 |
public void testTwoAcceptedTaxaWithSameNameSameSec() { |
92 | 92 |
taxon2.setName(name1); |
93 | 93 |
assert taxon1.getName().getTaxonBases().size() == 2; |
94 |
Set<ConstraintViolation<Taxon>> constraintViolations = validator.validate(taxon1, Level2.class);
|
|
94 |
Set<ConstraintViolation<Taxon>> constraintViolations = validator.validate(taxon1, Level3.class);
|
|
95 | 95 |
assertTrue("There should be a single constraint violation as this taxon shares the same name as taxon2 and is according to the same authority, sec1",!constraintViolations.isEmpty()); |
96 | 96 |
} |
97 | 97 |
|
... | ... | |
100 | 100 |
taxon2.setName(name1); |
101 | 101 |
taxon2.setSec(sec2); |
102 | 102 |
assert taxon1.getName().getTaxonBases().size() == 2; |
103 |
Set<ConstraintViolation<Taxon>> constraintViolations = validator.validate(taxon1, Level2.class);
|
|
103 |
Set<ConstraintViolation<Taxon>> constraintViolations = validator.validate(taxon1, Level3.class);
|
|
104 | 104 |
assertTrue("There should not be any constraint violations despite both accepted taxa sharing the same name as the sec reference is different",constraintViolations.isEmpty()); |
105 | 105 |
} |
106 | 106 |
|
... | ... | |
108 | 108 |
public void testTaxonAndSynonymWithSameNameSameSec() { |
109 | 109 |
synonym.setName(name1); |
110 | 110 |
assert taxon1.getName().getTaxonBases().size() == 2; |
111 |
Set<ConstraintViolation<Taxon>> constraintViolations = validator.validate(taxon1, Level2.class);
|
|
111 |
Set<ConstraintViolation<Taxon>> constraintViolations = validator.validate(taxon1, Level3.class);
|
|
112 | 112 |
assertTrue("There should be a single constraint violation as this taxon shares the same name as synonym and is according to the same authority, sec1",!constraintViolations.isEmpty()); |
113 | 113 |
} |
114 | 114 |
} |
Also available in: Unified diff
merge cate-development2 branch with trunk