Update to latest Chemistry TCK for new relationship tests

- also fix relationship issues as found by relationship tests

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@18954 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
David Caruana
2010-03-02 18:08:21 +00:00
parent 96193a759a
commit cd339edad4
3 changed files with 16 additions and 7 deletions

View File

@@ -1129,7 +1129,7 @@ public class CMISServicesImpl implements CMISServices, ApplicationContextAware,
}
Object object = getReadableObject(objectId, Object.class);
NodeRef result;
Object result;
// Map version nodes back to their source node
if (object instanceof Version)
{
@@ -1148,14 +1148,22 @@ public class CMISServicesImpl implements CMISServices, ApplicationContextAware,
{
result = nodeRef;
}
if (isVersionable)
{
validateVersionable((NodeRef)result);
}
}
else if (requiredType.isAssignableFrom(object.getClass()))
{
if (isVersionable)
{
throw new CMISConstraintException(objectId + " is not versionable");
}
result = object;
}
else
{
throw new CMISConstraintException("Object " + objectId + " is not of required type");
}
if (isVersionable)
{
validateVersionable(result);
throw new CMISConstraintException("Object " + objectId + " is not of required type");
}
return (T)result;
}