org.apache.directory.server.core.integ
Class IntegrationUtils

java.lang.Object
  extended by org.apache.directory.server.core.integ.IntegrationUtils
Direct Known Subclasses:
ServerIntegrationUtils

public class IntegrationUtils
extends java.lang.Object

Integration test utility methods.

Version:
$Rev$, $Date$
Author:
Apache Directory Project

Constructor Summary
IntegrationUtils()
           
 
Method Summary
static void apply(DirectoryService service, org.apache.directory.shared.ldap.ldif.LdifEntry entry)
           
static void doDelete(java.io.File wkdir)
          Deletes the working directory.
static javax.naming.ldap.LdapContext getContext(java.lang.String principalDn, DirectoryService service, java.lang.String dn)
           
static CoreSession getCoreSession(java.lang.String principalDn, DirectoryService service, java.lang.String dn)
           
static javax.naming.ldap.LdapContext getRootContext(DirectoryService service)
           
static javax.naming.ldap.LdapContext getSchemaContext(DirectoryService service)
           
static javax.naming.ldap.LdapContext getSystemContext(DirectoryService service)
           
static org.apache.directory.shared.ldap.ldif.LdifEntry getUserAddLdif()
           
static org.apache.directory.shared.ldap.ldif.LdifEntry getUserAddLdif(java.lang.String dnstr, byte[] password, java.lang.String cn, java.lang.String sn)
           
static void injectEntries(DirectoryService service, java.lang.String ldif)
          Inject an ldif String into the server.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IntegrationUtils

public IntegrationUtils()
Method Detail

doDelete

public static void doDelete(java.io.File wkdir)
                     throws java.io.IOException
Deletes the working directory.

Parameters:
wkdir - the working directory to delete
Throws:
java.io.IOException - if the working directory cannot be deleted

injectEntries

public static void injectEntries(DirectoryService service,
                                 java.lang.String ldif)
                          throws java.lang.Exception
Inject an ldif String into the server. DN must be relative to the root.

Parameters:
service - the directory service to use
ldif - the ldif containing entries to add to the server.
Throws:
javax.naming.NamingException - if there is a problem adding the entries from the LDIF
java.lang.Exception

getUserAddLdif

public static org.apache.directory.shared.ldap.ldif.LdifEntry getUserAddLdif()
                                                                      throws javax.naming.InvalidNameException,
                                                                             javax.naming.NamingException
Throws:
javax.naming.InvalidNameException
javax.naming.NamingException

getContext

public static javax.naming.ldap.LdapContext getContext(java.lang.String principalDn,
                                                       DirectoryService service,
                                                       java.lang.String dn)
                                                throws java.lang.Exception
Throws:
java.lang.Exception

getCoreSession

public static CoreSession getCoreSession(java.lang.String principalDn,
                                         DirectoryService service,
                                         java.lang.String dn)
                                  throws java.lang.Exception
Throws:
java.lang.Exception

getSystemContext

public static javax.naming.ldap.LdapContext getSystemContext(DirectoryService service)
                                                      throws java.lang.Exception
Throws:
java.lang.Exception

getSchemaContext

public static javax.naming.ldap.LdapContext getSchemaContext(DirectoryService service)
                                                      throws java.lang.Exception
Throws:
java.lang.Exception

getRootContext

public static javax.naming.ldap.LdapContext getRootContext(DirectoryService service)
                                                    throws java.lang.Exception
Throws:
java.lang.Exception

apply

public static void apply(DirectoryService service,
                         org.apache.directory.shared.ldap.ldif.LdifEntry entry)
                  throws java.lang.Exception
Throws:
java.lang.Exception

getUserAddLdif

public static org.apache.directory.shared.ldap.ldif.LdifEntry getUserAddLdif(java.lang.String dnstr,
                                                                             byte[] password,
                                                                             java.lang.String cn,
                                                                             java.lang.String sn)
                                                                      throws javax.naming.InvalidNameException,
                                                                             javax.naming.NamingException
Throws:
javax.naming.InvalidNameException
javax.naming.NamingException


Copyright © 2003-2009 Apache Software Foundation. All Rights Reserved.