Project

General

Profile

« Previous | Next » 

Revision 9a56a56f

Added by Andreas Kohlbecker over 4 years ago

ref #7103 completeting assertions for SpecimenTypeDesignationWorkingSetServiceImplTest

View differences:

src/test/java/eu/etaxonomy/cdm/service/SpecimenTypeDesignationWorkingSetServiceImplTest.java
18 18
import org.unitils.database.annotations.Transactional;
19 19
import org.unitils.database.util.TransactionMode;
20 20
import org.unitils.dbunit.annotation.DataSet;
21
import org.unitils.dbunit.annotation.ExpectedDataSet;
21 22
import org.unitils.spring.annotation.SpringBeanByName;
22 23
import org.unitils.spring.annotation.SpringBeanByType;
23 24

  
......
36 37
import eu.etaxonomy.cdm.model.name.TaxonName;
37 38
import eu.etaxonomy.cdm.model.occurrence.DerivedUnit;
38 39
import eu.etaxonomy.cdm.model.occurrence.FieldUnit;
40
import eu.etaxonomy.cdm.model.occurrence.GatheringEvent;
39 41
import eu.etaxonomy.cdm.model.occurrence.MediaSpecimen;
40 42
import eu.etaxonomy.cdm.model.reference.Reference;
41 43
import eu.etaxonomy.cdm.model.reference.ReferenceFactory;
......
157 159

  
158 160
    @Test
159 161
    @DataSet("SpecimenTypeDesignationWorkingSetServiceImplTest-deleteTest.xml")
160
    // @Ignore
162
    @ExpectedDataSet("SpecimenTypeDesignationWorkingSetServiceImplTest.deleteTypeDesignationTest-result.xml")
161 163
    public void deleteTypeDesignationTest() {
162 164

  
163
        printDataSetWithNull(System.err,  includeTableNames_delete); // new String[]{"TAXONNAME", "REFERENCE", "AGENTBASE", "HOMOTYPICALGROUP", "REGISTRATION"});
164

  
165 165
        SpecimenTypeDesignationWorkingSetDTO<Registration> workingset = service.loadDtoByIds(registrationId, 0);
166 166
        Assert.assertTrue(workingset.getSpecimenTypeDesignationDTOs().size() == 2);
167 167

  
......
179 179
        SpecimenTypeDesignation std = deleteDTO.asSpecimenTypeDesignation();
180 180
        reg.getTypeDesignations().remove(std);
181 181

  
182

  
183
        //printDataSetWithNull(System.err, includeTableNames_delete);
184

  
185 182
        service.save(workingset);
186 183

  
187
        printDataSetWithNull(System.err, includeTableNames_delete);
184
        //printDataSetWithNull(System.err, includeTableNames_delete);
188 185

  
189 186
        workingset = service.loadDtoByIds(registrationId, 0);
190 187
        Assert.assertEquals(1, workingset.getSpecimenTypeDesignationDTOs().size());
......
214 211
        Assert.assertEquals("All TypeDesignations should have been deleted", 0, cdmRepository.getNameService().getAllTypeDesignations(10, 0).size());
215 212
        Assert.assertEquals("All derived units should have been deleted", 0, cdmRepository.getOccurrenceService().count(DerivedUnit.class));
216 213
        Assert.assertEquals("FieldUnit should have been deleted", 0, cdmRepository.getOccurrenceService().count(FieldUnit.class));
217
        // FIXME Assert.assertEquals("Gathering event should have been deleted by orphan remove", 0, cdmRepository.getEventBaseService().count(GatheringEvent.class));
218
        // FIXME Assert.assertEquals("Media should have been deleted ", 0, cdmRepository.getMediaService().count(null));
214
        Assert.assertEquals("Gathering event should have been deleted by orphan remove", 0, cdmRepository.getEventBaseService().count(GatheringEvent.class));
215
        // FIXME  Assert.assertEquals("Media should have been deleted ", 0, cdmRepository.getMediaService().count(null));
219 216

  
220 217
        // printDataSetWithNull(System.err, includeTableNames_delete);
221 218
    }
