code:   public void testRejectBindWithDNButNoPasswordAsyncMode()
           throws Exception
    {
      final InMemoryDirectoryServer ds = getTestDS(true, true);
  
      final LDAPConnectionOptions options = new LDAPConnectionOptions();
      options.setUseSynchronousMode(false);
  
      final LDAPConnection conn = ds.getConnection(options);
      final SimpleBindRequest bindRequest =
           new SimpleBindRequest("cn=Directory Manager", "");
  
      try
      {
        bindRequest.process(conn, 1);
        fail("Expected an exception when binding with a DN but no password");
      }
      catch (LDAPException le)
      {
        assertEquals(le.getResultCode(), ResultCode.PARAM_ERROR);
      }
  
  
      // Reconfigure the connection so that it will allow binds with a DN but no
      // password.
      conn.getConnectionOptions().setBindWithDNRequiresPassword(false);
      try
      {
        bindRequest.process(conn, 1);
      }
      catch (LDAPException le)
      {
        // The server will still likely reject the operation, but we should at
        // least verify that it wasn't a parameter error.
        assertFalse(le.getResultCode() == ResultCode.PARAM_ERROR);
      }
  
      conn.getConnectionOptions().setBindWithDNRequiresPassword(true);
      conn.close();
    }
  