use of com.unboundid.ldap.sdk.TestPostConnectProcessor in project ldapsdk by pingidentity.
the class LDAPCommandLineToolTestCase method testGetConnectionPoolExtendedOptions.
/**
* Provides test coverage for the method used to get a connection pool with an
* extended set of options.
* <BR><BR>
* Access to an SSL-enabled Directory Server instance is required for complete
* processing.
*
* @throws Exception If an unexpected problem occurs.
*/
@Test()
public void testGetConnectionPoolExtendedOptions() throws Exception {
if (!isSSLEnabledDirectoryInstanceAvailable()) {
return;
}
LDAPSearch ldapSearch = new LDAPSearch(null, null);
ResultCode rc = ldapSearch.runTool("-h", getTestHost(), "-p", String.valueOf(getTestPort()), "-q", "-X", "-D", getTestBindDN(), "-w", getTestBindPassword(), "-b", "", "-s", "base", "(objectClass=*)");
assertEquals(rc, ResultCode.SUCCESS);
LDAPConnectionPool pool = ldapSearch.getConnectionPool(1, 5, 1, new TestPostConnectProcessor(null, null), new TestPostConnectProcessor(null, null), false, new TestLDAPConnectionPoolHealthCheck());
assertNotNull(pool);
assertNotNull(pool.getRootDSE());
LDAPConnection conn = pool.getConnection();
assertNotNull(conn);
assertNotNull(conn.getRootDSE());
LDAPConnection conn2 = pool.getConnection();
assertNotNull(conn2);
assertNotNull(conn2.getRootDSE());
pool.releaseConnection(conn);
pool.releaseConnection(conn2);
pool.close();
assertTrue(ldapSearch.anyLDAPArgumentsProvided());
}
Aggregations