|
|||||||||
| 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.unit.AbstractServerTest
public abstract class AbstractServerTest
A simple testcase for testing JNDI provider functionality.
| Field Summary | |
|---|---|
protected org.apache.directory.server.configuration.MutableServerStartupConfiguration |
configuration
|
protected boolean |
doDelete
flag whether to delete database files for each test or not |
protected int |
port
|
protected javax.naming.ldap.LdapContext |
rootDSE
the context root for the rootDSE |
protected javax.naming.ldap.LdapContext |
schemaRoot
the context root for the schema |
protected javax.naming.ldap.LdapContext |
sysRoot
the context root for the system partition |
| Constructor Summary | |
|---|---|
AbstractServerTest()
|
|
| Method Summary | |
|---|---|
protected void |
doDelete(java.io.File wkdir)
Deletes the Eve working directory. |
protected javax.naming.ldap.LdapContext |
getWiredContext()
Common code to get an initial context via a simple bind to the server over the wire using the SUN JNDI LDAP provider. |
protected javax.naming.ldap.LdapContext |
getWiredContext(java.lang.String bindPrincipalDn,
java.lang.String password)
Common code to get an initial context via a simple bind to the server over the wire using the SUN JNDI LDAP provider. |
protected void |
importLdif(java.io.InputStream in)
Imports the LDIF entries packaged with the Eve JNDI provider jar into the newly created system partition to prime it up for operation. |
protected void |
injectEntries(java.lang.String ldif)
Inject an ldif String into the server. |
boolean |
isServerOnline()
Tells subclasses whether or not the server is online. |
protected java.util.List<org.apache.directory.shared.ldap.ldif.Entry> |
loadTestLdif(boolean verifyEntries)
If there is an LDIF file with the same name as the test class but with the .ldif extension then it is read and the entries it contains are added to the server. |
protected void |
setContexts(java.util.Hashtable<java.lang.String,java.lang.Object> env)
Sets the contexts of this class taking into account the extras and overrides properties. |
protected void |
setContexts(java.lang.String user,
java.lang.String passwd)
Sets the contexts for this base class. |
protected void |
setUp()
Get's the initial context factory for the provider's ou=system context root. |
protected void |
tearDown()
Sets the system context root to null. |
protected void |
verify(org.apache.directory.shared.ldap.ldif.Entry entry)
Verifies that an entry exists in the directory with the specified attributes. |
| 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 |
|---|
protected javax.naming.ldap.LdapContext sysRoot
protected javax.naming.ldap.LdapContext rootDSE
protected javax.naming.ldap.LdapContext schemaRoot
protected boolean doDelete
protected org.apache.directory.server.configuration.MutableServerStartupConfiguration configuration
protected int port
| Constructor Detail |
|---|
public AbstractServerTest()
| Method Detail |
|---|
public boolean isServerOnline()
protected java.util.List<org.apache.directory.shared.ldap.ldif.Entry> loadTestLdif(boolean verifyEntries)
throws javax.naming.NamingException
verifyEntries - whether or not all entry additions are checked
to see if they were in fact correctly added to the server
javax.naming.NamingException
protected void verify(org.apache.directory.shared.ldap.ldif.Entry entry)
throws javax.naming.NamingException
entry - the entry to verify
javax.naming.NamingException - if there are problems accessing the entry
protected javax.naming.ldap.LdapContext getWiredContext()
throws javax.naming.NamingException
javax.naming.NamingException - if the server cannot be contacted
protected javax.naming.ldap.LdapContext getWiredContext(java.lang.String bindPrincipalDn,
java.lang.String password)
throws javax.naming.NamingException
bindPrincipalDn - the DN of the principal to bind aspassword - the password of the bind principal
javax.naming.NamingException - if the server cannot be contacted
protected void setUp()
throws java.lang.Exception
setUp in class junit.framework.TestCasejava.lang.ExceptionTestCase.setUp()
protected void doDelete(java.io.File wkdir)
throws java.io.IOException
java.io.IOException
protected void setContexts(java.lang.String user,
java.lang.String passwd)
throws javax.naming.NamingException
user - the username for authenticating as this userpasswd - the password of the user
javax.naming.NamingException - if there is a failure of any kind
protected void setContexts(java.util.Hashtable<java.lang.String,java.lang.Object> env)
throws javax.naming.NamingException
env - an environment to use while setting up the system root.
javax.naming.NamingException - if there is a failure of any kind
protected void tearDown()
throws java.lang.Exception
tearDown in class junit.framework.TestCasejava.lang.ExceptionTestCase.tearDown()
protected void importLdif(java.io.InputStream in)
throws javax.naming.NamingException
javax.naming.NamingException - if there are problems reading the ldif file and
adding those entries to the system partition
protected void injectEntries(java.lang.String ldif)
throws javax.naming.NamingException
javax.naming.NamingException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||