}
public void testComplex() throws Throwable {
byte[] file = getFileContent("src/test/resources/xml/ComplexDigitalItem.xml");
DIDLType didl = factory.unmarshal("UTF-8", new ByteArrayInputStream(file));
assertFalse(didl.getChildren().isEmpty());
int id = digitalItemDeclarartionsWebsService.addDigitalItem(didl);
try {
DIDLType persisted = digitalItemDeclarartionsWebsService.getDigitalItem(id);
assertNotNull(persisted);
factory.marshall(persisted, new ByteArrayOutputStream(), null); // validates
} finally {
digitalItemDeclarartionsWebsService.removeDigitalItem(id);