- Added getCopies method to CopyService

- Copy and transform actions will now (by default) overwrite an exiting copy.  A parameter can be set on both actions to revert to the previous, always copy, behaviour.

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@2755 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Roy Wetherall
2006-05-04 11:15:38 +00:00
parent 5b81614707
commit 5ba9ae0028
6 changed files with 229 additions and 39 deletions

View File

@@ -315,22 +315,33 @@ public class CopyServiceImplTest extends BaseSpringTest
*/
public void testCopyToNewNode()
{
// Check that the node has no copies
List<NodeRef> copies = this.copyService.getCopies(this.sourceNodeRef);
assertNotNull(copies);
assertTrue(copies.isEmpty());
// Copy to new node without copying children
NodeRef copy = this.copyService.copy(
this.sourceNodeRef,
this.rootNodeRef,
ContentModel.ASSOC_CHILDREN,
QName.createQName("{test}copyAssoc"));
checkCopiedNode(this.sourceNodeRef, copy, true, true, false);
checkCopiedNode(this.sourceNodeRef, copy, true, true, false);
List<NodeRef> copies2 = this.copyService.getCopies(this.sourceNodeRef);
assertNotNull(copies2);
assertEquals(1, copies2.size());
// Copy to new node, copying children
NodeRef copy2 = this.copyService.copy(
this.sourceNodeRef,
this.rootNodeRef,
ContentModel.ASSOC_CHILDREN,
QName.createQName("{test}copyAssoc"),
QName.createQName("{test}copyAssoc2"),
true);
checkCopiedNode(this.sourceNodeRef, copy2, true, true, true);
List<NodeRef> copies3 = this.copyService.getCopies(this.sourceNodeRef);
assertNotNull(copies3);
assertEquals(2, copies3.size());
// Check that a copy of a copy works correctly
NodeRef copyOfCopy = this.copyService.copy(