Package org.alfresco.cmis.dsl
Class CmisAssertion
java.lang.Object
org.alfresco.utility.dsl.DSLAssertion<CmisWrapper>
org.alfresco.cmis.dsl.CmisAssertion
DSL with all assertion available for
CmisWrapper-
Field Summary
FieldsFields inherited from class org.alfresco.utility.dsl.DSLAssertion
dslProtocol -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbaseTypeIdIs(String baseTypeId) Verify base type idcmisAPI()contentContains(String content) Verify document content contains specific detailsVerify document contentcontentLengthIs(long contentLength) Verify document content lengthcontentModelDoesnotHaveChangesWithWrongToken(org.alfresco.utility.model.ContentModel model, org.apache.chemistry.opencmis.commons.enums.ChangeType... changeTypes) Verify that a specific object does not have changes from cmis logcontentModelHasChanges(org.alfresco.utility.model.ContentModel model, org.apache.chemistry.opencmis.commons.enums.ChangeType... changeTypes) Verify changes for a specific object from cmis logcontentPropertyHasValue(String property, String value) Verify the value of the given propertydescriptionIs(String description) documentHasVersion(double version) Verify document has versionVerify ifDocumentis checked outVerify thatDocumentis not checked outdoesNotHaveAllowableActions(org.apache.chemistry.opencmis.commons.enums.Action... actions) Check if the {@link #getLastResource()) does not have the list of {@link Action} Example: {code} .doesNotHaveAllowableActions(Action.CAN_CREATE_FOLDER); {code}voiddoesNotHaveDescendants(int depth) doesNotHaveFile(org.alfresco.utility.model.FileModel... fileModels) Verify if file(s) children exist in parent folderdoesNotHaveFolder(org.alfresco.utility.model.FolderModel... folderModels) Verify if folder(s) children exist in parent folderfolderHasCheckedOutDocument(org.alfresco.utility.model.ContentModel... contentModels) Verify that a specific folder(set by callingCmisWrapper.usingResource(ContentModel)) contains checked out documentsfolderHasCheckedOutDocument(org.apache.chemistry.opencmis.client.api.OperationContext context, org.alfresco.utility.model.ContentModel... contentModels) Verify that a specific folder(set by callingCmisWrapper.usingResource(ContentModel)) contains checked out documents in a specific order.folderHasParent(org.alfresco.utility.model.ContentModel contentModel) Verify parent from theFolderset as last resourcehasAcls()Verify thatCmisObjecthas ACLs (Access Control Lists)hasAllowableActions(org.apache.chemistry.opencmis.commons.enums.Action... actions) Check if the#getLastResource()has the list ofActionExample: {code} .hasAllowableActions(Action.CAN_CREATE_FOLDER); {code}hasAspectExtension(String aspectId) Verify thatCmisObjecthas a specific aspect extensionhasCheckInCommentForVersion(double documentVersion, String comment) Get check in comment for a specific document versionhasCheckInCommentLastVersion(String comment) Get check in comment for last document versionhasChildren(org.alfresco.utility.model.ContentModel... contentModel) Verify the children(files and folders) from a parent foldervoidhasDescendants(int depth, org.alfresco.utility.model.ContentModel... contentModels) e.g.hasFailedDeletedObject(String nodeRef) Verify failed deleted objects after delete tree actionhasFiles(org.alfresco.utility.model.FileModel... fileModel) Verify if file children exist in parent folderhasFolders(org.alfresco.utility.model.FolderModel... folderModel) Verify if folder children exist in parent folderhasFolderTree(int depth, org.alfresco.utility.model.ContentModel... contentModels) Depending on the specified depth, checks that all the contents from contentModels list are present in the current folder tree structurehasParents(String... parentsList) Verify the parents for aCmisObjecthasUniqueChildren(int numberOfChildren) isAllowableActionInList(org.apache.chemistry.opencmis.commons.enums.Action... actions) Check if#getLastResource()object has actions returned fromCmisObject.getAllowableActions()Assert if the {@link #getLastResource()) has the latest major version setVerify thatDocumentis not latest major version.Verify thatDocumentis not private working copy (pwc)Verify ifDocumentis private working copy (pwc)objectHasProperty(String propertyId, Object value) Verify a specific object propertyobjectHasProperty(String propertyId, String displayName, String localName, String queryName, String... values) Check if CMIS object contains a property.objectHasRelationshipWith(org.alfresco.utility.model.ContentModel targetContent) Verify if there is a relationship between current resource and the given targetobjectIdIs(String id) Verify if current resource has the id givenobjectTypeIdIs(String objectTypeId) Verify object type idpermissionIsNotSetForUser(org.alfresco.utility.model.UserModel userModel, String permission) Verify that permission is not set for a specific user from the last resource objectpermissionIsNotSetForUser(org.alfresco.utility.model.UserModel userModel, org.alfresco.utility.constants.UserRole role) Verify that permission is not set for a specific user from the last resource objectpermissionIsSetForGrup(org.alfresco.utility.model.GroupModel groupModel, org.alfresco.utility.constants.UserRole role) Verify the permission for a specific group of users from the last resource objectpermissionIsSetForUser(org.alfresco.utility.model.UserModel userModel, String permission) Verify the permission for a specific user from the last resource objectpermissionIsSetForUser(org.alfresco.utility.model.UserModel userModel, org.alfresco.utility.constants.UserRole role) Verify the permission for a specific user from the last resource objectVerify that renditions are availablesecondaryTypeIsAvailable(String secondaryTypeId) Verify secondary type for specificCmisObjectsecondaryTypeIsNotAvailable(String secondaryTypeId) Verify secondary type is not available for specificCmisObjectsessioDoesNotHaveCheckedOutDocument(org.alfresco.utility.model.ContentModel... contentModels) Verify that checked out documents are not found inSessionsessionHasCheckedOutDocument(org.alfresco.utility.model.ContentModel... contentModels) Verify checked out documents fromSessionsessionHasCheckedOutDocument(org.apache.chemistry.opencmis.client.api.OperationContext context, org.alfresco.utility.model.ContentModel... contentModels) Verify checked out documents fromSessionin a specific order set inOperationContextVerify that thumbnail rendition is availabletypeDefinitionIs(org.alfresco.utility.model.ContentModel contentModel) userIsAssigned(org.alfresco.utility.model.UserModel user) Verify if there is a relationship between current resource and the given targetMethods inherited from class org.alfresco.utility.dsl.DSLAssertion
getProtocol, protocolIsDisabled, protocolIsEnabled
-
Field Details
-
STEP_PREFIX
-
-
Constructor Details
-
CmisAssertion
-
-
Method Details
-
cmisAPI
-
existsInRepo
- Overrides:
existsInRepoin classorg.alfresco.utility.dsl.DSLAssertion<CmisWrapper>
-
doesNotExistInRepo
- Overrides:
doesNotExistInRepoin classorg.alfresco.utility.dsl.DSLAssertion<CmisWrapper>
-
contentModelHasChanges
public CmisWrapper contentModelHasChanges(org.alfresco.utility.model.ContentModel model, org.apache.chemistry.opencmis.commons.enums.ChangeType... changeTypes) throws Exception Verify changes for a specific object from cmis log- Parameters:
model-ContentModelchangeTypes-ChangeType- Returns:
- Throws:
Exception
-
contentModelDoesnotHaveChangesWithWrongToken
public CmisWrapper contentModelDoesnotHaveChangesWithWrongToken(org.alfresco.utility.model.ContentModel model, org.apache.chemistry.opencmis.commons.enums.ChangeType... changeTypes) throws Exception Verify that a specific object does not have changes from cmis log- Parameters:
model-ContentModelchangeTypes-ChangeType- Returns:
- Throws:
Exception
-
hasAllowableActions
public CmisWrapper hasAllowableActions(org.apache.chemistry.opencmis.commons.enums.Action... actions) Check if the#getLastResource()has the list ofActionExample: {code} .hasAllowableActions(Action.CAN_CREATE_FOLDER); {code}- Parameters:
actions-- Returns:
-
isAllowableActionInList
public CmisWrapper isAllowableActionInList(org.apache.chemistry.opencmis.commons.enums.Action... actions) Check if#getLastResource()object has actions returned fromCmisObject.getAllowableActions()- Parameters:
actions-- Returns:
-
doesNotHaveAllowableActions
public CmisWrapper doesNotHaveAllowableActions(org.apache.chemistry.opencmis.commons.enums.Action... actions) Check if the {@link #getLastResource()) does not have the list of {@link Action} Example: {code} .doesNotHaveAllowableActions(Action.CAN_CREATE_FOLDER); {code}- Parameters:
actions-- Returns:
-
contentIs
Verify document content- Parameters:
content- String expected content- Returns:
- Throws:
Exception
-
contentContains
Verify document content contains specific details- Parameters:
content- String expected content- Returns:
- Throws:
Exception
-
objectIdIs
Verify if current resource has the id given- Parameters:
id- - expected object id- Returns:
-
contentPropertyHasValue
Verify the value of the given property- Parameters:
property- - the property idvalue- - expected property value- Returns:
-
documentIsCheckedOut
Verify ifDocumentis checked out- Returns:
-
isPrivateWorkingCopy
Verify ifDocumentis private working copy (pwc)- Returns:
-
isNotPrivateWorkingCopy
Verify thatDocumentis not private working copy (pwc)- Returns:
-
documentIsNotCheckedOut
Verify thatDocumentis not checked out- Returns:
-
objectHasRelationshipWith
Verify if there is a relationship between current resource and the given target- Parameters:
targetContent-- Returns:
-
documentHasVersion
Verify document has version- Parameters:
version- String expected version- Returns:
- Throws:
Exception
-
folderHasParent
Verify parent from theFolderset as last resource- Parameters:
contentModel-- Returns:
-
baseTypeIdIs
Verify base type id- Parameters:
baseTypeId- String expected object type value- Returns:
- Throws:
Exception
-
objectTypeIdIs
Verify object type id- Parameters:
objectTypeId- String expected object type value- Returns:
- Throws:
Exception
-
objectHasProperty
Verify a specific object property- Parameters:
propertyId-value-- Returns:
-
objectHasProperty
public CmisWrapper objectHasProperty(String propertyId, String displayName, String localName, String queryName, String... values) Check if CMIS object contains a property. Example: ...assertObjectHasProperty("cmis:secondaryObjectTypeIds", "Secondary Object Type Ids","secondaryObjectTypeIds", "cmis:secondaryObjectTypeIds", "P:cm:titled", "P:sys:localized");- Parameters:
propertyId-displayName-localName-queryName-values-- Returns:
-
isLatestMajorVersion
Assert if the {@link #getLastResource()) has the latest major version set -
isNotLatestMajorVersion
Verify thatDocumentis not latest major version.- Returns:
-
renditionIsAvailable
Verify that renditions are available -
thumbnailRenditionIsAvailable
Verify that thumbnail rendition is available- Returns:
-
secondaryTypeIsAvailable
Verify secondary type for specificCmisObject- Parameters:
secondaryTypeId-- Returns:
-
secondaryTypeIsNotAvailable
Verify secondary type is not available for specificCmisObject- Parameters:
secondaryTypeId-- Returns:
-
contentLengthIs
Verify document content length- Parameters:
contentLength- String expected content length- Returns:
- Throws:
Exception
-
hasDescendants
public void hasDescendants(int depth, org.alfresco.utility.model.ContentModel... contentModels) e.g. assertFolderHasDescendant(1, file1) will verify if file1 is a direct descendant of#getLastResource()- Parameters:
depth-#getFolderDescendants(int)contentModels-#getCmisObjectsFromContentModels(ContentModel...)
-
doesNotHaveDescendants
public void doesNotHaveDescendants(int depth) -
hasAcls
Verify thatCmisObjecthas ACLs (Access Control Lists)- Returns:
-
hasFolderTree
public CmisWrapper hasFolderTree(int depth, org.alfresco.utility.model.ContentModel... contentModels) Depending on the specified depth, checks that all the contents from contentModels list are present in the current folder tree structure- Parameters:
depth- the depth of the tree to check, must be -1 or >= 1contentModels- expected list of contents to be found in the tree- Returns:
-
permissionIsSetForUser
public CmisWrapper permissionIsSetForUser(org.alfresco.utility.model.UserModel userModel, org.alfresco.utility.constants.UserRole role) Verify the permission for a specific user from the last resource object- Parameters:
userModel-UserModeluser to verifyrole-UserRoleuser role to verify- Returns:
-
permissionIsSetForGrup
public CmisWrapper permissionIsSetForGrup(org.alfresco.utility.model.GroupModel groupModel, org.alfresco.utility.constants.UserRole role) Verify the permission for a specific group of users from the last resource object- Parameters:
groupModel-GroupModelgroup to verifyrole-UserRoleuser role to verify- Returns:
-
permissionIsSetForUser
public CmisWrapper permissionIsSetForUser(org.alfresco.utility.model.UserModel userModel, String permission) Verify the permission for a specific user from the last resource object- Parameters:
userModel-UserModelpermission- to verify- Returns:
-
permissionIsNotSetForUser
public CmisWrapper permissionIsNotSetForUser(org.alfresco.utility.model.UserModel userModel, org.alfresco.utility.constants.UserRole role) Verify that permission is not set for a specific user from the last resource object- Parameters:
userModel-UserModeluser to verifyrole-UserRoleuser role to verify- Returns:
-
permissionIsNotSetForUser
public CmisWrapper permissionIsNotSetForUser(org.alfresco.utility.model.UserModel userModel, String permission) Verify that permission is not set for a specific user from the last resource object- Parameters:
userModel-UserModeluser to verifypermission- to verify- Returns:
-
typeDefinitionIs
-
folderHasCheckedOutDocument
public CmisWrapper folderHasCheckedOutDocument(org.alfresco.utility.model.ContentModel... contentModels) Verify that a specific folder(set by callingCmisWrapper.usingResource(ContentModel)) contains checked out documents- Parameters:
contentModels- checked out documents to verify- Returns:
-
folderHasCheckedOutDocument
public CmisWrapper folderHasCheckedOutDocument(org.apache.chemistry.opencmis.client.api.OperationContext context, org.alfresco.utility.model.ContentModel... contentModels) Verify that a specific folder(set by callingCmisWrapper.usingResource(ContentModel)) contains checked out documents in a specific order.- Parameters:
context-OperationContextcontentModels- documents to verify in the order returned by theOperationContext- Returns:
-
sessionHasCheckedOutDocument
public CmisWrapper sessionHasCheckedOutDocument(org.alfresco.utility.model.ContentModel... contentModels) Verify checked out documents fromSession- Parameters:
contentModels- documents to verify- Returns:
-
sessionHasCheckedOutDocument
public CmisWrapper sessionHasCheckedOutDocument(org.apache.chemistry.opencmis.client.api.OperationContext context, org.alfresco.utility.model.ContentModel... contentModels) Verify checked out documents fromSessionin a specific order set inOperationContext- Parameters:
context-OperationContextcontentModels- documents to verify- Returns:
-
sessioDoesNotHaveCheckedOutDocument
public CmisWrapper sessioDoesNotHaveCheckedOutDocument(org.alfresco.utility.model.ContentModel... contentModels) Verify that checked out documents are not found inSession- Parameters:
contentModels- documents to verify- Returns:
-
hasAspectExtension
Verify thatCmisObjecthas a specific aspect extension- Parameters:
aspectId-- Returns:
-
hasParents
Verify the parents for aCmisObject- Parameters:
parentsList-- Returns:
-
descriptionIs
-
hasFolders
public CmisWrapper hasFolders(org.alfresco.utility.model.FolderModel... folderModel) throws Exception Verify if folder children exist in parent folder- Parameters:
fileModel- children files- Returns:
- Throws:
Exception
-
hasFiles
Verify if file children exist in parent folder- Parameters:
fileModel- children files- Returns:
- Throws:
Exception
-
doesNotHaveFile
public CmisWrapper doesNotHaveFile(org.alfresco.utility.model.FileModel... fileModels) throws Exception Verify if file(s) children exist in parent folder- Parameters:
fileModels- children files- Returns:
- Throws:
Exception
-
doesNotHaveFolder
public CmisWrapper doesNotHaveFolder(org.alfresco.utility.model.FolderModel... folderModels) throws Exception Verify if folder(s) children exist in parent folder- Parameters:
folderModels- children files- Returns:
- Throws:
Exception
-
hasChildren
public CmisWrapper hasChildren(org.alfresco.utility.model.ContentModel... contentModel) throws Exception Verify the children(files and folders) from a parent folder- Parameters:
contentModel- children- Returns:
- Throws:
Exception
-
hasUniqueChildren
- Throws:
Exception
-
hasCheckInCommentLastVersion
Get check in comment for last document version- Parameters:
comment- to verify- Returns:
-
hasCheckInCommentForVersion
Get check in comment for a specific document version- Parameters:
documentVersion- version of documentcomment- to verify- Returns:
-
hasFailedDeletedObject
Verify failed deleted objects after delete tree action- Parameters:
nodeRef- objects to verify- Returns:
-
userIsAssigned
Verify if there is a relationship between current resource and the given target- Parameters:
user-- Returns:
-