Added removeChildAssociation method to NodeService

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@4706 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Derek Hulley
2007-01-02 14:25:16 +00:00
parent f2c70b78e1
commit 61c2f1a614
8 changed files with 179 additions and 34 deletions

View File

@@ -816,6 +816,31 @@ public abstract class BaseNodeServiceTest extends BaseSpringTest
// expected
}
}
public void testRemoveSpecificChild() throws Exception
{
NodeRef parentRef = nodeService.createNode(
rootNodeRef,
ASSOC_TYPE_QNAME_TEST_CHILDREN,
QName.createQName("parent_child"),
ContentModel.TYPE_CONTAINER).getChildRef();
ChildAssociationRef pathARef = nodeService.createNode(
parentRef,
ASSOC_TYPE_QNAME_TEST_CHILDREN,
QName.createQName("pathA"),
ContentModel.TYPE_CONTAINER);
ChildAssociationRef pathBRef = nodeService.addChild(
parentRef,
pathARef.getChildRef(),
ASSOC_TYPE_QNAME_TEST_CHILDREN,
QName.createQName("pathB"));
// now remove the second association
boolean removed = nodeService.removeChildAssociation(pathBRef);
assertTrue("Association was not removed", removed);
removed = nodeService.removeChildAssociation(pathBRef);
assertFalse("Non-existent association was apparently removed", removed);
}
public void testRemoveChildByRef() throws Exception
{