src/test/resources/eu/etaxonomy/cdm/service/SpecimenTypeDesignationWorkingSetServiceImplTest.deleteTypeDesignationTest-result.xml
1
<?xml version='1.0' encoding='UTF-8'?>
2
<dataset>
3
  <TAXONNAME ID="5000" CREATED="2017-11-23 15:32:58.0" UUID="47d9263e-b32a-42af-98ea-5528f154384f" NAMETYPE="ICNAFP" LSID_AUTHORITY="[null]" LSID_LSID="[null]" LSID_NAMESPACE="[null]" LSID_OBJECT="[null]" LSID_REVISION="[null]" PROTECTEDTITLECACHE="false" TITLECACHE="Planothidium victori" APPENDEDPHRASE="[null]" FULLTITLECACHE="Planothidium victori in - undefined journal -: 11-45" NOMENCLATURALMICROREFERENCE="11-45" PARSINGPROBLEM="0" PROBLEMENDS="-1" PROBLEMSTARTS="-1" PROTECTEDFULLTITLECACHE="false" AUTHORSHIPCACHE="" BINOMHYBRID="false" GENUSORUNINOMIAL="Planothidium" HYBRIDFORMULA="false" INFRAGENERICEPITHET="[null]" INFRASPECIFICEPITHET="[null]" MONOMHYBRID="false" NAMECACHE="Planothidium victori" PROTECTEDAUTHORSHIPCACHE="false" PROTECTEDNAMECACHE="false" SPECIFICEPITHET="victori" TRINOMHYBRID="false" NAMEAPPROBATION="[null]" SUBGENUSAUTHORSHIP="[null]" ANAMORPHIC="false" CULTIVARNAME="[null]" ACRONYM="[null]" BREED="[null]" ORIGINALPUBLICATIONYEAR="[null]" PUBLICATIONYEAR="[null]" CREATEDBY_ID="[null]" UPDATEDBY_ID="[null]" HOMOTYPICALGROUP_ID="5000" NOMENCLATURALREFERENCE_ID="5000" RANK_ID="765" BASIONYMAUTHORSHIP_ID="[null]" COMBINATIONAUTHORSHIP_ID="[null]" EXBASIONYMAUTHORSHIP_ID="[null]" EXCOMBINATIONAUTHORSHIP_ID="[null]"/>
4
  <REFERENCE ID="5000" CREATED="2017-11-23 15:32:58.0" UUID="45804c65-7df9-42fd-b43a-818a8958c264" LSID_AUTHORITY="[null]" LSID_LSID="[null]" LSID_NAMESPACE="[null]" LSID_OBJECT="[null]" LSID_REVISION="[null]" PROTECTEDTITLECACHE="false" TITLECACHE="Novis, Braidwood &amp; Kilroy, P.M. Novis, J. Braidwood &amp; C. Kilroy, Small diatoms (Bacillariophyta) in cultures from the Styx River, New Zealand, including descriptions of three new species in Phytotaxa 64 in - undefined journal -" DATEPUBLISHED_END="[null]" DATEPUBLISHED_FREETEXT="[null]" DATEPUBLISHED_START="[null]" EDITION="[null]" EDITOR="[null]" ISBN="[null]" ISSN="[null]" DOI="[null]" NOMENCLATURALLYRELEVANT="false" ORGANIZATION="[null]" PAGES="[null]" PARSINGPROBLEM="0" PLACEPUBLISHED="[null]" PROBLEMENDS="-1" PROBLEMSTARTS="-1" PUBLISHER="[null]" REFERENCEABSTRACT="[null]" SERIESPART="[null]" TITLE="P.M. Novis, J. Braidwood &amp; C. Kilroy, Small diatoms (Bacillariophyta) in cultures from the Styx River, New Zealand, including descriptions of three new species in Phytotaxa 64" ABBREVTITLE="[null]" ABBREVTITLECACHE="Novis, Braidwood &amp; Kilroy, P.M. Novis, J. Braidwood &amp; C. Kilroy, Small diatoms (Bacillariophyta) in cultures from the Styx River, New Zealand, including descriptions of three new species in Phytotaxa 64 in - undefined journal -" PROTECTEDABBREVTITLECACHE="false" REFTYPE="ART" URI="[null]" VOLUME="[null]" ACCESSED="[null]" LASTRETRIEVED="[null]" EXTERNALID="[null]" EXTERNALLINK="[null]" AUTHORITYTYPE="[null]" CREATEDBY_ID="[null]" UPDATEDBY_ID="[null]" AUTHORSHIP_ID="5000" INREFERENCE_ID="[null]" INSTITUTION_ID="[null]" SCHOOL_ID="[null]"/>
