Added more unit tests for RenditionNodeManager which is used by the RenditionServiceImpl to decide where to create a rendition node and how to handle the old rendition node if one exists.

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@19445 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
N Smith
2010-03-22 11:05:04 +00:00
parent 9a6f2ccdae
commit f83eb0d509
4 changed files with 419 additions and 40 deletions

View File

@@ -65,7 +65,7 @@ public class RenditionNodeManager
public ChildAssociationRef findOrCreateRenditionNode()
{
QName renditionName = renditionDefinition.getRenditionName();
// If no rendition already exists create anew rendition node and
// If no rendition already exists create a new rendition node and
// association.
if (oldRendition == null)
{
@@ -94,7 +94,9 @@ public class RenditionNodeManager
private ChildAssociationRef moveRendition(QName associationName)
{
return nodeService.moveNode(oldRendition, location.getParentRef(), ContentModel.ASSOC_CONTAINS, associationName);
NodeRef parent = location.getParentRef();
QName assocType = sourceNode.equals(parent) ? RenditionModel.ASSOC_RENDITION : ContentModel.ASSOC_CONTAINS;
return nodeService.moveNode(oldRendition, parent, assocType, associationName);
}
private void orphanRendition(QNamePattern renditionName)