com.atlassian.crowd.acceptance.utils
Class DirectoryTestHelper

java.lang.Object
  extended by com.atlassian.crowd.acceptance.utils.DirectoryTestHelper

public abstract class DirectoryTestHelper
extends Object

This class contains code shared by a number of directory integration tests. It is preferable to have it here and not in BaseTest because for some tests it is not convenient to extend BaseTest. This class is currently abstract since it is a just container of static methods.


Field Summary
static String[] TABLE_NAMES
           
 
Constructor Summary
DirectoryTestHelper()
           
 
Method Summary
static void addGroup(GroupTemplate group, RemoteDirectory remoteDirectory)
           
static void addGroup(String groupName, Long directoryId, RemoteDirectory remoteDirectory)
           
static void addUser(String userName, Long directoryId, String password, RemoteDirectory remoteDirectory)
           
static void addUser(UserTemplate user, com.atlassian.crowd.embedded.api.PasswordCredential passwordCredential, RemoteDirectory remoteDirectory)
           
static GroupTemplate buildGroup(String groupName, Long directoryId)
           
static UserTemplateWithAttributes buildUser(String userName, Long directoryId)
           
static UserTemplateWithAttributes buildUser(String userName, String emailAddress, String firstName, String lastName, Long directoryId)
           
static DirectoryImpl createDirectoryTemplate(Properties directorySettings, LDAPPropertiesHelper ldapPropertiesHelper, boolean useExternalId)
           
static void deleteFromTables(String[] names, org.springframework.jdbc.core.JdbcTemplate jdbcTemplate)
          Removes the content of the named tables
static String getAD2K3ConfigFileName()
           
static String getAD2K3LoadTest10KFileName()
           
static String getApacheDS102ConfigFileName()
           
static String getApacheDS154ConfigFileName()
           
static Properties getConfigProperties(String configFileName)
           
static String getEncryptionType(Properties directorySettings)
           
static void silentlyRemoveGroup(String groupName, RemoteDirectory remoteDirectory)
          Convenience method to remove a group (if possible).
static void silentlyRemoveGroupFromGroup(String childGroup, String parentGroup, RemoteDirectory remoteDirectory)
          Convenience method to remove a membership (if possible).
static void silentlyRemoveUser(String userName, RemoteDirectory remoteDirectory)
          Convenience method to remove a user (if possible).
static void silentlyRemoveUserFromGroup(String userName, String groupName, RemoteDirectory remoteDirectory)
          Convenience method to remove a membership (if possible).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TABLE_NAMES

public static final String[] TABLE_NAMES
Constructor Detail

DirectoryTestHelper

public DirectoryTestHelper()
Method Detail

getApacheDS102ConfigFileName

public static String getApacheDS102ConfigFileName()

getApacheDS154ConfigFileName

public static String getApacheDS154ConfigFileName()

getAD2K3ConfigFileName

public static String getAD2K3ConfigFileName()

getAD2K3LoadTest10KFileName

public static String getAD2K3LoadTest10KFileName()

getConfigProperties

public static Properties getConfigProperties(String configFileName)

createDirectoryTemplate

public static DirectoryImpl createDirectoryTemplate(Properties directorySettings,
                                                    LDAPPropertiesHelper ldapPropertiesHelper,
                                                    boolean useExternalId)

getEncryptionType

public static String getEncryptionType(Properties directorySettings)

silentlyRemoveUser

public static void silentlyRemoveUser(String userName,
                                      RemoteDirectory remoteDirectory)
Convenience method to remove a user (if possible). Doesn't log or throw on exception - use only in tearDown()

Parameters:
userName -

silentlyRemoveGroup

public static void silentlyRemoveGroup(String groupName,
                                       RemoteDirectory remoteDirectory)
Convenience method to remove a group (if possible). Doesn't log or throw on exception - use only in tearDown()

Parameters:
groupName -

silentlyRemoveUserFromGroup

public static void silentlyRemoveUserFromGroup(String userName,
                                               String groupName,
                                               RemoteDirectory remoteDirectory)
Convenience method to remove a membership (if possible). Doesn't log or throw on exception - use only in tearDown()

Parameters:
userName -
groupName -
remoteDirectory -

silentlyRemoveGroupFromGroup

public static void silentlyRemoveGroupFromGroup(String childGroup,
                                                String parentGroup,
                                                RemoteDirectory remoteDirectory)
Convenience method to remove a membership (if possible). Doesn't log or throw on exception - use only in tearDown()

Parameters:
childGroup -
parentGroup -
remoteDirectory -

deleteFromTables

public static void deleteFromTables(String[] names,
                                    org.springframework.jdbc.core.JdbcTemplate jdbcTemplate)
Removes the content of the named tables

Parameters:
names -
jdbcTemplate -

buildUser

public static UserTemplateWithAttributes buildUser(String userName,
                                                   Long directoryId)

buildUser

public static UserTemplateWithAttributes buildUser(String userName,
                                                   String emailAddress,
                                                   String firstName,
                                                   String lastName,
                                                   Long directoryId)

buildGroup

public static GroupTemplate buildGroup(String groupName,
                                       Long directoryId)

addUser

public static void addUser(UserTemplate user,
                           com.atlassian.crowd.embedded.api.PasswordCredential passwordCredential,
                           RemoteDirectory remoteDirectory)
                    throws InvalidCredentialException,
                           InvalidUserException,
                           UserAlreadyExistsException,
                           OperationFailedException
Throws:
InvalidCredentialException
InvalidUserException
UserAlreadyExistsException
OperationFailedException

addUser

public static void addUser(String userName,
                           Long directoryId,
                           String password,
                           RemoteDirectory remoteDirectory)
                    throws InvalidCredentialException,
                           InvalidUserException,
                           UserAlreadyExistsException,
                           OperationFailedException
Throws:
InvalidCredentialException
InvalidUserException
UserAlreadyExistsException
OperationFailedException

addGroup

public static void addGroup(GroupTemplate group,
                            RemoteDirectory remoteDirectory)
                     throws InvalidGroupException,
                            OperationFailedException
Throws:
InvalidGroupException
OperationFailedException

addGroup

public static void addGroup(String groupName,
                            Long directoryId,
                            RemoteDirectory remoteDirectory)
                     throws InvalidGroupException,
                            OperationFailedException
Throws:
InvalidGroupException
OperationFailedException


Copyright © 2014 Atlassian. All Rights Reserved.