Revision 5e97e1b2
Added by Andreas Müller over 12 years ago
cdmlib-services/src/test/java/eu/etaxonomy/cdm/api/service/TaxonNodeServiceImplTest.java | ||
---|---|---|
16 | 16 |
import org.junit.Before; |
17 | 17 |
import org.junit.Ignore; |
18 | 18 |
import org.junit.Test; |
19 |
import org.unitils.dbunit.annotation.DataSet; |
|
19 | 20 |
import org.unitils.spring.annotation.SpringBeanByType; |
20 | 21 |
|
21 | 22 |
import eu.etaxonomy.cdm.model.reference.Reference; |
... | ... | |
31 | 32 |
* @created Dec 16, 2010 |
32 | 33 |
* @version 1.0 |
33 | 34 |
*/ |
35 |
|
|
34 | 36 |
public class TaxonNodeServiceImplTest extends CdmIntegrationTest{ |
35 | 37 |
|
36 | 38 |
@SpringBeanByType |
... | ... | |
53 | 55 |
private Taxon t2; |
54 | 56 |
private Synonym s1; |
55 | 57 |
private SynonymRelationshipType synonymRelationshipType; |
56 |
private Reference reference; |
|
58 |
private Reference<?> reference;
|
|
57 | 59 |
private String referenceDetail; |
58 | 60 |
private Classification classification; |
59 | 61 |
private TaxonNode node2; |
... | ... | |
64 | 66 |
*/ |
65 | 67 |
@Before |
66 | 68 |
public void setUp() throws Exception { |
67 |
|
|
68 |
classification = classificationService.load(classificationUuid); |
|
69 |
|
|
70 |
node1 = taxonNodeService.load(node1Uuid); |
|
71 |
|
|
72 |
node2 = taxonNodeService.load(node2Uuid); |
|
73 |
|
|
74 |
reference = referenceService.load(referenceUuid); |
|
75 |
|
|
76 |
// referencing |
|
77 |
synonymRelationshipType = SynonymRelationshipType.HOMOTYPIC_SYNONYM_OF(); |
|
78 |
referenceDetail = "test"; |
|
79 | 69 |
} |
80 | 70 |
|
81 | 71 |
/** |
82 | 72 |
* Test method for {@link eu.etaxonomy.cdm.api.service.TaxonNodeServiceImpl#makeTaxonNodeASynonymOfAnotherTaxonNode(eu.etaxonomy.cdm.model.taxon.TaxonNode, eu.etaxonomy.cdm.model.taxon.TaxonNode, eu.etaxonomy.cdm.model.taxon.SynonymRelationshipType, eu.etaxonomy.cdm.model.reference.Reference, java.lang.String)}. |
83 | 73 |
*/ |
84 | 74 |
@Test |
85 |
@Ignore
|
|
75 |
@DataSet
|
|
86 | 76 |
public final void testMakeTaxonNodeASynonymOfAnotherTaxonNode() { |
77 |
classification = classificationService.load(classificationUuid); |
|
78 |
node1 = taxonNodeService.load(node1Uuid); |
|
79 |
node2 = taxonNodeService.load(node2Uuid); |
|
80 |
reference = referenceService.load(referenceUuid); |
|
81 |
synonymRelationshipType = SynonymRelationshipType.HOMOTYPIC_SYNONYM_OF(); |
|
82 |
referenceDetail = "test"; |
|
83 |
|
|
84 |
// |
|
85 |
//TODO |
|
86 |
|
|
87 |
|
|
87 | 88 |
// descriptions |
89 |
t1 = node1.getTaxon(); |
|
90 |
t2 = node2.getTaxon(); |
|
91 |
Assert.assertEquals(2, t1.getDescriptions().size()); |
|
92 |
Assert.assertTrue(t2.getSynonyms().isEmpty()); |
|
93 |
Assert.assertTrue(t2.getDescriptions().size() == 0); |
|
88 | 94 |
|
89 | 95 |
taxonNodeService.makeTaxonNodeASynonymOfAnotherTaxonNode(node1, node2, synonymRelationshipType, reference, referenceDetail); |
90 | 96 |
|
91 | 97 |
Assert.assertFalse(t2.getSynonyms().isEmpty()); |
92 |
Assert.assertTrue(t2.getDescriptions().size() == 2);
|
|
98 |
Assert.assertEquals(2, t2.getDescriptions().size());
|
|
93 | 99 |
|
94 | 100 |
} |
95 | 101 |
|
Also available in: Unified diff
bugfix for #2558 (concurrent modification in TaxonNodeServiceImpl.makeTaxonNodeASynonymOfAnotherTaxonNode(...) )