From bdc5fa0dd0980eb9e077ae80644504705a24e035 Mon Sep 17 00:00:00 2001
From: Yannick Lecaillez <yannick.lecaillez@forgerock.com>
Date: Mon, 07 Nov 2016 13:59:40 +0000
Subject: [PATCH] OPENDJ-3179: Migrate LDAP Connection Handler to SDK Grizzly transport

---
 opendj-grizzly/src/test/java/org/forgerock/opendj/grizzly/GrizzlyLDAPConnectionFactoryTestCase.java |   28 +++++++++++++++++-----------
 1 files changed, 17 insertions(+), 11 deletions(-)

diff --git a/opendj-grizzly/src/test/java/org/forgerock/opendj/grizzly/GrizzlyLDAPConnectionFactoryTestCase.java b/opendj-grizzly/src/test/java/org/forgerock/opendj/grizzly/GrizzlyLDAPConnectionFactoryTestCase.java
index 454b641..59f3ab3 100644
--- a/opendj-grizzly/src/test/java/org/forgerock/opendj/grizzly/GrizzlyLDAPConnectionFactoryTestCase.java
+++ b/opendj-grizzly/src/test/java/org/forgerock/opendj/grizzly/GrizzlyLDAPConnectionFactoryTestCase.java
@@ -17,7 +17,7 @@
 
 import static org.fest.assertions.Assertions.assertThat;
 import static org.fest.assertions.Fail.fail;
-import static org.forgerock.opendj.ldap.CommonLDAPOptions.*;
+import static org.forgerock.opendj.ldap.LDAPListener.*;
 import static org.forgerock.opendj.ldap.LDAPConnectionFactory.*;
 import static org.forgerock.opendj.ldap.TestCaseUtils.*;
 import static org.forgerock.opendj.ldap.requests.Requests.newSimpleBindRequest;
@@ -28,6 +28,7 @@
 import java.io.IOException;
 import java.net.InetSocketAddress;
 import java.net.SocketAddress;
+import java.util.Collections;
 import java.util.Set;
 import java.util.concurrent.Semaphore;
 import java.util.concurrent.TimeUnit;
@@ -71,6 +72,8 @@
 import org.testng.annotations.AfterClass;
 import org.testng.annotations.Test;
 
+import com.forgerock.reactive.ServerConnectionFactoryAdapter;
+
 /**
  * Tests the {@link LDAPConnectionFactory} class.
  */
@@ -349,16 +352,19 @@
 
     private LDAPListener createServer() {
         try {
-            return new LDAPListener(loopbackWithDynamicPort(),
-                    new ServerConnectionFactory<LDAPClientContext, Integer>() {
-                        @Override
-                        public ServerConnection<Integer> handleAccept(
-                                final LDAPClientContext clientContext) throws LdapException {
-                            context.set(clientContext);
-                            connectLatch.release();
-                            return serverConnection;
-                        }
-                    });
+            return new LDAPListener(
+                    Collections.singleton(loopbackWithDynamicPort()),
+                    new ServerConnectionFactoryAdapter(Options.defaultOptions().get(LDAP_DECODE_OPTIONS),
+                        new ServerConnectionFactory<LDAPClientContext, Integer>() {
+                            @Override
+                            public ServerConnection<Integer> handleAccept(final LDAPClientContext clientContext)
+                                    throws LdapException {
+                                context.set(clientContext);
+                                connectLatch.release();
+                                return serverConnection;
+                            }
+                        })
+            );
         } catch (IOException e) {
             fail("Unable to create LDAP listener", e);
             return null;

--
Gitblit v1.10.0