From 3bd757820d295d1bf98c2dccbae18421f8b47a0b Mon Sep 17 00:00:00 2001
From: Matthew Swift <matthew.swift@forgerock.com>
Date: Wed, 15 Jun 2011 21:54:27 +0000
Subject: [PATCH] Fix OPENDJ-202: All bind request APIs should take byte or char arrays for passwords
---
opendj3/opendj-ldap-sdk/src/test/java/org/forgerock/opendj/ldap/ConnectionFactoryTestCase.java | 9 ++++-----
1 files changed, 4 insertions(+), 5 deletions(-)
diff --git a/opendj3/opendj-ldap-sdk/src/test/java/org/forgerock/opendj/ldap/ConnectionFactoryTestCase.java b/opendj3/opendj-ldap-sdk/src/test/java/org/forgerock/opendj/ldap/ConnectionFactoryTestCase.java
index 4ef9978..63677e9 100644
--- a/opendj3/opendj-ldap-sdk/src/test/java/org/forgerock/opendj/ldap/ConnectionFactoryTestCase.java
+++ b/opendj3/opendj-ldap-sdk/src/test/java/org/forgerock/opendj/ldap/ConnectionFactoryTestCase.java
@@ -160,7 +160,7 @@
factories[3][0] = new AuthenticatedConnectionFactory(
new LDAPConnectionFactory("localhost", TestCaseUtils.getLdapPort()),
Requests.newCRAMMD5SASLBindRequest("id:user",
- ByteString.valueOf("password")));
+ "password".toCharArray()));
// LDAPConnectionFactory with default options
factories[4][0] = new LDAPConnectionFactory("localhost",
@@ -189,8 +189,7 @@
factories[6][0] = new AuthenticatedConnectionFactory(
new LDAPConnectionFactory(new InetSocketAddress("127.0.0.1",
TestCaseUtils.getLdapPort()), options), Requests
- .newDigestMD5SASLBindRequest("id:user",
- ByteString.valueOf("password"))
+ .newDigestMD5SASLBindRequest("id:user", "password".toCharArray())
.addQOP(DigestMD5SASLBindRequest.QOP_AUTH_CONF)
.setCipher(DigestMD5SASLBindRequest.CIPHER_LOW));
@@ -282,8 +281,8 @@
// Use the handler to get the result asynchronously.
final CountDownLatch latch = new CountDownLatch(1);
final MyResultHandler handler = new MyResultHandler(latch);
- final FutureResult<AsynchronousConnection> future = factory
- .getAsynchronousConnection(handler);
+ factory.getAsynchronousConnection(handler);
+
// Since we don't have anything to do, we would rather
// be notified by the latch when the other thread calls our handler.
latch.await(); // should do a timed wait rather?
--
Gitblit v1.10.0