You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@directory.apache.org by "Stefan Seelmann (JIRA)" <ji...@apache.org> on 2015/09/20 23:21:04 UTC
[jira] [Created] (DIRSERVER-2094) Cleanup code duplication in tests
Stefan Seelmann created DIRSERVER-2094:
------------------------------------------
Summary: Cleanup code duplication in tests
Key: DIRSERVER-2094
URL: https://issues.apache.org/jira/browse/DIRSERVER-2094
Project: Directory ApacheDS
Issue Type: Task
Reporter: Stefan Seelmann
In tests there is endless duplication of setting up a JNDI LDAP connection, for example:
{code}
Hashtable<String, String> env = new Hashtable<String, String>();
env.put( Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory" );
env.put( Context.PROVIDER_URL, "ldap://" + InetAddress.getLocalHost().getHostName() + ":"
+ getLdapServer().getPort() );
env.put( Context.SECURITY_AUTHENTICATION, "simple" );
env.put( Context.SECURITY_PRINCIPAL, "uid=hnelson,ou=users,dc=example,dc=com" );
env.put( Context.SECURITY_CREDENTIALS, "secret" );
env.put( "java.naming.ldap.attributes.binary", "krb5key" );
{code}
That should (TM) be clean up.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)