Project

General

Profile

« Previous | Next » 

Revision 9a56a56f

Added by Andreas Kohlbecker over 6 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
    }

Also available in: Unified diff