com.atlassian.confluence.it
Class TestUserFactory

java.lang.Object
  extended by com.atlassian.confluence.it.TestUserFactory

public class TestUserFactory
extends Object

Since:
5.6

Constructor Summary
TestUserFactory(UserManagementHelper userHelper)
           
TestUserFactory(UserManagementHelper userHelper, String usernamePrefix, String fullNamePrefix)
           
 
Method Summary
 User createTestUser()
          Create a new user on the server with a generated (and hopefully unique) name.
 User generateTestUser()
          Generate a User object with a generated (and hopefully unique) username.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TestUserFactory

public TestUserFactory(UserManagementHelper userHelper)

TestUserFactory

public TestUserFactory(UserManagementHelper userHelper,
                       String usernamePrefix,
                       String fullNamePrefix)
Method Detail

createTestUser

public User createTestUser()
Create a new user on the server with a generated (and hopefully unique) name. The username will be of the form testuser-COUNT-RANDOM where COUNT is numbered sequentially from 1, and RANDOM is a pseudo-randomly generated for each test. The COUNT is reset at the start of each test. If this method is invoked multiple from the same test, then COUNT will be incremented by one each time, but RANDOM will stay the same. This gives a pattern that looks like test1, test2, test3 etc, whilst still ensuring uniqueness the avoid clashes between tests not performing teardown 100% reliably.


generateTestUser

public User generateTestUser()
Generate a User object with a generated (and hopefully unique) username. This will not create the user on the server. To do that, use createTestUser()



Copyright © 2003–2015 Atlassian. All rights reserved.