Revision c897d0ac
Added by Andreas Müller over 11 years ago
cdmlib-services/src/test/java/eu/etaxonomy/cdm/api/service/TaxonServiceImplBusinessTest.java | ||
---|---|---|
145 | 145 |
|
146 | 146 |
HomotypicalGroup homoGroup = newTaxon.getHomotypicGroup(); |
147 | 147 |
Assert.assertEquals("Homotypical group must be the same group as for the old synonym", group, homoGroup); |
148 |
|
|
148 | 149 |
List<Synonym> synonymsInNewTaxonsGroup = newTaxon.getSynonymsInGroup(homoGroup); |
149 |
Assert.assertEquals("New accepted taxons homotypic group should have 2 synonym: s2 and the old synonym (which has not been deleted)", 2, synonymsInNewTaxonsGroup.size()); |
|
150 |
String message = "New accepted taxon should have 1 synonym in its homotypic group: s2. The old synonym may still exist (or not) but not as a synonym of the new taxon"; |
|
151 |
Assert.assertEquals(message, 1, synonymsInNewTaxonsGroup.size()); |
|
150 | 152 |
Assert.assertTrue("The old synonym's homotypic 'partner' must be a synonym of the new accepted taxon, too.", synonymsInNewTaxonsGroup.contains(s2)); |
151 |
Assert.assertTrue("The old synonym must be in the new accepted taxons homotypic group as it has not been deleted ", synonymsInNewTaxonsGroup.contains(s2)); |
|
153 |
Assert.assertTrue("The old synonym must be in the new accepted taxons homotypic group as it has not been deleted ", newTaxon.getName().getHomotypicalGroup().equals(s2.getName().getHomotypicalGroup())); |
|
154 |
|
|
152 | 155 |
boolean iWasHere = false; |
153 | 156 |
for (Synonym syn : synonymsInNewTaxonsGroup){ |
154 | 157 |
if (syn.equals(s2) ){ |
... | ... | |
160 | 163 |
Assert.assertTrue("Relationship to s2 must have been concidered in 'for'-loop", iWasHere); |
161 | 164 |
|
162 | 165 |
try { |
163 |
Taxon newTaxon2 = service.changeSynonymToAcceptedTaxon(homotypicSynonym, t1, false, true, null, null);
|
|
166 |
service.changeSynonymToAcceptedTaxon(homotypicSynonym, t1, false, true, null, null); |
|
164 | 167 |
Assert.fail("The method should throw an exception when invoked on taxa in the same homotypical group"); |
165 | 168 |
} catch (IllegalArgumentException e) { |
166 | 169 |
//OK |
Also available in: Unified diff
bugfix for test in TaxonServiceImplBusinessTest (related to #2580)