Make destroy more forgiving of test failures

This commit is contained in:
Terry Brady
2017-05-15 14:31:41 -07:00
committed by Terry W Brady
parent c5414e836e
commit c29745d421

View File

@@ -107,28 +107,30 @@ public class ItemTest extends AbstractDSpaceObjectTest
@Override @Override
public void destroy() public void destroy()
{ {
// try {
context.turnOffAuthorisationSystem(); context.turnOffAuthorisationSystem();
//Get new instances, god knows what happended before try {
// it = itemService.find(context, it.getID()); itemService.delete(context, it);
// collection = collectionService.find(context, collection.getID()); } catch(Exception e){
// owningCommunity = communityService.find(context, owningCommunity.getID()); }
//
// communityService.delete(context, owningCommunity); try {
// context.commit(); collectionService.delete(context, collection);
// context.restoreAuthSystemState(); } catch(Exception e){
}
try {
communityService.delete(context, owningCommunity);
} catch(Exception e){
}
context.restoreAuthSystemState();
it = null; it = null;
collection = null; collection = null;
owningCommunity = 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());
// }
} }