5
  <AGENTBASE DTYPE="Team" ID="5000" CREATED="2017-11-23 15:32:58.0" UUID="05555fcb-72bf-49d0-9677-4de87f13e9ed" LSID_AUTHORITY="[null]" LSID_LSID="[null]" LSID_NAMESPACE="[null]" LSID_OBJECT="[null]" LSID_REVISION="[null]" PROTECTEDTITLECACHE="true" TITLECACHE="Novis, Braidwood &amp; Kilroy" PROTECTEDCOLLECTORTITLECACHE="false" COLLECTORTITLE="[null]" PROTECTEDNOMENCLATURALTITLECACHE="true" NOMENCLATURALTITLE="Novis, Braidwood &amp; Kilroy" CODE="[null]" NAME="[null]" FIRSTNAME="[null]" INITIALS="[null]" LASTNAME="[null]" LIFESPAN_END="[null]" LIFESPAN_FREETEXT="[null]" LIFESPAN_START="[null]" PREFIX="[null]" SUFFIX="[null]" HASMOREMEMBERS="false" CREATEDBY_ID="[null]" UPDATEDBY_ID="[null]" ISPARTOF_ID="[null]"/>
6
  <HOMOTYPICALGROUP ID="5000" CREATED="2017-11-23 15:32:58.0" UUID="042ac145-cf9f-47c2-b4a1-8a4350e234eb" CREATEDBY_ID="[null]" UPDATEDBY_ID="[null]"/>
7
  <REGISTRATION ID="5000" CREATED="2017-11-23 15:32:58.0" UUID="c8bb4e70-ca85-43c3-ae81-c90a2b41a93f" IDENTIFIER="[null]" REGISTRATIONDATE="[null]" SPECIFICIDENTIFIER="[null]" STATUS="PREP" CREATEDBY_ID="[null]" UPDATEDBY_ID="[null]" INSTITUTION_ID="[null]" NAME_ID="5000" SUBMITTER_ID="[null]"/>
8
  <DERIVATIONEVENT ID="5001" CREATED="2017-11-24 16:26:04.0" UUID="50537c4e-e8cf-45e7-9e9d-e73197d17be8" DESCRIPTION="[null]" TIMEPERIOD_END="[null]" TIMEPERIOD_FREETEXT="[null]" TIMEPERIOD_START="[null]" CREATEDBY_ID="[null]" UPDATEDBY_ID="[null]" ACTOR_ID="[null]" INSTITUTION_ID="[null]" TYPE_ID="1998"/>
9
  <GATHERINGEVENT ID="5000" CREATED="2017-11-24 16:26:03.0" UUID="23d40440-38bb-46c1-af11-6e25dcfa0145" DESCRIPTION="[null]" TIMEPERIOD_END="[null]" TIMEPERIOD_FREETEXT="[null]" TIMEPERIOD_START="[null]" ABSOLUTEELEVATION="[null]" ABSOLUTEELEVATIONMAX="[null]" ABSOLUTEELEVATIONTEXT="[null]" COLLECTINGMETHOD="[null]" DISTANCETOGROUND="[null]" DISTANCETOGROUNDMAX="[null]" DISTANCETOGROUNDTEXT="[null]" DISTANCETOWATERSURFACE="[null]" DISTANCETOWATERSURFACEMAX="[null]" DISTANCETOWATERSURFACETEXT="[null]" EXACTLOCATION_ERRORRADIUS="[null]" EXACTLOCATION_LATITUDE="[null]" EXACTLOCATION_LONGITUDE="[null]" CREATEDBY_ID="[null]" UPDATEDBY_ID="[null]" ACTOR_ID="[null]" COUNTRY_ID="[null]" EXACTLOCATION_REFERENCESYSTEM_ID="[null]" LOCALITY_ID="5000"/>
