Package org.alfresco.utility.data
Class DataUser
- Direct Known Subclasses:
DataUserAIS
Data Preparation for Users
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclassHandle list of user with particular roles -
Field Summary
Fields inherited from class org.alfresco.utility.data.TestData
currentUser, EMAIL, PASSWORD, tasProperties -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddUsersWithRolesToSite(SiteModel siteModel, UserRole... roles) voidaddUserToSite(UserModel userModel, SiteModel siteModel, UserRole role) voidassertTrashCanDoesNotHaveContent(ContentModel... contents) Verify that content does not exist in trash canvoidassertTrashCanHasContent(ContentModel... contents) Verify if content exists in trash canvoidvoidassertUserExist(String username) voidassertUserExist(UserModel user) voidassertUserIsAuthorized(UserModel userToVerify) Verify if user is authorizedvoidassertUserIsNotAuthorized(UserModel userToVerify) Verify if user is not authorizedCreates a new random user.createRandomTestUser(String prefix) Creates a new random user using a prefix for user name.createUser(String userName) Creates a new user with a specific user name on test server defined inTasPropertiesfile.createUser(String userName, String password) Creates a new random user with a specific user name on test server defined inTasPropertiesfile.createUser(UserModel user) Create a new user based on theUserModelprovidedcreateUserWithCustomEmailAddressInAlfresco(String userName, String password, String domain) Creates a new random user with a specific username, password and e-mail address on the test server defined inTasPropertiescreateUserWithTenant(String userName) Creates a new random user with a specific user name on test server defined inTasPropertiesfile.voiddeleteUser(UserModel userToDelete) Delete uservoiddisableUser(UserModel userToDisable) Disable userbooleanisUserInRepo(String username) Check if user exist in repositoryorg.apache.commons.httpclient.HttpStateJust authenticate usingand provided as parameters voidlogout()User logoutvoidremoveUserFromSite(UserModel userModel, SiteModel siteModel) voidsetUserQuota(UserModel userToModify, int quota) Set user quota in MBMethods inherited from class org.alfresco.utility.data.TestData
assertExtensionAmpExists, assertLogLineIs, getAdminUser, getAlfrescoHome, getCurrentSite, getCurrentSpace, getCurrentUser, getDataDictionaryPath, getLastNodeId, getLastResource, getRootPath, getSitesPath, getUserHomesPath, isAFile, setCurrentSite, setCurrentSpace, setCurrentUser, setLastNodeId, setLastResource, usingAdmin, usingLastServerLogLines, usingResource, usingRoot, usingSite, usingSite, usingUser, usingUserHome, usingUserHome, withJMX
-
Constructor Details
-
DataUser
public DataUser()
-
-
Method Details
-
createUser
Creates a new user with a specific user name on test server defined inTasPropertiesfile. If no user is specified withTestData.usingUser(UserModel)then the random user is created with admin. This user will have default password set to "password"- Parameters:
userName-- Returns:
- Throws:
DataPreparationException
-
createUser
Create a new user based on theUserModelprovided- Parameters:
user-- Returns:
UserModel- Throws:
DataPreparationException
-
createUser
Creates a new random user with a specific user name on test server defined inTasPropertiesfile. If no user is specified withTestData.usingUser(UserModel)then the random user is created with admin- Parameters:
userName-- Returns:
- Throws:
DataPreparationException
-
createUserWithCustomEmailAddressInAlfresco
public UserModel createUserWithCustomEmailAddressInAlfresco(String userName, String password, String domain) throws DataPreparationException Creates a new random user with a specific username, password and e-mail address on the test server defined inTasProperties- Throws:
DataPreparationException
-
createUserWithTenant
Creates a new random user with a specific user name on test server defined inTasPropertiesfile. The user is created with user specified withTestData.usingUser(UserModel)- Parameters:
userName-- Returns:
- Throws:
DataPreparationException
-
createRandomTestUser
Creates a new random user. If no user is specified withTestData.usingUser(UserModel)then the random user is created with admin- Returns:
- Throws:
DataPreparationException
-
createRandomTestUser
Creates a new random user using a prefix for user name. If no user is specified withTestData.usingUser(UserModel)then the random user is created with admin- Returns:
- Throws:
DataPreparationException
-
addUserToSite
-
removeUserFromSite
-
addUsersWithRolesToSite
public DataUser.ListUserWithRoles addUsersWithRolesToSite(SiteModel siteModel, UserRole... roles) throws DataPreparationException - Throws:
DataPreparationException
-
assertUserExist
-
assertUserExist
-
assertUserDoesNotExist
-
isUserInRepo
Check if user exist in repository- Parameters:
username-- Returns:
- boolean
-
deleteUser
Delete user- Parameters:
userToDelete- UserModel user delete- Throws:
DataPreparationException
-
disableUser
Disable user- Parameters:
userToDisable-- Throws:
DataPreparationException
-
assertTrashCanHasContent
Verify if content exists in trash can- Parameters:
contents-ContentModelcontent to verify
-
assertTrashCanDoesNotHaveContent
Verify that content does not exist in trash can- Parameters:
contents-ContentModelcontent to verify
-
setUserQuota
Set user quota in MB- Parameters:
userToModify-quota-- Throws:
DataPreparationException
-
assertUserIsAuthorized
Verify if user is authorized- Parameters:
userToVerify-UserModel
-
assertUserIsNotAuthorized
Verify if user is not authorized- Parameters:
userToVerify-UserModel
-
login
Just authenticate usingand provided as parameters -
logout
public void logout()User logout
-