commit 9a56a56f40f97a604ef472942104e244e239a23e
Author: Andreas Kohlbecker <a.kohlbecker@bgbm.org>
Date:   Thu Dec 14 15:11:59 2017 +0100

    ref #7103 completeting assertions for SpecimenTypeDesignationWorkingSetServiceImplTest

diff --git a/src/test/java/eu/etaxonomy/cdm/service/SpecimenTypeDesignationWorkingSetServiceImplTest.java b/src/test/java/eu/etaxonomy/cdm/service/SpecimenTypeDesignationWorkingSetServiceImplTest.java
index 8ad1010c..8b05c89e 100644
--- a/src/test/java/eu/etaxonomy/cdm/service/SpecimenTypeDesignationWorkingSetServiceImplTest.java
+++ b/src/test/java/eu/etaxonomy/cdm/service/SpecimenTypeDesignationWorkingSetServiceImplTest.java
@@ -18,6 +18,7 @@ import org.junit.Test;
 import org.unitils.database.annotations.Transactional;
 import org.unitils.database.util.TransactionMode;
 import org.unitils.dbunit.annotation.DataSet;
+import org.unitils.dbunit.annotation.ExpectedDataSet;
 import org.unitils.spring.annotation.SpringBeanByName;
 import org.unitils.spring.annotation.SpringBeanByType;
 
@@ -36,6 +37,7 @@ import eu.etaxonomy.cdm.model.name.SpecimenTypeDesignationStatus;
 import eu.etaxonomy.cdm.model.name.TaxonName;
 import eu.etaxonomy.cdm.model.occurrence.DerivedUnit;
 import eu.etaxonomy.cdm.model.occurrence.FieldUnit;
+import eu.etaxonomy.cdm.model.occurrence.GatheringEvent;
 import eu.etaxonomy.cdm.model.occurrence.MediaSpecimen;
 import eu.etaxonomy.cdm.model.reference.Reference;
 import eu.etaxonomy.cdm.model.reference.ReferenceFactory;
@@ -157,11 +159,9 @@ public class SpecimenTypeDesignationWorkingSetServiceImplTest extends CdmVaadinI
 
     @Test
     @DataSet("SpecimenTypeDesignationWorkingSetServiceImplTest-deleteTest.xml")
-    // @Ignore
+    @ExpectedDataSet("SpecimenTypeDesignationWorkingSetServiceImplTest.deleteTypeDesignationTest-result.xml")
     public void deleteTypeDesignationTest() {
 
-        printDataSetWithNull(System.err,  includeTableNames_delete); // new String[]{"TAXONNAME", "REFERENCE", "AGENTBASE", "HOMOTYPICALGROUP", "REGISTRATION"});
-
         SpecimenTypeDesignationWorkingSetDTO<Registration> workingset = service.loadDtoByIds(registrationId, 0);
         Assert.assertTrue(workingset.getSpecimenTypeDesignationDTOs().size() == 2);
 
@@ -179,12 +179,9 @@ public class SpecimenTypeDesignationWorkingSetServiceImplTest extends CdmVaadinI
         SpecimenTypeDesignation std = deleteDTO.asSpecimenTypeDesignation();
         reg.getTypeDesignations().remove(std);
 
-
-        //printDataSetWithNull(System.err, includeTableNames_delete);
-
         service.save(workingset);
 
-        printDataSetWithNull(System.err, includeTableNames_delete);
+        //printDataSetWithNull(System.err, includeTableNames_delete);
 
         workingset = service.loadDtoByIds(registrationId, 0);
         Assert.assertEquals(1, workingset.getSpecimenTypeDesignationDTOs().size());
@@ -214,8 +211,8 @@ public class SpecimenTypeDesignationWorkingSetServiceImplTest extends CdmVaadinI
         Assert.assertEquals("All TypeDesignations should have been deleted", 0, cdmRepository.getNameService().getAllTypeDesignations(10, 0).size());
         Assert.assertEquals("All derived units should have been deleted", 0, cdmRepository.getOccurrenceService().count(DerivedUnit.class));
         Assert.assertEquals("FieldUnit should have been deleted", 0, cdmRepository.getOccurrenceService().count(FieldUnit.class));
-        // FIXME Assert.assertEquals("Gathering event should have been deleted by orphan remove", 0, cdmRepository.getEventBaseService().count(GatheringEvent.class));
-        // FIXME Assert.assertEquals("Media should have been deleted ", 0, cdmRepository.getMediaService().count(null));
+        Assert.assertEquals("Gathering event should have been deleted by orphan remove", 0, cdmRepository.getEventBaseService().count(GatheringEvent.class));
+        // FIXME  Assert.assertEquals("Media should have been deleted ", 0, cdmRepository.getMediaService().count(null));
 
         // printDataSetWithNull(System.err, includeTableNames_delete);
     }
diff --git a/src/test/resources/eu/etaxonomy/cdm/service/SpecimenTypeDesignationWorkingSetServiceImplTest.deleteTypeDesignationTest-result.xml b/src/test/resources/eu/etaxonomy/cdm/service/SpecimenTypeDesignationWorkingSetServiceImplTest.deleteTypeDesignationTest-result.xml
new file mode 100644
index 00000000..1dad0f6f
--- /dev/null
+++ b/src/test/resources/eu/etaxonomy/cdm/service/SpecimenTypeDesignationWorkingSetServiceImplTest.deleteTypeDesignationTest-result.xml
@@ -0,0 +1,26 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<dataset>
+  <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]"/>
+  <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]"/>
+  <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]"/>
+  <HOMOTYPICALGROUP ID="5000" CREATED="2017-11-23 15:32:58.0" UUID="042ac145-cf9f-47c2-b4a1-8a4350e234eb" CREATEDBY_ID="[null]" UPDATEDBY_ID="[null]"/>
+  <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]"/>
+  <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"/>
+  <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"/>
+  <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"/>
+  <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]"/>
+  <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]"/>
+  <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"/>
+  <REGISTRATION_TYPEDESIGNATIONBASE REGISTRATIONS_ID="5000" TYPEDESIGNATIONS_ID="5001"/>
+  <TAXONNAME_TYPEDESIGNATIONBASE TAXONNAME_ID="5000" TYPEDESIGNATIONS_ID="5001"/>
+    
+</dataset>
+<!--
+  These should be deleted:
+  <TAXONNAME_TYPEDESIGNATIONBASE TAXONNAME_ID="5000" TYPEDESIGNATIONS_ID="5000"/>
+  <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]"/>
+  <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"/>
+  <SPECIMENOROBSERVATIONBASE_DERIVATIONEVENT ORIGINALS_ID="5001" DERIVATIONEVENTS_ID="5000"/>
+  <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"/>
+  <REGISTRATION_TYPEDESIGNATIONBASE REGISTRATIONS_ID="5000" TYPEDESIGNATIONS_ID="5000"/>
+-->
