// Establish a connection to the server.
Socket s = new Socket("127.0.0.1", TestCaseUtils.getServerLdapPort());
try
{
org.nasutekds.server.tools.LDAPReader r = new org.nasutekds.server.tools.LDAPReader(s);
LDAPWriter w = new LDAPWriter(s);
s.setSoTimeout(15000);
BindRequestProtocolOp bindRequest =
new BindRequestProtocolOp(
ByteString.valueOf("cn=Directory Manager"),
3, ByteString.valueOf("password"));
LDAPMessage message = new LDAPMessage(1, bindRequest);
w.writeMessage(message);
message = r.readMessage();
BindResponseProtocolOp bindResponse = message.getBindResponseProtocolOp();
assertEquals(bindResponse.getResultCode(), LDAPResultCode.SUCCESS);
// Since we are going to be watching the post-response count, we need to
// wait for the server to become idle before kicking off the next request
// to ensure that any remaining post-response processing from the previous
// operation has completed.
assertTrue(DirectoryServer.getWorkQueue().waitUntilIdle(10000));
Lock writeLock = LockManager.lockWrite(entry.getDN());
assertNotNull(writeLock);
try
{
InvocationCounterPlugin.resetAllCounters();
//long modifyDNRequests = ldapStatistics.getModifyDNRequests();
//long modifyDNResponses = ldapStatistics.getModifyDNResponses();
ModifyDNRequestProtocolOp modifyRequest =
new ModifyDNRequestProtocolOp(
ByteString.valueOf(entry.getDN().toString()),
ByteString.valueOf("uid=user.test0"), false);
message = new LDAPMessage(2, modifyRequest);
w.writeMessage(message);
message = r.readMessage();
ModifyDNResponseProtocolOp modifyResponse =
message.getModifyDNResponseProtocolOp();