10
  <LANGUAGESTRING ID="5000" CREATED="2017-11-24 16:26:03.0" UUID="c63419cd-445c-4086-a03a-c2d200ad6fe5" TEXT="Somewhere" CREATEDBY_ID="[null]" UPDATEDBY_ID="[null]" LANGUAGE_ID="406"/>
11
  <SPECIMENOROBSERVATIONBASE DTYPE="FieldUnit" ID="5001" CREATED="2017-11-24 16:26:03.0" UUID="22be718a-6f21-4b74-aae3-bb7d7d659e1c" RECORDBASIS="FU" LSID_AUTHORITY="[null]" LSID_LSID="[null]" LSID_NAMESPACE="[null]" LSID_OBJECT="[null]" LSID_REVISION="[null]" PROTECTEDTITLECACHE="false" TITLECACHE="Somewhere, FieldNumber." PROTECTEDIDENTITYCACHE="false" IDENTITYCACHE="[null]" PUBLISH="true" INDIVIDUALCOUNT="[null]" PREFERREDSTABLEURI="[null]" ACCESSIONNUMBER="[null]" BARCODE="[null]" CATALOGNUMBER="[null]" COLLECTORSNUMBER="[null]" EXSICCATUM="[null]" ORIGINALLABELINFO="[null]" FIELDNOTES="FieldNotes" FIELDNUMBER="FieldNumber" CREATEDBY_ID="[null]" UPDATEDBY_ID="[null]" LIFESTAGE_ID="[null]" SEX_ID="[null]" KINDOFUNIT_ID="[null]" COLLECTION_ID="[null]" DERIVEDFROM_ID="[null]" STOREDUNDER_ID="[null]" PRESERVATION_ID="[null]" GATHERINGEVENT_ID="5000" PRIMARYCOLLECTOR_ID="[null]" MEDIASPECIMEN_ID="[null]" DNAQUALITY_ID="[null]"/>
12
  <SPECIMENOROBSERVATIONBASE DTYPE="DerivedUnit" ID="5003" CREATED="2017-11-24 16:26:04.0" UUID="2e384f8e-fbb0-44eb-9d5f-1b7235493932" RECORDBASIS="PS" LSID_AUTHORITY="[null]" LSID_LSID="[null]" LSID_NAMESPACE="[null]" LSID_OBJECT="[null]" LSID_REVISION="[null]" PROTECTEDTITLECACHE="false" TITLECACHE="Somewhere, FieldNumber (TEST_2)." PROTECTEDIDENTITYCACHE="false" IDENTITYCACHE="[null]" PUBLISH="true" INDIVIDUALCOUNT="[null]" PREFERREDSTABLEURI="[null]" ACCESSIONNUMBER="TEST_2" BARCODE="[null]" CATALOGNUMBER="[null]" COLLECTORSNUMBER="[null]" EXSICCATUM="[null]" ORIGINALLABELINFO="[null]" FIELDNOTES="[null]" FIELDNUMBER="[null]" CREATEDBY_ID="[null]" UPDATEDBY_ID="[null]" LIFESTAGE_ID="[null]" SEX_ID="[null]" KINDOFUNIT_ID="2064" COLLECTION_ID="[null]" DERIVEDFROM_ID="5001" STOREDUNDER_ID="[null]" PRESERVATION_ID="[null]" GATHERINGEVENT_ID="[null]" PRIMARYCOLLECTOR_ID="[null]" MEDIASPECIMEN_ID="[null]" DNAQUALITY_ID="[null]"/>
