mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-14 17:58:59 +00:00
Merging BRANCHES/DEV/CMIS_10 to HEAD (phase 2 - currently up-to-date with branch):
18717: SAIL-166: Refactor CMIS to use shared services and resolve objectIds and error codes consistently 18731: SAIL-169: CMIS REST versioning compliance 18732: Fix failing change log test. 18768: Add displayName and queryName attributes to rendered properties (in CMIS AtomPub binding). 18775: Fix exception reporting when retrieving items that do not exist (in CMIS AtomPub binding). 18784: Fix CMIS REST change logging 18785: SAIL-174: CMIS Relationship lookup by association ID 18812: SAIL-183: Support orderBy argument for getChildren and getCheckedOutDocs in CMIS REST and Web Service bindings 18823: CMIS WS Bindings were moved to 1.0 cd07 schema. 18838: Update to latest Chemistry TCK. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@18847 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -82,7 +82,7 @@ public class DMNavigationServiceTest extends AbstractServiceTest
|
||||
helper.versioningServicePort.checkOut(repositoryId, documentIdHolder1, new Holder<CmisExtensionType>(), contentCopied);
|
||||
assertTrue(contentCopied.value);
|
||||
|
||||
List<CmisObjectType> result = getCheckedoutDocs(null, 0, 0);
|
||||
List<CmisObjectType> result = getCheckedoutDocs(null, "cmis:lastModificationDate DESC", 0, 0);
|
||||
|
||||
if (result == null || result.size() < 2)
|
||||
{
|
||||
@@ -90,23 +90,25 @@ public class DMNavigationServiceTest extends AbstractServiceTest
|
||||
helper.versioningServicePort.checkIn(repositoryId, documentIdHolder, false, null, null, null, null, null, null, new Holder<CmisExtensionType>());
|
||||
fail("Not all checkout docs have been found");
|
||||
}
|
||||
|
||||
assertEquals("Wrong order", documentIdHolder1.value, getIdProperty(result.get(0).getProperties(), CMISDictionaryModel.PROP_OBJECT_ID));
|
||||
validateResponse(result);
|
||||
|
||||
result = getCheckedoutDocs(null, 1, 0);
|
||||
result = getCheckedoutDocs(null, "cmis:lastModificationDate DESC", 1, 0);
|
||||
assertNotNull(result);
|
||||
assertTrue(result.size() == 1);
|
||||
|
||||
// check in
|
||||
helper.versioningServicePort.checkIn(repositoryId, documentIdHolder, false, null, null, null, null, null, null, new Holder<CmisExtensionType>());
|
||||
|
||||
result = getCheckedoutDocs(companyHomeId, 0, 0);
|
||||
result = getCheckedoutDocs(companyHomeId, "cmis:lastModificationDate ASC", 0, 0);
|
||||
assertFalse("Wrong results", isExistItemWithProperty(result, CMISDictionaryModel.PROP_NAME, documentName));
|
||||
|
||||
}
|
||||
|
||||
public void testGetChildren() throws Exception
|
||||
{
|
||||
List<CmisObjectInFolderType> response = getChildren(companyHomeId, 100, true);
|
||||
List<CmisObjectInFolderType> response = getChildren(companyHomeId, null, 100, true);
|
||||
|
||||
if (null != response)
|
||||
{
|
||||
@@ -134,10 +136,10 @@ public class DMNavigationServiceTest extends AbstractServiceTest
|
||||
@SuppressWarnings("unused")
|
||||
String documentId1 = helper.createDocument(documentName1, folderId, CMISDictionaryModel.DOCUMENT_TYPE_ID, EnumVersioningState.MAJOR);
|
||||
|
||||
response = getChildren(folderId, 2, false);
|
||||
response = getChildren(folderId, CMISDictionaryModel.PROP_NAME + " ASC", 2, false);
|
||||
assertEquals(2, response.size());
|
||||
assertTrue(getStringProperty(response.get(0).getObject().getProperties(), CMISDictionaryModel.PROP_NAME).equals(folderName1));
|
||||
assertTrue(getStringProperty(response.get(1).getObject().getProperties(), CMISDictionaryModel.PROP_NAME).equals(documentName1));
|
||||
assertTrue(getStringProperty(response.get(0).getObject().getProperties(), CMISDictionaryModel.PROP_NAME).equals(documentName1));
|
||||
assertTrue(getStringProperty(response.get(1).getObject().getProperties(), CMISDictionaryModel.PROP_NAME).equals(folderName1));
|
||||
|
||||
// TODO: not implemented
|
||||
// assertNotNull(response.getObject().get(0).getAllowableActions());
|
||||
@@ -290,9 +292,9 @@ public class DMNavigationServiceTest extends AbstractServiceTest
|
||||
return result;
|
||||
}
|
||||
|
||||
private List<CmisObjectInFolderType> getChildren(String folderId, int maxItems, boolean includePathSegments) throws Exception
|
||||
private List<CmisObjectInFolderType> getChildren(String folderId, String orderBy, int maxItems, boolean includePathSegments) throws Exception
|
||||
{
|
||||
CmisObjectInFolderListType result = ((NavigationServicePort) servicePort).getChildren(repositoryId, folderId, "*", "", false, null, "", includePathSegments, BigInteger
|
||||
CmisObjectInFolderListType result = ((NavigationServicePort) servicePort).getChildren(repositoryId, folderId, "*", orderBy, false, null, "", includePathSegments, BigInteger
|
||||
.valueOf(maxItems), BigInteger.valueOf(0), null);
|
||||
assertNotNull("Get Children response is undefined", result);
|
||||
return result.getObjects();
|
||||
@@ -318,9 +320,9 @@ public class DMNavigationServiceTest extends AbstractServiceTest
|
||||
return response;
|
||||
}
|
||||
|
||||
private List<CmisObjectType> getCheckedoutDocs(String folderId, long maxItems, long skipCount) throws Exception
|
||||
private List<CmisObjectType> getCheckedoutDocs(String folderId, String orderBy, long maxItems, long skipCount) throws Exception
|
||||
{
|
||||
CmisObjectListType result = ((NavigationServicePort) servicePort).getCheckedOutDocs(repositoryId, folderId, "*", null, false, null, "", BigInteger.valueOf(maxItems),
|
||||
CmisObjectListType result = ((NavigationServicePort) servicePort).getCheckedOutDocs(repositoryId, folderId, "*", orderBy, false, null, "", BigInteger.valueOf(maxItems),
|
||||
BigInteger.valueOf(skipCount), null);
|
||||
assertNotNull(result);
|
||||
return result.getObjects();
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2005-2008 Alfresco Software Limited.
|
||||
* Copyright (C) 2005-2010 Alfresco Software Limited.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
@@ -18,7 +18,7 @@
|
||||
* As a special exception to the terms and conditions of version 2.0 of
|
||||
* the GPL, you may redistribute this Program in connection with Free/Libre
|
||||
* and Open Source Software ("FLOSS") applications as described in Alfresco's
|
||||
* FLOSS exception. You should have recieved a copy of the text describing
|
||||
* FLOSS exception. You should have received a copy of the text describing
|
||||
* the FLOSS exception, and it is also available here:
|
||||
* http://www.alfresco.com/legal/licensing"
|
||||
*/
|
||||
@@ -88,7 +88,7 @@ public class DMVersioningServiceTest extends AbstractServiceTest
|
||||
new Holder<CmisExtensionType>());
|
||||
documentId = documentIdHolder.value;
|
||||
|
||||
assertEquals(checkinComment, getStringProperty(helper.getObjectProperties(documentIdHolder.value).getProperties(), CMISDictionaryModel.PROP_CHECKIN_COMMENT));
|
||||
assertEquals(checkinComment, getStringProperty(((VersioningServicePort) servicePort).getPropertiesOfLatestVersion(repositoryId, documentId, true, null, null), CMISDictionaryModel.PROP_CHECKIN_COMMENT));
|
||||
}
|
||||
|
||||
public void testCheckOutCheckInDefault() throws Exception
|
||||
@@ -139,7 +139,7 @@ public class DMVersioningServiceTest extends AbstractServiceTest
|
||||
}
|
||||
catch (CmisException e)
|
||||
{
|
||||
assertTrue(e.getFaultInfo().getType().equals(EnumServiceException.UPDATE_CONFLICT));
|
||||
assertTrue(e.getFaultInfo().getType().equals(EnumServiceException.VERSIONING));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -154,20 +154,20 @@ public class DMVersioningServiceTest extends AbstractServiceTest
|
||||
}
|
||||
catch (CmisException e)
|
||||
{
|
||||
assertTrue(e.getFaultInfo().getType().equals(EnumServiceException.UPDATE_CONFLICT));
|
||||
assertTrue(e.getFaultInfo().getType().equals(EnumServiceException.VERSIONING));
|
||||
}
|
||||
}
|
||||
|
||||
public void testGetPropertiesOfLatestVersion() throws Exception
|
||||
{
|
||||
CmisPropertiesType objectType = ((VersioningServicePort) servicePort).getPropertiesOfLatestVersion(repositoryId, documentId, true, "*", null);
|
||||
CmisPropertiesType objectType = ((VersioningServicePort) servicePort).getPropertiesOfLatestVersion(repositoryId, documentId, false, "*", null);
|
||||
assertNotNull(objectType);
|
||||
assertTrue(getBooleanProperty(objectType, CMISDictionaryModel.PROP_IS_LATEST_VERSION));
|
||||
}
|
||||
|
||||
public void testGetPropertiesOfLatestVersionDefault() throws Exception
|
||||
{
|
||||
CmisPropertiesType cmisObjectType = ((VersioningServicePort) servicePort).getPropertiesOfLatestVersion(repositoryId, documentId, true, "", null);
|
||||
CmisPropertiesType cmisObjectType = ((VersioningServicePort) servicePort).getPropertiesOfLatestVersion(repositoryId, documentId, false, "", null);
|
||||
assertNotNull(cmisObjectType);
|
||||
assertTrue(getBooleanProperty(cmisObjectType, CMISDictionaryModel.PROP_IS_LATEST_VERSION));
|
||||
}
|
||||
@@ -184,10 +184,10 @@ public class DMVersioningServiceTest extends AbstractServiceTest
|
||||
|
||||
List<CmisObjectType> response = ((VersioningServicePort) servicePort).getAllVersions(repositoryId, documentId, "", null, null);
|
||||
assertNotNull(response);
|
||||
assertFalse(response.isEmpty());
|
||||
CmisObjectType firstElement = response.iterator().next();
|
||||
assertNotNull(firstElement);
|
||||
assertEquals(checkinComment, getStringProperty(firstElement.getProperties(), CMISDictionaryModel.PROP_CHECKIN_COMMENT));
|
||||
assertTrue("Expected three versions", response.size() == 3);
|
||||
CmisObjectType lastVersion = response.get(1);
|
||||
assertNotNull(lastVersion);
|
||||
assertEquals(checkinComment, getStringProperty(lastVersion.getProperties(), CMISDictionaryModel.PROP_CHECKIN_COMMENT));
|
||||
}
|
||||
|
||||
public void testGetAllVersions() throws Exception
|
||||
@@ -202,10 +202,10 @@ public class DMVersioningServiceTest extends AbstractServiceTest
|
||||
|
||||
List<CmisObjectType> response = ((VersioningServicePort) servicePort).getAllVersions(repositoryId, documentId, "*", false, null);
|
||||
assertNotNull(response);
|
||||
assertFalse(response.isEmpty());
|
||||
CmisObjectType firstElement = response.iterator().next();
|
||||
assertNotNull(firstElement);
|
||||
assertEquals(checkinComment, getStringProperty(firstElement.getProperties(), CMISDictionaryModel.PROP_CHECKIN_COMMENT));
|
||||
assertTrue("Expected three versions", response.size() == 3);
|
||||
CmisObjectType lastVersion = response.get(1);
|
||||
assertNotNull(lastVersion);
|
||||
assertEquals(checkinComment, getStringProperty(lastVersion.getProperties(), CMISDictionaryModel.PROP_CHECKIN_COMMENT));
|
||||
}
|
||||
|
||||
public void testGetAllVersionsForNoVersionHistory() throws Exception
|
||||
|
Reference in New Issue
Block a user