Fixed SAIL-384: HEAD merge fallout: CMIS TCK

- Implemented NodeService.getAssoc(id)


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@20939 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Derek Hulley
2010-07-05 14:04:36 +00:00
parent ca5fa3a973
commit b59b9604e9
7 changed files with 72 additions and 14 deletions

View File

@@ -2200,6 +2200,10 @@ public abstract class BaseNodeServiceTest extends BaseSpringTest
sourceRef,
anotherTargetRef,
ASSOC_TYPE_QNAME_TEST_NEXT);
Long anotherAssocId = anotherAssocRef.getId();
assertNotNull("Created association does not have an ID", anotherAssocId);
AssociationRef anotherAssocRefCheck = nodeService.getAssoc(anotherAssocId);
assertEquals("Assoc fetched by ID is incorrect.", anotherAssocRef, anotherAssocRefCheck);
// remove assocs
List<AssociationRef> assocs = nodeService.getTargetAssocs(sourceRef, ASSOC_TYPE_QNAME_TEST_NEXT);
@@ -2222,6 +2226,12 @@ public abstract class BaseNodeServiceTest extends BaseSpringTest
List<AssociationRef> targetAssocs = nodeService.getTargetAssocs(sourceRef, qname);
assertEquals("Incorrect number of targets", 1, targetAssocs.size());
assertTrue("Target not found", targetAssocs.contains(assocRef));
// Check that IDs are present
for (AssociationRef targetAssoc : targetAssocs)
{
assertNotNull("Association does not have ID", targetAssoc.getId());
}
}
public void testGetSourceAssocs() throws Exception
@@ -2234,6 +2244,12 @@ public abstract class BaseNodeServiceTest extends BaseSpringTest
List<AssociationRef> sourceAssocs = nodeService.getSourceAssocs(targetRef, qname);
assertEquals("Incorrect number of source assocs", 1, sourceAssocs.size());
assertTrue("Source not found", sourceAssocs.contains(assocRef));
// Check that IDs are present
for (AssociationRef sourceAssoc : sourceAssocs)
{
assertNotNull("Association does not have ID", sourceAssoc.getId());
}
}
/**