Adjusted AVMCrawlTestPP to be more stringent now that we have retryin

transactions.
History is noww correctly maintained for cases of deletes followed by renames
or creates.


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@4587 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Britt Park
2006-12-12 21:09:07 +00:00
parent 24a00b201f
commit 7f8c678bd5
5 changed files with 85 additions and 29 deletions

View File

@@ -596,11 +596,12 @@ public class AVMRepository
throw new AVMNotFoundException("Path not found.");
}
DirectoryNode dstDir = (DirectoryNode)dPath.getCurrentNode();
AVMNode dstNode = dstDir.lookupChild(dPath, dstName, false);
if (dstNode != null)
AVMNode child = dstDir.lookupChild(dPath, dstName, true);
if (child != null && child.getType() != AVMNodeType.DELETED_NODE)
{
throw new AVMExistsException("Node exists: " + dstName);
}
AVMNode dstNode = null;
// We've passed the check, so we can go ahead and do the rename.
if (srcNode.getType() == AVMNodeType.PLAIN_DIRECTORY)
{
@@ -682,9 +683,16 @@ public class AVMRepository
srcDir.removeChild(sPath, srcName);
srcDir.updateModTime();
dstNode.setVersionID(dstRepo.getNextVersionID());
if (child != null)
{
dstNode.setAncestor(child);
}
dstDir.putChild(dstName, dstNode);
dstDir.updateModTime();
dstNode.setAncestor(srcNode);
if (child == null)
{
dstNode.setAncestor(srcNode);
}
}
finally
{