Revision 71d25f8e
Added by Andreas Müller almost 4 years ago
src/test/java/eu/etaxonomy/cdm/service/SpecimenTypeDesignationWorkingSetServiceImplTest.java | ||
---|---|---|
52 | 52 |
/** |
53 | 53 |
* @author a.kohlbecker |
54 | 54 |
* @since Nov 17, 2017 |
55 |
* |
|
56 | 55 |
*/ |
57 | 56 |
@Transactional(TransactionMode.DISABLED) |
58 | 57 |
// IMPORTANT: test03_deleteTypeDesignationTest executed not as last would cause the other tests to fail due to changes in the db |
... | ... | |
89 | 88 |
"HIBERNATE_SEQUENCES" |
90 | 89 |
}; |
91 | 90 |
|
92 |
|
|
93 | 91 |
@Test |
94 | 92 |
@DataSet("SpecimenTypeDesignationWorkingSetServiceImplTest.xml") |
95 | 93 |
public void test01_createAndEditTest() throws DerivedUnitConversionException, URISyntaxException, FileNotFoundException { |
... | ... | |
124 | 122 |
|
125 | 123 |
SpecimenOrObservationBase<?> baseEntity = cdmRepository.getOccurrenceService().load(workingset.getFieldUnit().getUuid()); |
126 | 124 |
|
127 |
|
|
128 | 125 |
printDataSetWithNull(System.err, new String[]{"TYPEDESIGNATIONBASE", "SPECIMENOROBSERVATIONBASE"}); |
129 | 126 |
|
130 | 127 |
TypedEntityReference<FieldUnit> baseEntityRef = new TypedEntityReference<FieldUnit>(FieldUnit.class, baseEntity.getUuid(), baseEntity.getTitleCache()); |
... | ... | |
149 | 146 |
workingset = service.load(registrationUuid, baseEntityRef); |
150 | 147 |
Assert.assertTrue(workingset.getSpecimenTypeDesignationDTOs().size() == 2); |
151 | 148 |
|
152 |
|
|
153 | 149 |
//FIXME this fails: Assert.assertEquals("There must only be one FieldUnit and one MediaSpecimen", 2, cdmRepository.getOccurrenceService().count(DerivedUnit.class)); |
154 | 150 |
|
155 | 151 |
// write test data for delete test |
... | ... | |
223 | 219 |
// UUID typeDesignation1UUID = UUID.fromString("a1896ae2-4396-4243-988e-3d74058b44ab"); |
224 | 220 |
// UUID typeDesignation2UUID = UUID.fromString("a1896ae2-4396-4243-988e-3d74058b44ab"); |
225 | 221 |
|
226 |
|
|
227 | 222 |
Assert.assertEquals("All TypeDesignations should have been deleted", 0, cdmRepository.getNameService().getAllTypeDesignations(10, 0).size()); |
228 | 223 |
Assert.assertEquals("All derived units should have been deleted", 0, cdmRepository.getOccurrenceService().count(DerivedUnit.class)); |
229 | 224 |
Assert.assertEquals("FieldUnit should have been deleted", 0, cdmRepository.getOccurrenceService().count(FieldUnit.class)); |
... | ... | |
260 | 255 |
reg.setUuid(registrationUuid); |
261 | 256 |
reg = cdmRepository.getRegistrationService().save(reg); |
262 | 257 |
|
263 |
|
|
264 | 258 |
//printDataSetWithNull(System.err, includeTableNames_create); |
265 | 259 |
|
266 | 260 |
writeDbUnitDataSetFile(includeTableNames_create); |
267 | 261 |
} |
268 |
|
|
269 |
|
|
270 |
|
|
271 |
|
|
272 |
|
|
273 |
|
|
274 |
|
|
275 | 262 |
} |
Also available in: Unified diff
cleanup