mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-08 02:24:18 +00:00
Make destroy more forgiving of test failures
This commit is contained in:

committed by
Terry W Brady

parent
c5414e836e
commit
c29745d421
@@ -107,28 +107,30 @@ public class ItemTest extends AbstractDSpaceObjectTest
|
||||
@Override
|
||||
public void destroy()
|
||||
{
|
||||
// try {
|
||||
context.turnOffAuthorisationSystem();
|
||||
//Get new instances, god knows what happended before
|
||||
// it = itemService.find(context, it.getID());
|
||||
// collection = collectionService.find(context, collection.getID());
|
||||
// owningCommunity = communityService.find(context, owningCommunity.getID());
|
||||
//
|
||||
// communityService.delete(context, owningCommunity);
|
||||
// context.commit();
|
||||
// context.restoreAuthSystemState();
|
||||
it = null;
|
||||
collection = null;
|
||||
owningCommunity = null;
|
||||
context.turnOffAuthorisationSystem();
|
||||
try {
|
||||
itemService.delete(context, it);
|
||||
} catch(Exception e){
|
||||
}
|
||||
|
||||
try {
|
||||
collectionService.delete(context, collection);
|
||||
} catch(Exception e){
|
||||
}
|
||||
|
||||
try {
|
||||
communityService.delete(context, owningCommunity);
|
||||
} catch(Exception e){
|
||||
}
|
||||
|
||||
context.restoreAuthSystemState();
|
||||
it = null;
|
||||
collection = null;
|
||||
owningCommunity = null;
|
||||
try {
|
||||
super.destroy();
|
||||
// } catch (SQLException | AuthorizeException | IOException ex) {
|
||||
// if(context.isValid())
|
||||
// {
|
||||
// context.abort();
|
||||
// }
|
||||
// log.error("Error in destroy", ex);
|
||||
// fail("Error in destroy: " + ex.getMessage());
|
||||
// }
|
||||
} catch(Exception e){
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user