|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjunit.framework.Assert
junit.framework.TestCase
org.apache.directory.server.core.unit.AbstractTestCase
public abstract class AbstractTestCase
A simple testcase for testing JNDI provider functionality.
Field Summary | |
---|---|
protected boolean |
doDelete
flag whether to delete database files for each test or not |
static java.lang.String |
LDIF
|
static org.slf4j.Logger |
LOG
|
protected java.lang.String |
password
|
protected Registries |
registries
|
protected javax.naming.ldap.LdapContext |
rootDSE
the rootDSE context for the server |
protected javax.naming.ldap.LdapContext |
schemaRoot
the context root for the schema partition |
protected DirectoryService |
service
|
protected javax.naming.ldap.LdapContext |
sysRoot
the context root for the system partition |
protected java.util.List<org.apache.directory.shared.ldap.ldif.LdifEntry> |
testEntries
A testEntries of entries as Attributes to add to the DIT for testing |
protected java.lang.String |
username
|
Constructor Summary | |
---|---|
protected |
AbstractTestCase(java.lang.String username,
java.lang.String password)
|
Method Summary | |
---|---|
protected void |
doDelete(java.io.File wkdir)
Deletes the working directory. |
protected java.util.Hashtable<java.lang.String,java.lang.Object> |
getOverriddenEnvironment()
|
protected void |
injectEntries(java.lang.String ldif)
Inject an ldif String into the server. |
protected void |
overrideEnvironment(java.lang.String key,
java.lang.Object value)
Overrides default JNDI environment properties. |
protected void |
restart()
Restarts the server without loading data when it has been shutdown. |
protected void |
setContextRoots(java.util.Hashtable<java.lang.String,java.lang.Object> env)
Sets the system root taking into account the extras and overrides properties. |
protected void |
setContextRoots(java.lang.String user,
java.lang.String passwd)
Sets and returns the system root. |
protected void |
setLdifPath(java.lang.String ldifPath)
Sets the LDIF path to use. |
protected void |
setLdifPath(java.lang.String ldifPath,
java.lang.Class<?> loadClass)
Sets the LDIF path as a relative resource path to use with the loadClass parameter to load the resource. |
protected void |
setLoadClass(java.lang.Class<?> loadClass)
|
protected void |
setUp()
Get's the initial context factory for the provider's ou=system context root. |
protected void |
shutdown()
Issues a shutdown request to the server. |
protected void |
sync()
Issues a sync request to the server. |
protected void |
tearDown()
Sets the system context root to null. |
Methods inherited from class junit.framework.TestCase |
---|
countTestCases, createResult, getName, run, run, runBare, runTest, setName, toString |
Methods inherited from class junit.framework.Assert |
---|
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 |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final org.slf4j.Logger LOG
public static final java.lang.String LDIF
protected final java.lang.String username
protected final java.lang.String password
protected javax.naming.ldap.LdapContext sysRoot
protected javax.naming.ldap.LdapContext schemaRoot
protected javax.naming.ldap.LdapContext rootDSE
protected boolean doDelete
protected java.util.List<org.apache.directory.shared.ldap.ldif.LdifEntry> testEntries
protected Registries registries
protected DirectoryService service
Constructor Detail |
---|
protected AbstractTestCase(java.lang.String username, java.lang.String password) throws java.lang.Exception
java.lang.Exception
Method Detail |
---|
protected void setLdifPath(java.lang.String ldifPath, java.lang.Class<?> loadClass)
ldifPath
- the relative resource path to the LDIF fileloadClass
- the class used to load the LDIF as a resource streamprotected void setLdifPath(java.lang.String ldifPath)
ldifPath
- the path to the LDIF fileprotected void setUp() throws java.lang.Exception
setUp
in class junit.framework.TestCase
java.lang.Exception
TestCase.setUp()
protected void restart() throws java.lang.Exception
NamingException
- if the restart fails
java.lang.Exception
protected void doDelete(java.io.File wkdir) throws java.io.IOException
wkdir
- the working directory to delete
java.io.IOException
- if the working directory cannot be deletedprotected void setContextRoots(java.lang.String user, java.lang.String passwd) throws java.lang.Exception
user
- the username for authenticating as this userpasswd
- the password of the user
NamingException
- if there is a failure of any kind
java.lang.Exception
protected void setContextRoots(java.util.Hashtable<java.lang.String,java.lang.Object> env) throws java.lang.Exception
env
- an environment to use while setting up the system root.
NamingException
- if there is a failure of any kind
java.lang.Exception
protected void overrideEnvironment(java.lang.String key, java.lang.Object value)
key
- the key of the hashtable entry to add to the environmentvalue
- the value of the hashtable entry to add to the environmentprotected java.util.Hashtable<java.lang.String,java.lang.Object> getOverriddenEnvironment()
protected void shutdown()
protected void sync()
protected void tearDown() throws java.lang.Exception
tearDown
in class junit.framework.TestCase
java.lang.Exception
TestCase.tearDown()
protected void setLoadClass(java.lang.Class<?> loadClass)
protected void injectEntries(java.lang.String ldif) throws java.lang.Exception
ldif
- the ldif containing entries to add to the server.
NamingException
- if there is a problem adding the entries from the LDIF
java.lang.Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |