Added method to delete multiple child contexts for unique property contexts

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@16441 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Derek Hulley
2009-09-22 15:17:45 +00:00
parent 1935a73684
commit a48ac3deca
7 changed files with 113 additions and 32 deletions

View File

@@ -122,5 +122,31 @@ public class PropertyValueComponentTest extends TestCase
logger.debug("Expected exception: " + e.getMessage());
}
}
// Delete everything for the store and check that both are creatable again
RetryingTransactionCallback<Void> deleteStoreCallback = new RetryingTransactionCallback<Void>()
{
public Void execute() throws Throwable
{
propertyValueComponent.deletePropertyUniqueContexts(context, store);
propertyValueComponent.createPropertyUniqueContext(context, store, uuid1);
propertyValueComponent.createPropertyUniqueContext(context, store, uuid2);
return null;
}
};
transactionService.getRetryingTransactionHelper().doInTransaction(deleteStoreCallback);
// Delete everything for the context and check that both are creatable again
RetryingTransactionCallback<Void> deleteContextCallback = new RetryingTransactionCallback<Void>()
{
public Void execute() throws Throwable
{
propertyValueComponent.deletePropertyUniqueContexts(context);
propertyValueComponent.createPropertyUniqueContext(context, store, uuid1);
propertyValueComponent.createPropertyUniqueContext(context, store, uuid2);
return null;
}
};
transactionService.getRetryingTransactionHelper().doInTransaction(deleteContextCallback);
}
}