mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-10 11:33:11 +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
|
@Override
|
||||||
public void destroy()
|
public void destroy()
|
||||||
{
|
{
|
||||||
// try {
|
context.turnOffAuthorisationSystem();
|
||||||
context.turnOffAuthorisationSystem();
|
try {
|
||||||
//Get new instances, god knows what happended before
|
itemService.delete(context, it);
|
||||||
// it = itemService.find(context, it.getID());
|
} catch(Exception e){
|
||||||
// collection = collectionService.find(context, collection.getID());
|
}
|
||||||
// owningCommunity = communityService.find(context, owningCommunity.getID());
|
|
||||||
//
|
try {
|
||||||
// communityService.delete(context, owningCommunity);
|
collectionService.delete(context, collection);
|
||||||
// context.commit();
|
} catch(Exception e){
|
||||||
// context.restoreAuthSystemState();
|
}
|
||||||
it = null;
|
|
||||||
collection = null;
|
try {
|
||||||
owningCommunity = null;
|
communityService.delete(context, owningCommunity);
|
||||||
|
} catch(Exception e){
|
||||||
|
}
|
||||||
|
|
||||||
|
context.restoreAuthSystemState();
|
||||||
|
it = null;
|
||||||
|
collection = null;
|
||||||
|
owningCommunity = null;
|
||||||
|
try {
|
||||||
super.destroy();
|
super.destroy();
|
||||||
// } catch (SQLException | AuthorizeException | IOException ex) {
|
} catch(Exception e){
|
||||||
// if(context.isValid())
|
}
|
||||||
// {
|
|
||||||
// context.abort();
|
|
||||||
// }
|
|
||||||
// log.error("Error in destroy", ex);
|
|
||||||
// fail("Error in destroy: " + ex.getMessage());
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user