Package org.alfresco.utility.data
Class DataUser
- java.lang.Object
-
- org.alfresco.utility.data.TestData<DataUser>
-
- org.alfresco.utility.data.DataUser
-
- Direct Known Subclasses:
DataUserAIS
@Service @Scope("prototype") public class DataUser extends TestData<DataUser>Data Preparation for Users
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classDataUser.ListUserWithRolesHandle list of user with particular roles
-
Field Summary
-
Fields inherited from class org.alfresco.utility.data.TestData
currentUser, EMAIL, PASSWORD, tasProperties
-
-
Constructor Summary
Constructors Constructor Description DataUser()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DataUser.ListUserWithRolesaddUsersWithRolesToSite(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 canvoidassertUserDoesNotExist(UserModel user)voidassertUserExist(java.lang.String username)voidassertUserExist(UserModel user)voidassertUserIsAuthorized(UserModel userToVerify)Verify if user is authorizedvoidassertUserIsNotAuthorized(UserModel userToVerify)Verify if user is not authorizedUserModelcreateRandomTestUser()Creates a new random user.UserModelcreateRandomTestUser(java.lang.String prefix)Creates a new random user using a prefix for user name.UserModelcreateUser(java.lang.String userName)Creates a new user with a specific user name on test server defined inTasPropertiesfile.UserModelcreateUser(java.lang.String userName, java.lang.String password)Creates a new random user with a specific user name on test server defined inTasPropertiesfile.UserModelcreateUser(UserModel user)Create a new user based on theUserModelprovidedUserModelcreateUserWithCustomEmailAddressInAlfresco(java.lang.String userName, java.lang.String password, java.lang.String domain)Creates a new random user with a specific username, password and e-mail address on the test server defined inTasPropertiesUserModelcreateUserWithTenant(java.lang.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(java.lang.String username)Check if user exist in repositoryorg.apache.commons.httpclient.HttpStatelogin(UserModel testUser)Just authenticate usingand provided as parameters voidlogout()User logoutvoidremoveUserFromSite(UserModel userModel, SiteModel siteModel)voidsetUserQuota(UserModel userToModify, int quota)Set user quota in MB-
Methods inherited from class org.alfresco.utility.data.TestData
assertExtensionAmpExists, assertLogLineIs, getAdminUser, getAlfrescoHome, getCurrentSite, getCurrentSpace, getCurrentUser, getDataDictionaryPath, getLastResource, getRootPath, getSitesPath, getUserHomesPath, isAFile, setCurrentSite, setCurrentSpace, setCurrentUser, setLastResource, usingAdmin, usingLastServerLogLines, usingResource, usingRoot, usingSite, usingSite, usingUser, usingUserHome, usingUserHome, withJMX
-
-
-
-
Method Detail
-
createUser
public UserModel createUser(java.lang.String userName) throws DataPreparationException
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
public UserModel createUser(UserModel user) throws DataPreparationException
Create a new user based on theUserModelprovided- Parameters:
user-- Returns:
UserModel- Throws:
DataPreparationException
-
createUser
public UserModel createUser(java.lang.String userName, java.lang.String password) throws DataPreparationException
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(java.lang.String userName, java.lang.String password, java.lang.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
public UserModel createUserWithTenant(java.lang.String userName) throws DataPreparationException
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
public UserModel createRandomTestUser() throws DataPreparationException
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
public UserModel createRandomTestUser(java.lang.String prefix) throws DataPreparationException
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
-
addUsersWithRolesToSite
public DataUser.ListUserWithRoles addUsersWithRolesToSite(SiteModel siteModel, UserRole... roles) throws DataPreparationException
- Throws:
DataPreparationException
-
assertUserExist
public void assertUserExist(UserModel user)
-
assertUserExist
public void assertUserExist(java.lang.String username)
-
assertUserDoesNotExist
public void assertUserDoesNotExist(UserModel user)
-
isUserInRepo
public boolean isUserInRepo(java.lang.String username)
Check if user exist in repository- Parameters:
username-- Returns:
- boolean
-
deleteUser
public void deleteUser(UserModel userToDelete) throws DataPreparationException
Delete user- Parameters:
userToDelete- UserModel user delete- Throws:
DataPreparationException
-
disableUser
public void disableUser(UserModel userToDisable) throws DataPreparationException
Disable user- Parameters:
userToDisable-- Throws:
DataPreparationException
-
assertTrashCanHasContent
public void assertTrashCanHasContent(ContentModel... contents)
Verify if content exists in trash can- Parameters:
content-ContentModelcontent to verify
-
assertTrashCanDoesNotHaveContent
public void assertTrashCanDoesNotHaveContent(ContentModel... contents)
Verify that content does not exist in trash can- Parameters:
content-ContentModelcontent to verify
-
setUserQuota
public void setUserQuota(UserModel userToModify, int quota) throws DataPreparationException
Set user quota in MB- Parameters:
userToModify-quota-- Throws:
DataPreparationException
-
assertUserIsAuthorized
public void assertUserIsAuthorized(UserModel userToVerify)
Verify if user is authorized- Parameters:
userToVerify-UserModel
-
assertUserIsNotAuthorized
public void assertUserIsNotAuthorized(UserModel userToVerify)
Verify if user is not authorized- Parameters:
userToVerify-UserModel
-
login
public org.apache.commons.httpclient.HttpState login(UserModel testUser)
Just authenticate usingand provided as parameters
-
logout
public void logout()
User logout
-
-