Revision 1288c4d6
Added by Andreas Müller over 10 years ago
cdmlib-services/src/test/java/eu/etaxonomy/cdm/api/service/TaxonServiceImplTest.java | ||
---|---|---|
26 | 26 |
import org.unitils.dbunit.annotation.DataSet; |
27 | 27 |
import org.unitils.spring.annotation.SpringBeanByType; |
28 | 28 |
|
29 |
import eu.etaxonomy.cdm.api.service.config.IncludedTaxonConfiguration; |
|
29 | 30 |
import eu.etaxonomy.cdm.api.service.config.NameDeletionConfigurator; |
30 | 31 |
import eu.etaxonomy.cdm.api.service.config.SynonymDeletionConfigurator; |
31 | 32 |
import eu.etaxonomy.cdm.api.service.config.TaxonDeletionConfigurator; |
... | ... | |
1644 | 1645 |
@DataSet(value="BlankDataSet.xml") |
1645 | 1646 |
public final void testLlistIncludedTaxa(){ |
1646 | 1647 |
Reference<?> citation = null; |
1647 |
String microCitation = null;
|
|
1648 |
String microcitation = null;
|
|
1648 | 1649 |
|
1649 | 1650 |
Classification cl1 = Classification.NewInstance("testClassification1"); |
1650 | 1651 |
Classification cl2 = Classification.NewInstance("testClassification2"); |
... | ... | |
1682 | 1683 |
Taxon c4Species = Taxon.NewInstance(null, null);c4Species.setUuid(UUID.fromString("9347a3d9-5ece-4d64-9035-e8aaf5d3ee02")); |
1683 | 1684 |
Taxon c4SubSpecies = Taxon.NewInstance(null, null);c4SubSpecies.setUuid(UUID.fromString("777aabbe-4c3a-449c-ab99-a91f2fec9f07")); |
1684 | 1685 |
|
1685 |
c1Species.addTaxonRelation(c2Species, TaxonRelationshipType.CONGRUENT_TO(), citation, microCitation); |
|
1686 |
c1Species.addTaxonRelation(c4Species, TaxonRelationshipType.INCLUDES(), citation, microCitation); |
|
1686 |
c1Species.addTaxonRelation(c2Species, TaxonRelationshipType.CONGRUENT_TO(), citation, microcitation); |
|
1687 |
c1Species.addTaxonRelation(c4Species, TaxonRelationshipType.INCLUDES(), citation, microcitation); |
|
1688 |
c2Species.addTaxonRelation(c1SubSpecies2, TaxonRelationshipType.INCLUDES(), citation, microcitation); |
|
1687 | 1689 |
|
1688 | 1690 |
service.saveOrUpdate(c1Species); |
1689 |
// service.saveOrUpdate(c)
|
|
1691 |
service.saveOrUpdate(c2Species);
|
|
1690 | 1692 |
|
1691 |
IncludedTaxaDTO dto = service.listIncludedTaxa(c1Species.getUuid(), null, false, false);
|
|
1693 |
IncludedTaxaDTO dto = service.listIncludedTaxa(c1Species.getUuid(), new IncludedTaxonConfiguration(null, false, false));
|
|
1692 | 1694 |
Assert.assertNotNull("IncludedTaxaDTO", dto); |
1693 | 1695 |
Assert.assertEquals(7, dto.getIncludedTaxa().size()); |
1696 |
Assert.assertNotNull("date should not be null", dto.getDate()); |
|
1697 |
|
|
1698 |
//only congruent |
|
1699 |
dto = service.listIncludedTaxa(c1Species.getUuid(), new IncludedTaxonConfiguration(null, false, true)); |
|
1700 |
Assert.assertNotNull("IncludedTaxaDTO", dto); |
|
1701 |
Assert.assertEquals(2, dto.getIncludedTaxa().size()); |
|
1702 |
|
|
1703 |
dto = service.listIncludedTaxa(c2Genus.getUuid(), new IncludedTaxonConfiguration(null, false, false)); |
|
1704 |
Assert.assertNotNull("IncludedTaxaDTO", dto); |
|
1705 |
Assert.assertEquals(8, dto.getIncludedTaxa().size()); |
|
1694 | 1706 |
|
1695 | 1707 |
|
1696 | 1708 |
} |
Also available in: Unified diff
update listIncludedTaxa #4045