13
  <TYPEDESIGNATIONBASE DTYPE="SpecimenTypeDesignation" ID="5001" CREATED="2017-11-24 16:26:04.0" UUID="9824e111-1598-4187-ba89-8a27fb5dcaf9" CITATIONMICROREFERENCE="[null]" ORIGINALNAMESTRING="[null]" NOTDESIGNATED="false" CONSERVEDTYPE="[null]" REJECTEDTYPE="[null]" CREATEDBY_ID="[null]" UPDATEDBY_ID="[null]" CITATION_ID="5000" TYPESTATUS_ID="821" TYPENAME_ID="[null]" TYPESPECIMEN_ID="5003"/>
14
  <REGISTRATION_TYPEDESIGNATIONBASE REGISTRATIONS_ID="5000" TYPEDESIGNATIONS_ID="5001"/>
15
  <TAXONNAME_TYPEDESIGNATIONBASE TAXONNAME_ID="5000" TYPEDESIGNATIONS_ID="5001"/>
16
    
17
</dataset>
18
<!--
19
  These should be deleted:
20
  <TAXONNAME_TYPEDESIGNATIONBASE TAXONNAME_ID="5000" TYPEDESIGNATIONS_ID="5000"/>
21
  <SPECIMENOROBSERVATIONBASE DTYPE="MediaSpecimen" ID="5002" CREATED="2017-11-24 16:26:04.0" UUID="10eceb2c-9b51-458e-8dcd-2cb92cc558a9" RECORDBASIS="SI" LSID_AUTHORITY="[null]" LSID_LSID="[null]" LSID_NAMESPACE="[null]" LSID_OBJECT="[null]" LSID_REVISION="[null]" PROTECTEDTITLECACHE="false" TITLECACHE="Somewhere, FieldNumber (TEST_1)." PROTECTEDIDENTITYCACHE="false" IDENTITYCACHE="[null]" PUBLISH="true" INDIVIDUALCOUNT="[null]" PREFERREDSTABLEURI="[null]" ACCESSIONNUMBER="TEST_1" BARCODE="[null]" CATALOGNUMBER="[null]" COLLECTORSNUMBER="[null]" EXSICCATUM="[null]" ORIGINALLABELINFO="[null]" FIELDNOTES="[null]" FIELDNUMBER="[null]" CREATEDBY_ID="[null]" UPDATEDBY_ID="[null]" LIFESTAGE_ID="[null]" SEX_ID="[null]" KINDOFUNIT_ID="2065" COLLECTION_ID="[null]" DERIVEDFROM_ID="5000" STOREDUNDER_ID="[null]" PRESERVATION_ID="[null]" GATHERINGEVENT_ID="[null]" PRIMARYCOLLECTOR_ID="[null]" MEDIASPECIMEN_ID="5000" DNAQUALITY_ID="[null]"/>
22
  <DERIVATIONEVENT ID="5000" CREATED="2017-11-24 16:26:03.0" UUID="42610c79-b50f-4d86-94e6-9f775266f6e5" DESCRIPTION="[null]" TIMEPERIOD_END="[null]" TIMEPERIOD_FREETEXT="[null]" TIMEPERIOD_START="[null]" CREATEDBY_ID="[null]" UPDATEDBY_ID="[null]" ACTOR_ID="[null]" INSTITUTION_ID="[null]" TYPE_ID="1998"/>
23
  <SPECIMENOROBSERVATIONBASE_DERIVATIONEVENT ORIGINALS_ID="5001" DERIVATIONEVENTS_ID="5000"/>
24
  <TYPEDESIGNATIONBASE DTYPE="SpecimenTypeDesignation" ID="5000" CREATED="2017-11-24 16:26:03.0" UUID="a1896ae2-4396-4243-988e-3d74058b44ab" CITATIONMICROREFERENCE="[null]" ORIGINALNAMESTRING="[null]" NOTDESIGNATED="false" CONSERVEDTYPE="[null]" REJECTEDTYPE="[null]" CREATEDBY_ID="[null]" UPDATEDBY_ID="[null]" CITATION_ID="5000" TYPESTATUS_ID="821" TYPENAME_ID="[null]" TYPESPECIMEN_ID="5002"/>
25
  <REGISTRATION_TYPEDESIGNATIONBASE REGISTRATIONS_ID="5000" TYPEDESIGNATIONS_ID="5000"/>
26
-->

Also available in: Unified diff