Search in sources :

Example 11 with TestIntermediateResponseListener

use of com.unboundid.ldap.sdk.TestIntermediateResponseListener in project ldapsdk by pingidentity.

the class GetChangelogBatchExtendedRequestTestCase method testSendRequestWithAlternateIntermediateResponseListener.

/**
 * Provides test coverage for an attempt to send a request to the server and
 * retrieve a result for a case in which no entry listener is in use but the
 * request has a custom intermediate response listener.
 * <BR><BR>
 * Access to a Directory Server instance is required for complete processing.
 *
 * @throws  Exception  If an unexpected problem occurs.
 */
@Test()
public void testSendRequestWithAlternateIntermediateResponseListener() throws Exception {
    if (!isDirectoryInstanceAvailable()) {
        return;
    }
    final LDAPConnection conn = getAdminConnection();
    final GetChangelogBatchExtendedRequest request = new GetChangelogBatchExtendedRequest(new EndOfChangelogStartingPoint(), 0, 0L);
    request.setIntermediateResponseListener(new TestIntermediateResponseListener());
    try {
        conn.processExtendedOperation(request);
        fail("Expected an exception when trying to process a request with a " + "custom intermediate response listener.");
    } catch (final LDAPException le) {
    // This was expected.
    } finally {
        conn.close();
    }
}
Also used : LDAPException(com.unboundid.ldap.sdk.LDAPException) TestIntermediateResponseListener(com.unboundid.ldap.sdk.TestIntermediateResponseListener) LDAPConnection(com.unboundid.ldap.sdk.LDAPConnection) Test(org.testng.annotations.Test)

Aggregations

LDAPConnection (com.unboundid.ldap.sdk.LDAPConnection)11 TestIntermediateResponseListener (com.unboundid.ldap.sdk.TestIntermediateResponseListener)11 Test (org.testng.annotations.Test)11 WhoAmIExtendedRequest (com.unboundid.ldap.sdk.extensions.WhoAmIExtendedRequest)2 AddRequest (com.unboundid.ldap.sdk.AddRequest)1 CompareRequest (com.unboundid.ldap.sdk.CompareRequest)1 DeleteRequest (com.unboundid.ldap.sdk.DeleteRequest)1 LDAPException (com.unboundid.ldap.sdk.LDAPException)1 ModifyDNRequest (com.unboundid.ldap.sdk.ModifyDNRequest)1 ModifyRequest (com.unboundid.ldap.sdk.ModifyRequest)1 PLAINBindRequest (com.unboundid.ldap.sdk.PLAINBindRequest)1 SearchRequest (com.unboundid.ldap.sdk.SearchRequest)1 SearchResult (com.unboundid.ldap.sdk.SearchResult)1 SimpleBindRequest (com.unboundid.ldap.sdk.SimpleBindRequest)1