Uploaded image for project: 'Directory ApacheDS'
  1. Directory ApacheDS
  2. DIRSERVER-2094

Cleanup code duplication in tests

    XMLWordPrintableJSON

Details

    • Task
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • None
    • code quality, test
    • None

    Description

      In tests there is endless duplication of setting up a JNDI LDAP connection, for example:

              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" );
      

      That should (TM) be clean up.

      Attachments

        Activity

          People

            Unassigned Unassigned
            seelmann Stefan Seelmann
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: