1 17 package org.apache.ldap.server.jndi; 18 19 20 import org.apache.ldap.server.AbstractCoreTest; 21 22 import javax.naming.Context ; 23 import javax.naming.InitialContext ; 24 import java.util.Hashtable ; 25 26 27 33 public abstract class AbstractMultiUserJndiTest extends AbstractCoreTest 34 { 35 protected ServerLdapContext sysRootAsNonAdminUser; 36 37 38 43 protected void setUp() throws Exception 44 { 45 47 super.setUp(); 48 49 51 Hashtable env = new Hashtable ( ); 52 53 env.put( Context.PROVIDER_URL, "ou=system" ); 54 55 env.put( Context.INITIAL_CONTEXT_FACTORY, "org.apache.ldap.server.jndi.CoreContextFactory" ); 56 57 env.put( Context.SECURITY_PRINCIPAL, "uid=akarasulu,ou=users,ou=system" ); 58 59 env.put( Context.SECURITY_CREDENTIALS, "test" ); 60 61 InitialContext ictx = new InitialContext ( env ); 62 63 sysRootAsNonAdminUser = ( ServerLdapContext ) ictx.lookup( "" ); 64 } 65 66 67 protected void tearDown() throws Exception 68 { 69 super.tearDown(); 70 71 sysRootAsNonAdminUser = null; 72 } 73 } 74 | Popular Tags |