use of com.unboundid.ldap.listener.AccessLogRequestHandler in project ldapsdk by pingidentity.
the class LDAPDebuggerTestCase method setUp.
/**
* Create the listener that will be used for this class.
*
* @throws Exception If an unexpected problem occurs.
*/
@BeforeClass()
public void setUp() throws Exception {
final File debuggerLogFile = createTempFile();
debuggerLogFile.delete();
final File codeLogFile = createTempFile();
codeLogFile.delete();
final File listenerLogFile = createTempFile();
listenerLogFile.delete();
final AccessLogRequestHandler requestHandler = new AccessLogRequestHandler(new FileHandler(listenerLogFile.getAbsolutePath()), new TestRequestHandler());
final LDAPListenerConfig config = new LDAPListenerConfig(0, requestHandler);
listener = new LDAPListener(config);
listener.startListening();
final int listenerPort = listener.getListenPort();
debugger = new LDAPDebugger(null, null);
assertEquals(debugger.runTool("--hostname", "localhost", "--port", String.valueOf(listenerPort), "--outputFile", debuggerLogFile.getAbsolutePath(), "--codeLogFile", codeLogFile.getAbsolutePath()), ResultCode.SUCCESS);
conn = new LDAPConnection("localhost", debugger.getListener().getListenPort());
TestRequestHandler.setControls(new Control("4.3.2.1", true, new ASN1OctetString("x")), new Control("4.3.2.2", false, new ASN1OctetString("y")));
}
Aggregations