public class UserTestUtils
extends junit.framework.Assert
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
TEST_PASSWORD |
Modifier and Type | Method and Description |
---|---|
static void |
addManagement(Org orgIn)
Add provisioning to an org
|
static void |
addUserRole(User user,
Role r)
Simple method to add a Role to a User.
|
static void |
addVirtualization(Org orgIn)
Add virtualization to an org
|
static void |
assertNotOrgAdmin(User user)
Check that
user is not an org_admin, and that
she can see no servers. |
static void |
assertOrgAdmin(User user)
Check that
user is an org_admin, and that
there is at least one server visible to her. |
static java.lang.Long |
createAddress(User user)
Create a dummy Address and returns its id.
|
static Org |
createNewOrgFull(java.lang.String orgName)
Creates a new Org with the given orgName.
|
static java.lang.Long |
createOrg(java.lang.String orgName)
Creates a new Org with the given orgName.
|
static User |
createSatAdminInOrgOne()
Useful for legacy tests that arent multi-org aware.
|
static Address |
createTestAddress(User user)
Create a dummy address to test against
|
static User |
createUser(java.lang.String userName,
java.lang.Long orgId)
Creates a new User in the specified org
|
static java.lang.Long |
createUser(java.lang.String userName,
java.lang.String orgName)
Creates a new User and Org with the given userName and orgName.
|
static User |
createUserInOrgOne()
Useful for legacy tests that arent multi-org aware.
|
static User |
ensureOrgAdminExists(Org orgIn)
Find an Org_ADMIN for the Org passed in.
|
static void |
ensureSatelliteOrgAdminExists()
Ensures that an admin user for the Satellite org exists, creating it if
necessary.
|
static User |
ensureUserExists(java.lang.String login)
Make sure a user with the passed in *exact* login exists within the org
|
static Org |
findNewOrg(java.lang.String orgName)
Creates a new Org with the given name, then returns the newly
created Org.
|
static User |
findNewUser()
Create a new user 'testUser' and 'testOrg'
|
static User |
findNewUser(java.lang.String userName,
java.lang.String orgName)
Creates a new User and Org with the given userName and orgName.
|
static User |
findNewUser(java.lang.String userName,
java.lang.String orgName,
boolean orgAdmin)
Creates a new User and Org with the given userName and orgName.
|
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail, failNotEquals, failNotSame, failSame, format
public static final java.lang.String TEST_PASSWORD
public static java.lang.Long createOrg(java.lang.String orgName)
orgName
- Name of org.public static Org createNewOrgFull(java.lang.String orgName)
orgName
- Name of org.public static java.lang.Long createUser(java.lang.String userName, java.lang.String orgName)
userName
- Name of user.orgName
- Name of org.public static User createUser(java.lang.String userName, java.lang.Long orgId)
userName
- Name of user.orgId
- the org in which to create the userpublic static User findNewUser(java.lang.String userName, java.lang.String orgName)
userName
- Name of user.orgName
- Name of org.public static User createUserInOrgOne() throws java.lang.Exception
java.lang.Exception
- if errorpublic static User createSatAdminInOrgOne() throws java.lang.Exception
java.lang.Exception
- if errorpublic static User findNewUser(java.lang.String userName, java.lang.String orgName, boolean orgAdmin)
userName
- Name of user.orgName
- Name of org.orgAdmin
- if you want the user to have the ORG_ADMIN rolepublic static Org findNewOrg(java.lang.String orgName)
orgName
- Org namepublic static Address createTestAddress(User user)
user
- the User we want to be the parent of this
Address.public static java.lang.Long createAddress(User user)
user
- the User we want to be the parent of this
Address.public static void assertOrgAdmin(User user)
user
is an org_admin, and that
there is at least one server visible to her. The second check
is necessary because of bz156752user
- the user for which to checkpublic static void assertNotOrgAdmin(User user)
user
is not an org_admin, and that
she can see no servers. The second check
is necessary because of bz156752user
- the user for which to checkpublic static void addUserRole(User user, Role r)
user
- to add Role tor
- Role to add.public static void addManagement(Org orgIn) throws java.lang.Exception
orgIn
- to add tojava.lang.Exception
- foopublic static void addVirtualization(Org orgIn) throws java.lang.Exception
orgIn
- to add tojava.lang.Exception
- foopublic static User findNewUser()
public static User ensureOrgAdminExists(Org orgIn)
orgIn
- to find/createpublic static User ensureUserExists(java.lang.String login)
login
- to ensure existspublic static void ensureSatelliteOrgAdminExists()